Indicate in UI if object's ifc placement/representation is not synced

Example - https://imgur.com/a/lixOxeN

Ideally users shouldn't need those as syncing should work seamlessly but since we do have syncing it can be useful if you can check sync status from the UI.
This commit is contained in:
Andrej730
2024-07-01 16:26:54 +05:00
parent bd7ee0a1c6
commit 0f8f6419e9
2 changed files with 16 additions and 2 deletions
@@ -53,6 +53,10 @@ class Operator:
class EditObjectPlacement(bpy.types.Operator, Operator):
bl_idname = "bim.edit_object_placement"
bl_label = "Edit Object Placement"
bl_description = (
"Write selected objects placements to IFC.\n"
"A star in the operator name indicates that active object placement in IFC is not yet synced with Blender"
)
bl_options = {"REGISTER", "UNDO"}
obj: bpy.props.StringProperty()
@@ -305,6 +309,10 @@ class PurgeUnusedRepresentations(bpy.types.Operator, Operator):
class UpdateRepresentation(bpy.types.Operator, Operator):
bl_idname = "bim.update_representation"
bl_label = "Update Representation"
bl_description = (
"Write selected objects representations to IFC.\n"
"A star in the operator name indicates that active object representation in IFC is not yet synced with Blender"
)
bl_options = {"REGISTER", "UNDO"}
obj: bpy.props.StringProperty()
ifc_representation_class: bpy.props.StringProperty()
@@ -352,7 +352,10 @@ class BIM_PT_mesh(Panel):
layout = self.layout
row = layout.row()
row.operator("bim.update_representation", text="Manually Save Representation")
text = "Manually Save Representation"
if tool.Ifc.is_edited(context.active_object):
text += "*"
row.operator("bim.update_representation", text=text)
row = layout.row()
row.operator("bim.copy_representation", text="Copy Mesh From Active To Selected")
@@ -447,7 +450,10 @@ class BIM_PT_derived_coordinates(Panel):
DerivedCoordinatesData.load()
row = self.layout.row()
row.operator("bim.edit_object_placement", icon="EXPORT")
text = "Edit Object Placement"
if tool.Ifc.is_moved(context.active_object):
text += "*"
row.operator("bim.edit_object_placement", text=text, icon="EXPORT")
row = self.layout.row()
row.label(text="XYZ Dimensions")