mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 09:21:46 +00:00
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:
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user