Skip to content

Show emissive meshes in the Light Group panel - #14

Open
riouxr wants to merge 3 commits into
mainfrom
fix/lightgroup-emissive-and-cleanup
Open

Show emissive meshes in the Light Group panel#14
riouxr wants to merge 3 commits into
mainfrom
fix/lightgroup-emissive-and-cleanup

Conversation

@riouxr

@riouxr riouxr commented Aug 10, 2026

Copy link
Copy Markdown
Owner

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.py filtered every list on obj.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 Strength socket, 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

  • Solo restore iterates the visibility backup instead of rescanning the scene. A mesh whose emission is edited away while a group is soloed previously fell out of the scan and stayed hidden with no way back.
  • Emissive lookup is cached per material and invalidated from a depsgraph_update_post handler on Material updates only — node-tree walks stay out of the redraw path, and object transforms no longer force a full rescan.
  • Removed 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.
  • blender_manifest.toml still 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:

Check Result
Add-on registers / unregisters cleanly pass
Emission strength 5 listed; strength 0 and black-colour not listed pass
Default Principled BSDF not listed pass
Principled with emission turned up listed pass
Emission behind a Mix Shader found (recursion) pass
Empty material slot does not raise pass
Cache refreshes after a shader edit pass
Assign / Unassign round-trip on an emissive mesh pass
Solo hides non-members, keeps members pass
Unsolo restores the user's own pre-existing hidden state pass

Icon identifiers used in the new rows were validated against UILayout.bl_rna.

🤖 Generated with Claude Code

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>
riouxr and others added 2 commits August 10, 2026 14:04
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>
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.

Emissive material stopped showing [2.4.5]

1 participant