mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-21 10:53:46 +00:00
#2094. Deleting materials now also deletes Blender material if not used for a style
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user