mirror of
https://github.com/blw1138/Zordon.git
synced 2025-12-17 16:58:12 +00:00
Update pack_project script for Blender
This commit is contained in:
@@ -61,7 +61,7 @@ class Blender(BaseRenderEngine):
|
||||
scene_info = None
|
||||
try:
|
||||
results = cls.run_python_script(project_path, os.path.join(os.path.dirname(os.path.realpath(__file__)),
|
||||
'scripts', 'get_blender_info.py'), timeout=timeout)
|
||||
'scripts', 'blender', 'get_file_info.py'), timeout=timeout)
|
||||
result_text = results.stdout.decode()
|
||||
for line in result_text.splitlines():
|
||||
if line.startswith('SCENE_DATA:'):
|
||||
@@ -75,15 +75,9 @@ class Blender(BaseRenderEngine):
|
||||
@classmethod
|
||||
def pack_project_file(cls, project_path, timeout=30):
|
||||
# Credit to L0Lock for pack script - https://blender.stackexchange.com/a/243935
|
||||
pack_expression = "import bpy\n" \
|
||||
"bpy.ops.file.pack_all()\n" \
|
||||
"bpy.ops.file.make_paths_absolute()\n" \
|
||||
"myPath = bpy.data.filepath\n" \
|
||||
"myPath = str(myPath)\n" \
|
||||
"bpy.ops.wm.save_as_mainfile(filepath=myPath[:-6]+'_packed'+myPath[-6:])"
|
||||
|
||||
try:
|
||||
results = Blender.run_python_expression(project_path, pack_expression, timeout=timeout)
|
||||
results = cls.run_python_script(project_path, os.path.join(os.path.dirname(os.path.realpath(__file__)),
|
||||
'scripts', 'blender', 'pack_project.py'), timeout=timeout)
|
||||
|
||||
result_text = results.stdout.decode()
|
||||
dir_name = os.path.dirname(project_path)
|
||||
|
||||
Reference in New Issue
Block a user