mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-17 22:11:36 +00:00
New feature to unlink Blender materials and IFC materials
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
@material
|
||||
Feature: Material
|
||||
|
||||
Scenario: Unlink object
|
||||
Given an empty IFC project
|
||||
And I add a cube
|
||||
And the object "Cube" is selected
|
||||
And I add a material
|
||||
And I press "bim.add_material"
|
||||
When I press "bim.unlink_material"
|
||||
Then the material "Material" is not an IFC material
|
||||
@@ -30,7 +30,7 @@ Scenario: Unlink style
|
||||
And I add a material
|
||||
And I press "bim.add_style"
|
||||
When I press "bim.unlink_style"
|
||||
Then nothing happens
|
||||
Then the material "Material" is not an IFC style
|
||||
|
||||
Scenario: Enable editing style
|
||||
Given an empty IFC project
|
||||
|
||||
@@ -159,6 +159,14 @@ def the_object_name_exists(name) -> bpy.types.Object:
|
||||
return obj
|
||||
|
||||
|
||||
@then(parsers.parse('the material "{name}" exists'))
|
||||
def the_material_name_exists(name) -> bpy.types.Material:
|
||||
obj = bpy.data.materials.get(name)
|
||||
if not obj:
|
||||
assert False, f'The material "{name}" does not exist'
|
||||
return obj
|
||||
|
||||
|
||||
@then("an IFC file does not exist")
|
||||
def an_ifc_file_does_not_exist():
|
||||
ifc = IfcStore.get_file()
|
||||
@@ -249,6 +257,18 @@ def the_object_name_is_not_an_ifc_element(name):
|
||||
assert id == 0, f"The ID is {id}"
|
||||
|
||||
|
||||
@then(parsers.parse('the material "{name}" is not an IFC material'))
|
||||
def the_material_name_is_not_an_ifc_material(name):
|
||||
id = the_material_name_exists(name).BIMObjectProperties.ifc_definition_id
|
||||
assert id == 0, f"The ID is {id}"
|
||||
|
||||
|
||||
@then(parsers.parse('the material "{name}" is not an IFC style'))
|
||||
def the_material_name_is_not_an_ifc_material(name):
|
||||
id = the_material_name_exists(name).BIMMaterialProperties.ifc_style_id
|
||||
assert id == 0, f"The ID is {id}"
|
||||
|
||||
|
||||
@then(parsers.parse('the object "{name}" has "{number}" vertices'))
|
||||
def the_object_name_has_number_vertices(name, number):
|
||||
total = len(the_object_name_exists(name).data.vertices)
|
||||
|
||||
Reference in New Issue
Block a user