feat: global material override on OutputType for x-ray/clay render modes
- Add `material_override` nullable column on OutputType (DB migration) - When set, ALL product parts get rendered with this single material - Override applies after alias resolution in render_order_line task - Admin UI: dropdown in OutputType table to select a library material - Display: amber badge showing active override material name Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -198,6 +198,12 @@ def render_order_line_task(self, order_line_id: str):
|
||||
from app.services.material_service import resolve_material_map
|
||||
material_map = resolve_material_map(material_map)
|
||||
|
||||
# Apply global material override from OutputType (e.g. x-ray mode)
|
||||
if line.output_type and line.output_type.material_override:
|
||||
override_mat = line.output_type.material_override
|
||||
material_map = {k: override_mat for k in material_map}
|
||||
emit(order_line_id, f"Material override active: all parts → {override_mat}")
|
||||
|
||||
if template:
|
||||
emit(order_line_id, f"Using render template: {template.name} (collection={template.target_collection}, material_replace={template.material_replace_enabled}, lighting_only={template.lighting_only})")
|
||||
logger.info(f"Render template resolved: '{template.name}' path={template.blend_file_path}, lighting_only={template.lighting_only}")
|
||||
|
||||
Reference in New Issue
Block a user