semagnum / light-painter

Blender add-on that creates lights based on where the user paints.
https://semagnum.github.io/light-painter/
GNU General Public License v3.0
310 stars 6 forks source link

Mesh light paint working on other selected objects #70

Closed semagnum closed 4 months ago

semagnum commented 4 months ago

Unintentionally found in #69, if user:

It starts converting the selected object that's not a light. It shouldn't change any geometry outside the tool's new object(s).

semagnum commented 4 months ago

Root cause: the bpy.ops actions act on selected objects, not just the active one. So any using bpy.ops (at least the mesh ones, as they are more complicated) will need to deselect objects before continuing

semagnum commented 4 months ago

A bug introduced, mentioned in #69 - memory re-allocation during tool usage prevents object references from always being preserved. Will save object selection by object name instead.

semagnum commented 4 months ago

Quick fix, can no longer reproduce👍🏻