Fix bug where edit mode syncing didn't work if you edited many objects at once

This commit is contained in:
Dion Moult
2021-04-18 19:58:07 +10:00
parent 6bb63817af
commit 6c8858e51d
+12 -11
View File
@@ -9,17 +9,18 @@ from ifcopenshell.api.attribute.data import Data as AttributeData
def mode_callback(obj, data): def mode_callback(obj, data):
if ( for obj in bpy.context.selected_objects:
obj.mode != "OBJECT" if (
or not obj.data obj.mode != "OBJECT"
or not isinstance(obj.data, bpy.types.Mesh) or not obj.data
or not obj.data.BIMMeshProperties.ifc_definition_id or not isinstance(obj.data, bpy.types.Mesh)
or not bpy.context.scene.BIMProjectProperties.is_authoring or not obj.data.BIMMeshProperties.ifc_definition_id
): or not bpy.context.scene.BIMProjectProperties.is_authoring
return ):
representation = IfcStore.get_file().by_id(obj.data.BIMMeshProperties.ifc_definition_id) return
if representation.RepresentationType == "Tessellation" or representation.RepresentationType == "Brep": representation = IfcStore.get_file().by_id(obj.data.BIMMeshProperties.ifc_definition_id)
IfcStore.edited_objs.add(obj.name) if representation.RepresentationType == "Tessellation" or representation.RepresentationType == "Brep":
IfcStore.edited_objs.add(obj.name)
def name_callback(obj, data): def name_callback(obj, data):