Reset not applied objects scales during project save

We try to apply scales using bim.update_representation and if didn't worked (presumably because object has openings) we reset the scales.
It was confusing for users that they scaled an object, saved IFC and they would know that scaling didn't worked only after they reopen the IFC project.
This commit is contained in:
Andrej730
2024-10-24 17:38:51 +05:00
parent 1642f231fb
commit 99dc4795c7
+5
View File
@@ -146,6 +146,11 @@ class IfcExporter:
return
if tool.Geometry.is_scaled(obj):
bpy.ops.bim.update_representation(obj=obj.name)
# update_representation might not apply scale if the object has openings
# reset it, so let user know that the scale wasn't saved.
if tool.Geometry.is_scaled(obj):
print(f"WARNING. Object '{obj.name}' scales ({obj.scale[:]}) are reset during project save.")
obj.scale = (1.0, 1.0, 1.0)
return element
if element.is_a("IfcGridAxis"):
return self.sync_grid_axis_object_placement(obj, element)