mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-23 07:42:41 +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
|
continue
|
||||||
|
|
||||||
if self.should_add_representation and isinstance(obj.data, bpy.types.Mesh) and obj.data.polygons:
|
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):
|
if tool.Geometry.mesh_has_loose_geometry(obj.data):
|
||||||
self.report(
|
self.report(
|
||||||
{"WARNING"},
|
{"WARNING"},
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ Scenario: Add representation - add a representation with a scale factor applied
|
|||||||
Then the object "IfcWall/Cube" has no scale
|
Then the object "IfcWall/Cube" has no scale
|
||||||
And the object "IfcWall/Cube" dimensions are "4,4,4"
|
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
|
Given an empty IFC project
|
||||||
And I add a cube
|
And I add a cube
|
||||||
And I press "object.duplicate_move_linked"
|
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 set "scene.BIMRootProperties.ifc_class" to "IfcWall"
|
||||||
And I press "bim.assign_class"
|
And I press "bim.assign_class"
|
||||||
Then the object "IfcWall/Cube" has no scale
|
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
|
Scenario: Switch representation
|
||||||
Given an empty IFC project
|
Given an empty IFC project
|
||||||
|
|||||||
Reference in New Issue
Block a user