feat: GPU rendering + material matching + perf improvements

- GPU: fix Cycles device activation order — set compute_device_type
  BEFORE engine init, re-set AFTER open_mainfile wipes preferences
- GPU: remove _mark_sharp_and_seams edit-mode loop (redundant with
  Blender 5.0 shade_smooth_by_angle), saves ~200s/render on 175 parts
- Material: fix _AFN suffix mismatch — build AF-stripped mat_map keys
  and add prefix fallback in _apply_material_library (blender_render.py)
- Material: production GLB now uses get_material_library_path() which
  checks active AssetLibrary instead of empty legacy system setting
- Admin: RenderTemplateTable multi-select output types (M2M frontend)
- Admin: MaterialLibraryPanel replaced with link to Asset Libraries
- UX: move Toaster to top-left to avoid dispatch button overlap
- SQLAlchemy: add .unique() to all RenderTemplate M2M collection queries
- Logging: flush=True on all Blender progress prints, stdout reconfigure

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-08 19:05:03 +01:00
parent 934728da77
commit ee6eb34b4c
34 changed files with 1274 additions and 511 deletions
@@ -0,0 +1,36 @@
"""M2M table for render templates ↔ output types.
Allows one render template to be linked to multiple output types.
Revision ID: 047
Revises: 046
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects.postgresql import UUID
revision = "047"
down_revision = "046"
branch_labels = None
depends_on = None
def upgrade() -> None:
op.create_table(
"render_template_output_types",
sa.Column("template_id", UUID(as_uuid=True), sa.ForeignKey("render_templates.id", ondelete="CASCADE"), nullable=False),
sa.Column("output_type_id", UUID(as_uuid=True), sa.ForeignKey("output_types.id", ondelete="CASCADE"), nullable=False),
sa.PrimaryKeyConstraint("template_id", "output_type_id"),
)
# Backfill from existing render_templates.output_type_id
op.execute("""
INSERT INTO render_template_output_types (template_id, output_type_id)
SELECT id, output_type_id FROM render_templates
WHERE output_type_id IS NOT NULL
ON CONFLICT DO NOTHING
""")
def downgrade() -> None:
op.drop_table("render_template_output_types")