fix: material override pipeline — pass --material-override CLI arg to Blender scripts

The initial implementation only overrode the material_map dict in the task,
but the Blender USD primvar path bypassed it. Now:
- Added --material-override named CLI arg parsed in _blender_args.py
- Both Mode A (factory) and Mode B (template) in _blender_scene_setup.py
  override usd_material_lookup and material_map when set
- Passed through full chain: task → step_processor → render_blender → CLI → Blender
- Tested: 175-part bearing rendered with single Steel-Bare material (1/1 materials)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-14 14:19:21 +01:00
parent 7c606953ec
commit c054236d22
5 changed files with 42 additions and 2 deletions
+6
View File
@@ -73,6 +73,11 @@ def parse_args() -> SimpleNamespace:
_sw_idx = sys.argv.index("--sensor-width")
sensor_width_mm_override = float(sys.argv[_sw_idx + 1]) if _sw_idx + 1 < len(sys.argv) else None
material_override = None
if "--material-override" in sys.argv:
_mo_idx = sys.argv.index("--material-override")
material_override = sys.argv[_mo_idx + 1] if _mo_idx + 1 < len(sys.argv) else None
if template_path and not os.path.isfile(template_path):
print(f"[blender_render] ERROR: template not found: {template_path}")
sys.exit(1)
@@ -108,4 +113,5 @@ def parse_args() -> SimpleNamespace:
use_template=bool(template_path),
focal_length_mm=focal_length_mm,
sensor_width_mm=sensor_width_mm_override,
material_override=material_override,
)