Scale changes are now auto synchronised on export.

This commit is contained in:
Dion Moult
2021-11-09 09:21:54 +11:00
parent aa18c1b7d6
commit 8a4bc34fad
2 changed files with 16 additions and 0 deletions
@@ -132,6 +132,9 @@ class IfcExporter:
def sync_object_placement(self, obj):
blender_matrix = np.array(obj.matrix_world)
element = self.file.by_id(obj.BIMObjectProperties.ifc_definition_id)
if list(obj.scale) != [1., 1., 1.]:
bpy.ops.bim.update_representation(obj=obj.name)
return element
if element.is_a("IfcGridAxis"):
return self.sync_grid_axis_object_placement(obj, element)
if not hasattr(element, "ObjectPlacement"):
@@ -374,3 +374,16 @@ Scenario: Export IFC - with changed spatial container synchronised
And an empty Blender session is started
And I press "bim.load_project(filepath='{cwd}/test/files/export.ifc')"
Then the object "IfcSlab/Slab" is in the collection "IfcBuildingStorey/Level 1"
Scenario: Export IFC - with changed object scale synchronised
Given an empty IFC project
And I add a cube
And the object "Cube" is selected
And I set "scene.BIMRootProperties.ifc_class" to "IfcWall"
And I press "bim.assign_class"
And the object "IfcWall/Cube" is selected
When the object "IfcWall/Cube" is scaled to "2"
And I press "export_ifc.bim(filepath='{cwd}/test/files/export.ifc')"
And an empty Blender session is started
And I press "bim.load_project(filepath='{cwd}/test/files/export.ifc')"
Then the object "IfcWall/Cube" dimensions are "4,4,4"