Skip to content

Add per-drawing render overrides (status_render module)#8171

Open
theoryshaw wants to merge 2 commits into
v0.8.0from
drawing_render_overrides
Open

Add per-drawing render overrides (status_render module)#8171
theoryshaw wants to merge 2 commits into
v0.8.0from
drawing_render_overrides

Conversation

@theoryshaw

Copy link
Copy Markdown
Member

Adds a new "Render Overrides" panel under the active drawing that applies render effects to IFC elements selected by a filter. Each drawing holds a list of rules; each rule has its own filter (reusing the shared Search filter system) plus exposure, gamma, and transparency.

Effects use the mechanism that can actually show them:

  • Exposure/gamma: compositor nodes masked per rule via Cryptomatte, built just before a render and torn down after. Cryptomatte (not the Object Index pass) is used because EEVEE Next always renders Object Index as 0 (Blender #121690); it works in both EEVEE and Cycles.
  • Transparency: a temporary Transparent-BSDF material applied to the matched objects so the geometry behind shows through. Because it is a real material it also shows live in the Rendered viewport (WYSIWYG), and is restored after the render / on toggle off / before save.

The single enable toggle drives both render and live viewport preview. Switching the active drawing (msgbus on scene.camera) re-syncs the preview and auto-enables a drawing that already has rules. Editing a rule's filter query (including clearing it) updates the preview immediately.

Rules are persisted to the IFC model at EPset_Drawing.RenderOverrides (JSON, declared in the pset template as IfcText), so they travel with the drawing: written on add/remove and on save, read back on file load and IFC import (via data.refresh / refresh_ui_data, since load_post fires before the import creates the cameras).

The override only runs where the compositor does (F12 and Default-render drawing underlays); the panel disables the toggle when the applied CurrentShadingStyle is not a Default render type.

Files:

  • bim/module/status_render/: new module (operator, prop, ui, data, NOTES)
  • bim/init.py: register the module
  • bim/data/pset/EPset_Drawing.ifc: add RenderOverrides property template
  • tool/search.py: status_render filter resolver, on_filter_query_edited dispatch, graceful empty-query handling
  • bim/module/search/operator.py: notify on_filter_query_edited after edits

Generated with the assistance of an AI coding tool.

Adds a new "Render Overrides" panel under the active drawing that applies
render effects to IFC elements selected by a filter. Each drawing holds a
list of rules; each rule has its own filter (reusing the shared Search
filter system) plus exposure, gamma, and transparency.

Effects use the mechanism that can actually show them:
- Exposure/gamma: compositor nodes masked per rule via Cryptomatte, built
  just before a render and torn down after. Cryptomatte (not the Object
  Index pass) is used because EEVEE Next always renders Object Index as 0
  (Blender #121690); it works in both EEVEE and Cycles.
- Transparency: a temporary Transparent-BSDF material applied to the matched
  objects so the geometry behind shows through. Because it is a real material
  it also shows live in the Rendered viewport (WYSIWYG), and is restored after
  the render / on toggle off / before save.

The single enable toggle drives both render and live viewport preview.
Switching the active drawing (msgbus on scene.camera) re-syncs the preview
and auto-enables a drawing that already has rules. Editing a rule's filter
query (including clearing it) updates the preview immediately.

Rules are persisted to the IFC model at EPset_Drawing.RenderOverrides (JSON,
declared in the pset template as IfcText), so they travel with the drawing:
written on add/remove and on save, read back on file load and IFC import
(via data.refresh / refresh_ui_data, since load_post fires before the import
creates the cameras).

The override only runs where the compositor does (F12 and Default-render
drawing underlays); the panel disables the toggle when the applied
CurrentShadingStyle is not a Default render type.

Files:
- bim/module/status_render/: new module (operator, prop, ui, data, NOTES)
- bim/__init__.py: register the module
- bim/data/pset/EPset_Drawing.ifc: add RenderOverrides property template
- tool/search.py: status_render filter resolver, on_filter_query_edited
  dispatch, graceful empty-query handling
- bim/module/search/operator.py: notify on_filter_query_edited after edits

Generated with the assistance of an AI coding tool.
…ection

Wrap the underlay/linework/annotation toggles, Draw Linked Projects (and its
nested "Linked Projects to Draw" panel), and the drawing config (target view,
linework/fill/cut modes, material layers, width/height/depth, scale, DPI) in a
single collapsible layout.panel, collapsed by default, to declutter the
BIM_PT_camera panel.

Generated with the assistance of an AI coding tool.
@theoryshaw theoryshaw force-pushed the drawing_render_overrides branch from bf4b398 to f9ac17e Compare June 17, 2026 17:53
@theoryshaw

Copy link
Copy Markdown
Member Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant