Files
Petru Conduraru 2988696161 Bonsai: keep "disable selection" objects visible when activating a drawing (#7681)
tool.Blender.isolate_objects keeps objects visible by selecting the
intended set and then hiding everything unselected via
hide_view_set(unselected=True). Blender refuses to select an object whose
"disable selection" (hide_select) is enabled, so such an object is treated
as unselected and hidden. Activating a drawing therefore turned off any
object that had disable-selection on.

Temporarily clear hide_select on the target objects so they can be
selected (and thus kept visible), then restore it. The clear/restore is
wrapped in try/finally so hide_select is always restored even if the hide
operator raises.

Verified in headless Blender with real objects: an object with
hide_select set is hidden by the pre-fix logic and stays visible with the
fix, hide_select is preserved, and unrelated objects are still hidden.

Generated with the assistance of an AI coding tool.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-12 08:29:56 +03:00
..