-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexport_glb_blender.py
More file actions
28 lines (25 loc) · 828 Bytes
/
export_glb_blender.py
File metadata and controls
28 lines (25 loc) · 828 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import subprocess
def run_blender_script(script_path):
blender_path = r"C:\Program Files\Blender Foundation\Blender 4.4\blender.exe" # ✅ Update path if needed
cmd = [
blender_path,
"--background",
"--python",
script_path
]
try:
result = subprocess.run(
cmd,
check=True,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
text=True
)
print("✅ Blender Output:\n", result.stdout)
if result.stderr:
print("⚠️ Blender Errors:\n", result.stderr)
except subprocess.CalledProcessError as e:
print("❌ Blender Failed:")
print("STDOUT:\n", e.stdout)
print("STDERR:\n", e.stderr)
raise # Let it bubble up to the main app for full traceback