@@ -1519,16 +1519,20 @@ class ActivateDrawing(bpy.types.Operator):
1519
1519
bl_idname = "bim.activate_drawing"
1520
1520
bl_label = "Activate Drawing"
1521
1521
bl_options = {"REGISTER" , "UNDO" }
1522
- bl_description = "Activates the selected drawing view.\n \n " + "ALT+CLICK to keep the viewport position"
1522
+ bl_description = "Activates the selected drawing view.\n \n " + "ALT+CLICK to keep the viewport position. \n \n " + "SHIFT+CLICK activiate drawing without turning objects on/off. "
1523
1523
1524
1524
drawing : bpy .props .IntProperty ()
1525
1525
camera_view_point : bpy .props .BoolProperty (name = "Camera View Point" , default = True , options = {"SKIP_SAVE" })
1526
+ switch_camera_only : bpy .props .BoolProperty (name = "Only Changes Camera View" , default = False , options = {"SKIP_SAVE" })
1526
1527
1527
1528
def invoke (self , context , event ):
1528
1529
# keep the viewport position on alt+click
1529
1530
# make sure to use SKIP_SAVE on property, otherwise it might get stuck
1530
1531
if event .type == "LEFTMOUSE" and event .alt :
1531
1532
self .camera_view_point = False
1533
+ # Only activates the camera view on shift+click. Does not turn on/off objects in scene
1534
+ if event .type == "LEFTMOUSE" and event .shift :
1535
+ self .switch_camera_only = True
1532
1536
return self .execute (context )
1533
1537
1534
1538
def execute (self , context ):
@@ -1537,30 +1541,34 @@ def execute(self, context):
1537
1541
drawing = tool .Ifc .get ().by_id (self .drawing )
1538
1542
dprops = bpy .context .scene .DocProperties
1539
1543
1540
- if not self .camera_view_point :
1541
- viewport_position = tool .Blender .get_viewport_position ()
1542
-
1543
- core .activate_drawing_view (tool .Ifc , tool .Blender , tool .Drawing , drawing = drawing )
1544
-
1545
- if not self .camera_view_point :
1546
- tool .Blender .set_viewport_position (viewport_position )
1547
-
1548
- dprops .active_drawing_id = self .drawing
1549
- # reset DrawingsData to reload_drawing_styles work correctly
1550
- DrawingsData .is_loaded = False
1551
- dprops .drawing_styles .clear ()
1552
- if ifcopenshell .util .element .get_pset (drawing , "EPset_Drawing" , "HasUnderlay" ):
1553
- bpy .ops .bim .reload_drawing_styles ()
1554
- bpy .ops .bim .activate_drawing_style ()
1555
- core .sync_references (tool .Ifc , tool .Collector , tool .Drawing , drawing = tool .Ifc .get ().by_id (self .drawing ))
1556
- CutDecorator .install (context )
1557
- tool .Drawing .show_decorations ()
1558
-
1559
- # Save drawing bounds to the .ifc file
1560
- camera = context .scene .camera
1561
- camera_props = camera .data .BIMCameraProperties
1562
- if camera_props .update_representation (camera ):
1563
- bpy .ops .bim .update_representation (obj = camera .name , ifc_representation_class = "" )
1544
+ if self .switch_camera_only :
1545
+ camera = tool .Drawing .import_drawing (drawing )
1546
+ tool .Blender .activate_camera (camera )
1547
+ else :
1548
+ if not self .camera_view_point :
1549
+ viewport_position = tool .Blender .get_viewport_position ()
1550
+
1551
+ core .activate_drawing_view (tool .Ifc , tool .Blender , tool .Drawing , drawing = drawing )
1552
+
1553
+ if not self .camera_view_point :
1554
+ tool .Blender .set_viewport_position (viewport_position )
1555
+
1556
+ dprops .active_drawing_id = self .drawing
1557
+ # reset DrawingsData to reload_drawing_styles work correctly
1558
+ DrawingsData .is_loaded = False
1559
+ dprops .drawing_styles .clear ()
1560
+ if ifcopenshell .util .element .get_pset (drawing , "EPset_Drawing" , "HasUnderlay" ):
1561
+ bpy .ops .bim .reload_drawing_styles ()
1562
+ bpy .ops .bim .activate_drawing_style ()
1563
+ core .sync_references (tool .Ifc , tool .Collector , tool .Drawing , drawing = tool .Ifc .get ().by_id (self .drawing ))
1564
+ CutDecorator .install (context )
1565
+ tool .Drawing .show_decorations ()
1566
+
1567
+ # Save drawing bounds to the .ifc file
1568
+ camera = context .scene .camera
1569
+ camera_props = camera .data .BIMCameraProperties
1570
+ if camera_props .update_representation (camera ):
1571
+ bpy .ops .bim .update_representation (obj = camera .name , ifc_representation_class = "" )
1564
1572
1565
1573
1566
1574
return {"FINISHED" }
0 commit comments