diff --git a/src/bonsai/bonsai/bim/export_ifc.py b/src/bonsai/bonsai/bim/export_ifc.py index b9f88a4316..cef23924e2 100644 --- a/src/bonsai/bonsai/bim/export_ifc.py +++ b/src/bonsai/bonsai/bim/export_ifc.py @@ -144,7 +144,7 @@ class IfcExporter: element = self.file.by_id(obj.BIMObjectProperties.ifc_definition_id) if not tool.Ifc.is_moved(obj): return - if (obj.scale - Vector((1.0, 1.0, 1.0))).length > 1e-4: + if tool.Geometry.is_scaled(obj): bpy.ops.bim.update_representation(obj=obj.name) return element if element.is_a("IfcGridAxis"): diff --git a/src/bonsai/bonsai/tool/drawing.py b/src/bonsai/bonsai/tool/drawing.py index eda2ad4e6e..88ce914f5b 100644 --- a/src/bonsai/bonsai/tool/drawing.py +++ b/src/bonsai/bonsai/tool/drawing.py @@ -1548,7 +1548,7 @@ class Drawing(bonsai.core.tool.Drawing): def sync_object_placement(cls, obj: bpy.types.Object) -> Union[ifcopenshell.entity_instance, None]: blender_matrix = np.array(obj.matrix_world) element = tool.Ifc.get_entity(obj) - if (obj.scale - mathutils.Vector((1.0, 1.0, 1.0))).length > 1e-4: + if tool.Geometry.is_scaled(obj): bpy.ops.bim.update_representation(obj=obj.name) return element if element.is_a("IfcGridAxis"): diff --git a/src/bonsai/bonsai/tool/geometry.py b/src/bonsai/bonsai/tool/geometry.py index aee9f154fd..953a27741c 100644 --- a/src/bonsai/bonsai/tool/geometry.py +++ b/src/bonsai/bonsai/tool/geometry.py @@ -83,7 +83,7 @@ class Geometry(bonsai.core.tool.Geometry): @classmethod def clear_scale(cls, obj: bpy.types.Object) -> None: # Note that clearing scale has no impact on cameras. - if (obj.scale - Vector((1.0, 1.0, 1.0))).length > 1e-4: + if cls.is_scaled(obj): if not obj.data: location, rotation, _ = obj.matrix_world.decompose() obj.matrix_world = Matrix.Translation(location) @ rotation.to_matrix().to_4x4()