chore: snapshot workflow migration progress
This commit is contained in:
@@ -13,6 +13,10 @@ import json
|
||||
import math
|
||||
from mathutils import Vector, Matrix
|
||||
|
||||
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
|
||||
|
||||
from _blender_template_inputs import apply_template_inputs
|
||||
|
||||
# ── Colour palette (matches blender_render.py / Three.js renderer) ───────────
|
||||
PALETTE_HEX = [
|
||||
"#4C9BE8", "#E85B4C", "#4CBE72", "#E8A84C", "#A04CE8",
|
||||
@@ -369,6 +373,14 @@ def main():
|
||||
_idx = argv.index("--material-override")
|
||||
_material_override = argv[_idx + 1] if _idx + 1 < len(argv) else None
|
||||
|
||||
template_inputs = {}
|
||||
if "--template-inputs" in argv:
|
||||
_idx = argv.index("--template-inputs")
|
||||
try:
|
||||
template_inputs = json.loads(argv[_idx + 1]) if _idx + 1 < len(argv) else {}
|
||||
except Exception:
|
||||
template_inputs = {}
|
||||
|
||||
# Ensure scripts dir is on path for shared module imports
|
||||
_scripts_dir = os.path.dirname(os.path.abspath(__file__))
|
||||
if _scripts_dir not in sys.path:
|
||||
@@ -421,6 +433,8 @@ def main():
|
||||
print("[turntable_render] no template — using factory settings (Mode A)")
|
||||
if material_library_path:
|
||||
print(f"[turntable_render] material_library={material_library_path}, material_map keys={list(material_map.keys())}")
|
||||
if template_inputs:
|
||||
print(f"[turntable_render] template_inputs={template_inputs}")
|
||||
|
||||
# ── SCENE SETUP ──────────────────────────────────────────────────────────
|
||||
_usd_mat_lookup: dict = {} # populated by import_usd_file when USD path is used
|
||||
@@ -429,6 +443,7 @@ def main():
|
||||
# ── MODE B: Template-based render ────────────────────────────────────
|
||||
print(f"[turntable_render] Opening template: {template_path}")
|
||||
bpy.ops.wm.open_mainfile(filepath=template_path)
|
||||
apply_template_inputs(template_inputs)
|
||||
|
||||
# Find or create target collection
|
||||
target_col = _ensure_collection(target_collection)
|
||||
|
||||
Reference in New Issue
Block a user