#2094. Deleting materials now also deletes Blender material if not used for a style

This commit is contained in:
Dion Moult
2022-03-21 12:04:51 +11:00
parent ea530858bd
commit c478e5bf1b
10 changed files with 114 additions and 18 deletions
@@ -46,8 +46,18 @@ Scenario: Remove material
And the object "Cube" is selected
And I add a material
And I press "bim.add_material(obj='Material')"
When I press "bim.remove_material"
Then the material "Material" is not an IFC material
And the variable "material" is "{ifc}.by_type('IfcMaterial')[0].id()"
When I press "bim.remove_material(material={material})"
Then the material "Material" does not exist
Scenario: Remove material set
Given an empty IFC project
And I set "scene.BIMMaterialProperties.material_type" to "IfcMaterialLayerSet"
And I press "bim.load_materials"
And I press "bim.add_material_set(set_type='IfcMaterialLayerSet')"
And the variable "material" is "{ifc}.by_type('IfcMaterialLayerSet')[0].id()"
When I press "bim.remove_material_set(material={material})"
Then nothing happens
Scenario: Unlink material
Given an empty IFC project
+5
View File
@@ -297,6 +297,11 @@ def the_material_name_exists(name) -> bpy.types.Material:
return obj
@then(parsers.parse('the material "{name}" does not exist'))
def the_material_name_does_not_exist(name):
assert bpy.data.materials.get(name) is None, "Material exists"
@then("an IFC file does not exist")
def an_ifc_file_does_not_exist():
ifc = IfcStore.get_file()