File tree 4 files changed +8
-7
lines changed
src/blenderbim/blenderbim/bim
4 files changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -192,6 +192,8 @@ def refresh_ui_data():
192
192
if isinstance (tool .Ifc .get (), ifcopenshell .sqlite ):
193
193
tool .Ifc .get ().clear_cache ()
194
194
195
+ bpy .context .scene .DocProperties .should_draw_decorations = bpy .context .scene .DocProperties .should_draw_decorations
196
+
195
197
196
198
@persistent
197
199
def loadIfcStore (scene ):
Original file line number Diff line number Diff line change @@ -127,7 +127,7 @@ def register():
127
127
bpy .types .Object .BIMAssignedProductProperties = bpy .props .PointerProperty (type = prop .BIMAssignedProductProperties )
128
128
bpy .types .Object .BIMTextProperties = bpy .props .PointerProperty (type = prop .BIMTextProperties )
129
129
bpy .types .TextCurve .BIMTextProperties = bpy .props .PointerProperty (type = prop .BIMTextProperties )
130
- bpy .app .handlers .load_post .append (handler .toggleDecorationsOnLoad )
130
+ bpy .app .handlers .load_post .append (handler .load_post )
131
131
bpy .app .handlers .depsgraph_update_pre .append (handler .depsgraph_update_pre_handler )
132
132
bpy .types .VIEW3D_MT_image_add .append (ui .add_object_button )
133
133
@@ -141,6 +141,6 @@ def unregister():
141
141
del bpy .types .Object .BIMAssignedProductProperties
142
142
del bpy .types .Object .BIMTextProperties
143
143
del bpy .types .TextCurve .BIMTextProperties
144
- bpy .app .handlers .load_post .remove (handler .toggleDecorationsOnLoad )
144
+ bpy .app .handlers .load_post .remove (handler .load_post )
145
145
bpy .app .handlers .depsgraph_update_pre .remove (handler .depsgraph_update_pre_handler )
146
146
bpy .types .VIEW3D_MT_image_add .remove (ui .add_object_button )
Original file line number Diff line number Diff line change 23
23
24
24
25
25
@persistent
26
- def toggleDecorationsOnLoad (* args ):
26
+ def load_post (* args ):
27
27
if bpy .context .scene .DocProperties .should_draw_decorations :
28
28
decoration .DecorationsHandler .install (bpy .context )
29
29
else :
Original file line number Diff line number Diff line change @@ -231,9 +231,8 @@ def update_titleblocks(self, context):
231
231
SheetsData .data ["titleblocks" ] = SheetsData .titleblocks ()
232
232
233
233
234
- def toggleDecorations (self , context ):
235
- toggle = self .should_draw_decorations
236
- if toggle :
234
+ def update_should_draw_decorations (self , context ):
235
+ if self .should_draw_decorations :
237
236
# TODO: design a proper text variable templating renderer
238
237
collection = context .scene .camera .BIMObjectProperties .collection
239
238
for obj in collection .objects :
@@ -345,7 +344,7 @@ class DocProperties(PropertyGroup):
345
344
active_sheet_index : IntProperty (name = "Active Sheet Index" )
346
345
ifc_files : CollectionProperty (name = "IFCs" , type = StrProperty )
347
346
drawing_styles : CollectionProperty (name = "Drawing Styles" , type = DrawingStyle )
348
- should_draw_decorations : BoolProperty (name = "Should Draw Decorations" , update = toggleDecorations )
347
+ should_draw_decorations : BoolProperty (name = "Should Draw Decorations" , update = update_should_draw_decorations )
349
348
sheets_dir : StringProperty (default = os .path .join ("sheets" ) + os .path .sep , name = "Default Sheets Directory" )
350
349
layouts_dir : StringProperty (default = os .path .join ("layouts" ) + os .path .sep , name = "Default Layouts Directory" )
351
350
titleblocks_dir : StringProperty (
You can’t perform that action at this time.
0 commit comments