mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-19 22:50:21 +00:00
Fix bug where switching to an object with modifiers applied would double the effect of modifiers.
This commit is contained in:
@@ -33,6 +33,26 @@ Scenario: Switch representation
|
||||
And I press "bim.switch_representation(obj='IfcWall/Cube', ifc_definition_id={representation})"
|
||||
Then nothing happens
|
||||
|
||||
Scenario: Switch representation - existing Blender modifiers must be purged
|
||||
Given an empty IFC project
|
||||
And I add a cube
|
||||
And the object "Cube" is selected
|
||||
And I add an array modifier
|
||||
And I set "scene.BIMRootProperties.ifc_class" to "IfcWall"
|
||||
And I press "bim.assign_class"
|
||||
When the variable "representation" is "{ifc}.by_type('IfcShapeRepresentation')[0].id()"
|
||||
And I press "bim.switch_representation(obj='IfcWall/Cube', ifc_definition_id={representation})"
|
||||
Then the object "IfcWall/Cube" has no modifiers
|
||||
|
||||
Scenario: Update representation
|
||||
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 I press "bim.update_representation(obj='IfcWall/Cube')"
|
||||
Then the object "IfcWall/Cube" has a "Tessellation" representation of "Model/Body/MODEL_VIEW"
|
||||
|
||||
Scenario: Copy representation
|
||||
Given an empty IFC project
|
||||
And I add a cube
|
||||
|
||||
@@ -94,6 +94,11 @@ def i_add_a_material():
|
||||
bpy.context.active_object.active_material = bpy.data.materials.new("Material")
|
||||
|
||||
|
||||
@given("I add an array modifier")
|
||||
def i_add_a_cube():
|
||||
bpy.ops.object.modifier_add(type="ARRAY")
|
||||
|
||||
|
||||
@when(parsers.parse('I add a cube of size "{size}" at "{location}"'))
|
||||
def i_add_a_cube_of_size_size_at_location(size, location):
|
||||
bpy.ops.mesh.primitive_cube_add(size=float(size), location=[float(co) for co in location.split(",")])
|
||||
@@ -424,3 +429,8 @@ def the_file_name_should_contain_value(name, value):
|
||||
name = replace_variables(name)
|
||||
with open(name, "r") as f:
|
||||
assert value in f.read()
|
||||
|
||||
|
||||
@then(parsers.parse('the object "{name}" has no modifiers'))
|
||||
def the_object_name_has_no_modifiers(name):
|
||||
assert len(the_object_name_exists(name).modifiers) == 0
|
||||
|
||||
Reference in New Issue
Block a user