mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 01:41:57 +00:00
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:
@@ -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"},
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user