Tweak failing test to now allow assigning elements to scaled multi-user objects

Previously this was not allowed, but I don't see why not
This commit is contained in:
Dion Moult
2025-02-08 00:20:25 +11:00
parent 7bc1992963
commit 889a9e3891
2 changed files with 8 additions and 3 deletions
@@ -212,7 +212,12 @@ class AssignClass(bpy.types.Operator, tool.Ifc.Operator):
continue
if self.should_add_representation and isinstance(obj.data, bpy.types.Mesh) and obj.data.polygons:
bpy.ops.object.transform_apply(location=False, rotation=False, scale=True, properties=False)
if obj.scale != (1, 1, 1):
if obj.data.users > 1:
bpy.ops.object.make_single_user(
object=True, obdata=True, material=False, animation=False, obdata_animation=False
)
bpy.ops.object.transform_apply(location=False, rotation=False, scale=True, properties=False)
if tool.Geometry.mesh_has_loose_geometry(obj.data):
self.report(
{"WARNING"},
+2 -2
View File
@@ -55,7 +55,7 @@ Scenario: Add representation - add a representation with a scale factor applied
Then the object "IfcWall/Cube" has no scale
And the object "IfcWall/Cube" dimensions are "4,4,4"
Scenario: Add representation - add a representation with a scale factor removed due to multiple users
Scenario: Add representation - add a representation with a scale factor still applied regardless of multiple users
Given an empty IFC project
And I add a cube
And I press "object.duplicate_move_linked"
@@ -65,7 +65,7 @@ Scenario: Add representation - add a representation with a scale factor removed
And I set "scene.BIMRootProperties.ifc_class" to "IfcWall"
And I press "bim.assign_class"
Then the object "IfcWall/Cube" has no scale
And the object "IfcWall/Cube" dimensions are "2,2,2"
And the object "IfcWall/Cube" dimensions are "4,4,4"
Scenario: Switch representation
Given an empty IFC project