Bonsai: route array-regen selection through tool.Blender utilities

Rewrite tool.Array.select_only_parent as a thin call to
tool.Blender.select_and_activate_single_object; drop the ad-hoc
per-child deselect loop and the unused parent_element parameter.

Replace the tail parent_obj.select_set(True) in _regenerate_array_body
with tool.Blender.set_object_selection, which wraps select_set in the
hidden-object try/except the utility already owns.

Relates to #8088.

Generated with the assistance of an AI coding tool.
This commit is contained in:
Gorgious56
2026-07-08 14:53:29 +02:00
parent 9191baf067
commit da50d22ed5
4 changed files with 9 additions and 23 deletions
@@ -537,7 +537,7 @@ class TestSelectOnlyParent(NewFile):
child_obj = tool.Ifc.get_object(child_element)
child_obj.select_set(True)
tool.Array.select_only_parent(obj, element, bpy.context)
tool.Array.select_only_parent(obj, bpy.context)
assert obj in bpy.context.selected_objects
assert bpy.context.view_layer.objects.active is obj