mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 01:41:57 +00:00
Scale changes are now auto synchronised on export.
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user