Keeps selected objects selected when switching from one drawing to an… (#4745)

Keeps selected objects selected when switching from one drawing to another. As discussed: proposed: https://community.osarch.org/discussion/2179/not-unselecting-objects-when-switching-from-one-drawing-to-the-other#latest
This commit is contained in:
Ryan Schultz
2024-06-02 09:05:38 -05:00
committed by GitHub
parent 23fee9c8c8
commit 47704b1625
2 changed files with 6 additions and 4 deletions
@@ -484,10 +484,6 @@ def activate_drawing_view(
drawing_tool.import_annotations_in_group(drawing_tool.get_drawing_group(drawing))
blender.activate_camera(camera)
drawing_tool.isolate_camera_collection(camera)
try:
blender.set_active_object(camera)
except:
raise CameraNotAvailableError()
drawing_tool.activate_drawing(camera)
@@ -1752,6 +1752,8 @@ class Drawing(blenderbim.core.tool.Drawing):
@classmethod
def activate_drawing(cls, camera: bpy.types.Object) -> None:
selected_objects_before = bpy.context.selected_objects
# Sync viewport objects visibility with selectors from EPset_Drawing/Include and /Exclude
drawing = tool.Ifc.get_entity(camera)
@@ -1839,6 +1841,10 @@ class Drawing(blenderbim.core.tool.Drawing):
cls.import_camera_props(drawing, camera)
for obj in selected_objects_before:
obj.hide_set(False)
obj.select_set(True)
@classmethod
def get_elements_in_camera_view(
cls, camera: bpy.types.Object, objs: list[ifcopenshell.entity_instance]