mirror of
https://github.com/blw1138/Zordon.git
synced 2025-12-17 16:58:12 +00:00
Packing Blender file now creates a zip
This commit is contained in:
@@ -4,6 +4,9 @@ except ImportError:
|
||||
from base_engine import *
|
||||
import json
|
||||
import re
|
||||
import logging
|
||||
|
||||
logger = logging.getLogger()
|
||||
|
||||
|
||||
class Blender(BaseRenderEngine):
|
||||
@@ -76,6 +79,7 @@ class Blender(BaseRenderEngine):
|
||||
def pack_project_file(cls, project_path, timeout=30):
|
||||
# Credit to L0Lock for pack script - https://blender.stackexchange.com/a/243935
|
||||
try:
|
||||
logger.info(f"Starting to pack Blender file: {project_path}")
|
||||
results = cls.run_python_script(project_path, os.path.join(os.path.dirname(os.path.realpath(__file__)),
|
||||
'scripts', 'blender', 'pack_project.py'), timeout=timeout)
|
||||
|
||||
@@ -87,10 +91,10 @@ class Blender(BaseRenderEngine):
|
||||
for err in not_found:
|
||||
logger.error(err)
|
||||
|
||||
p = re.compile('Info: Saved "(.*)"')
|
||||
p = re.compile('Saved to: (.*)\n')
|
||||
match = p.search(result_text)
|
||||
if match:
|
||||
new_path = os.path.join(dir_name, match.group(1))
|
||||
new_path = os.path.join(dir_name, match.group(1).strip())
|
||||
logger.info(f'Blender file packed successfully to {new_path}')
|
||||
return new_path
|
||||
except Exception as e:
|
||||
|
||||
Reference in New Issue
Block a user