mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-25 09:32:37 +00:00
Fix #4549. Drawing decorators are now refreshed like the rest of the UI after operations.
This commit is contained in:
@@ -192,6 +192,8 @@ def refresh_ui_data():
|
|||||||
if isinstance(tool.Ifc.get(), ifcopenshell.sqlite):
|
if isinstance(tool.Ifc.get(), ifcopenshell.sqlite):
|
||||||
tool.Ifc.get().clear_cache()
|
tool.Ifc.get().clear_cache()
|
||||||
|
|
||||||
|
bpy.context.scene.DocProperties.should_draw_decorations = bpy.context.scene.DocProperties.should_draw_decorations
|
||||||
|
|
||||||
|
|
||||||
@persistent
|
@persistent
|
||||||
def loadIfcStore(scene):
|
def loadIfcStore(scene):
|
||||||
|
|||||||
@@ -127,7 +127,7 @@ def register():
|
|||||||
bpy.types.Object.BIMAssignedProductProperties = bpy.props.PointerProperty(type=prop.BIMAssignedProductProperties)
|
bpy.types.Object.BIMAssignedProductProperties = bpy.props.PointerProperty(type=prop.BIMAssignedProductProperties)
|
||||||
bpy.types.Object.BIMTextProperties = bpy.props.PointerProperty(type=prop.BIMTextProperties)
|
bpy.types.Object.BIMTextProperties = bpy.props.PointerProperty(type=prop.BIMTextProperties)
|
||||||
bpy.types.TextCurve.BIMTextProperties = bpy.props.PointerProperty(type=prop.BIMTextProperties)
|
bpy.types.TextCurve.BIMTextProperties = bpy.props.PointerProperty(type=prop.BIMTextProperties)
|
||||||
bpy.app.handlers.load_post.append(handler.toggleDecorationsOnLoad)
|
bpy.app.handlers.load_post.append(handler.load_post)
|
||||||
bpy.app.handlers.depsgraph_update_pre.append(handler.depsgraph_update_pre_handler)
|
bpy.app.handlers.depsgraph_update_pre.append(handler.depsgraph_update_pre_handler)
|
||||||
bpy.types.VIEW3D_MT_image_add.append(ui.add_object_button)
|
bpy.types.VIEW3D_MT_image_add.append(ui.add_object_button)
|
||||||
|
|
||||||
@@ -141,6 +141,6 @@ def unregister():
|
|||||||
del bpy.types.Object.BIMAssignedProductProperties
|
del bpy.types.Object.BIMAssignedProductProperties
|
||||||
del bpy.types.Object.BIMTextProperties
|
del bpy.types.Object.BIMTextProperties
|
||||||
del bpy.types.TextCurve.BIMTextProperties
|
del bpy.types.TextCurve.BIMTextProperties
|
||||||
bpy.app.handlers.load_post.remove(handler.toggleDecorationsOnLoad)
|
bpy.app.handlers.load_post.remove(handler.load_post)
|
||||||
bpy.app.handlers.depsgraph_update_pre.remove(handler.depsgraph_update_pre_handler)
|
bpy.app.handlers.depsgraph_update_pre.remove(handler.depsgraph_update_pre_handler)
|
||||||
bpy.types.VIEW3D_MT_image_add.remove(ui.add_object_button)
|
bpy.types.VIEW3D_MT_image_add.remove(ui.add_object_button)
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ from bpy.app.handlers import persistent
|
|||||||
|
|
||||||
|
|
||||||
@persistent
|
@persistent
|
||||||
def toggleDecorationsOnLoad(*args):
|
def load_post(*args):
|
||||||
if bpy.context.scene.DocProperties.should_draw_decorations:
|
if bpy.context.scene.DocProperties.should_draw_decorations:
|
||||||
decoration.DecorationsHandler.install(bpy.context)
|
decoration.DecorationsHandler.install(bpy.context)
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -231,9 +231,8 @@ def update_titleblocks(self, context):
|
|||||||
SheetsData.data["titleblocks"] = SheetsData.titleblocks()
|
SheetsData.data["titleblocks"] = SheetsData.titleblocks()
|
||||||
|
|
||||||
|
|
||||||
def toggleDecorations(self, context):
|
def update_should_draw_decorations(self, context):
|
||||||
toggle = self.should_draw_decorations
|
if self.should_draw_decorations:
|
||||||
if toggle:
|
|
||||||
# TODO: design a proper text variable templating renderer
|
# TODO: design a proper text variable templating renderer
|
||||||
collection = context.scene.camera.BIMObjectProperties.collection
|
collection = context.scene.camera.BIMObjectProperties.collection
|
||||||
for obj in collection.objects:
|
for obj in collection.objects:
|
||||||
@@ -345,7 +344,7 @@ class DocProperties(PropertyGroup):
|
|||||||
active_sheet_index: IntProperty(name="Active Sheet Index")
|
active_sheet_index: IntProperty(name="Active Sheet Index")
|
||||||
ifc_files: CollectionProperty(name="IFCs", type=StrProperty)
|
ifc_files: CollectionProperty(name="IFCs", type=StrProperty)
|
||||||
drawing_styles: CollectionProperty(name="Drawing Styles", type=DrawingStyle)
|
drawing_styles: CollectionProperty(name="Drawing Styles", type=DrawingStyle)
|
||||||
should_draw_decorations: BoolProperty(name="Should Draw Decorations", update=toggleDecorations)
|
should_draw_decorations: BoolProperty(name="Should Draw Decorations", update=update_should_draw_decorations)
|
||||||
sheets_dir: StringProperty(default=os.path.join("sheets") + os.path.sep, name="Default Sheets Directory")
|
sheets_dir: StringProperty(default=os.path.join("sheets") + os.path.sep, name="Default Sheets Directory")
|
||||||
layouts_dir: StringProperty(default=os.path.join("layouts") + os.path.sep, name="Default Layouts Directory")
|
layouts_dir: StringProperty(default=os.path.join("layouts") + os.path.sep, name="Default Layouts Directory")
|
||||||
titleblocks_dir: StringProperty(
|
titleblocks_dir: StringProperty(
|
||||||
|
|||||||
Reference in New Issue
Block a user