Show emissive meshes in the Light Group panel - #14
Open
riouxr wants to merge 3 commits into
Open
Conversation
The Light Group panel filtered every list on obj.type == 'LIGHT', so emissive meshes could never appear there even though Cycles assigns them to light groups like any other emitter. Lights and emissive meshes are now resolved through one helper used by the panel, Assign/Unassign, Deselect All, solo and group removal. Also restores is_emissive_node_active, which "cleanup code" (8d679a8) dropped along with its call site. Without it node type alone decided the answer, and since every Principled BSDF carries an Emission Strength socket that marked every ordinary material as emissive. It is now shared by both panels so their lists agree. Solo restore iterates the visibility backup rather than the scene, so a mesh whose emission is edited away while a group is soloed still gets its visibility back instead of being left hidden. Emissive lookup is cached per material and invalidated from a depsgraph handler on Material updates only, keeping node-tree walks out of the redraw path without going stale when a shader is edited. Additionally: - Removes a module-level execute() and _disable_material_node() from LightEditor.py. Both had been dedented out of their classes and were unreachable; nothing referenced either name. - Fixes blender_manifest.toml, which still described a mesh display-type add-on and tagged itself "Mesh". That text is what Blender shows in the extensions list. Fixes #13 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
`blender --command extension validate` rejects the zip otherwise: key "tagline" invalid: a value no longer than 64 characters expected. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #13.
The reported bug
Emissive materials never appeared in the Light Groups panel. Cycles assigns emissive meshes to light groups like any other emitter, but
LightGroup.pyfiltered every list onobj.type == 'LIGHT', so they were excluded by construction — from the group lists, Assign/Unassign, Deselect All, solo, and group removal.All of those now go through one helper that resolves lights and emissive meshes.
A second bug found while fixing it
is_emissive_node_active()was added in 702d252 ("emission at 0 or with color at black don't show up in list anymore") and then deleted, along with its call site, by 8d679a8 ("cleanup code").Without it, node type alone decided whether a material was emissive — and every Principled BSDF carries an
Emission Strengthsocket, so every ordinary material qualified. It is restored and now shared by both panels, so the Light Editor and Light Group lists agree on what counts as emissive.Other changes in this branch
depsgraph_update_posthandler on Material updates only — node-tree walks stay out of the redraw path, and object transforms no longer force a full rescan.execute()and_disable_material_node()fromLightEditor.py. Both had been dedented out of their classes and were unreachable; nothing referenced either name.blender_manifest.tomlstill read"Adds buttons to quickly switch between mesh display types"and tagged itself"Mesh". That is the text Blender shows in the extensions list.Verification
Headless suite against Blender 5.1.2, all passing:
Icon identifiers used in the new rows were validated against
UILayout.bl_rna.🤖 Generated with Claude Code