diff --git a/src/blenderbim/blenderbim/bim/module/material/__init__.py b/src/blenderbim/blenderbim/bim/module/material/__init__.py index ab63c8043e..437003800c 100644 --- a/src/blenderbim/blenderbim/bim/module/material/__init__.py +++ b/src/blenderbim/blenderbim/bim/module/material/__init__.py @@ -58,7 +58,6 @@ classes = ( operator.SelectByMaterial, operator.UnassignMaterial, operator.UnassignMaterialStyle, - operator.UnlinkMaterial, prop.Material, prop.BIMMaterialProperties, prop.BIMObjectMaterialProperties, diff --git a/src/blenderbim/blenderbim/bim/module/material/operator.py b/src/blenderbim/blenderbim/bim/module/material/operator.py index faa12e02a4..3866ff263e 100644 --- a/src/blenderbim/blenderbim/bim/module/material/operator.py +++ b/src/blenderbim/blenderbim/bim/module/material/operator.py @@ -198,16 +198,6 @@ class RemoveMaterialSet(bpy.types.Operator, tool.Ifc.Operator): core.remove_material_set(tool.Ifc, tool.Material, material=tool.Ifc.get().by_id(self.material)) -class UnlinkMaterial(bpy.types.Operator, tool.Ifc.Operator): - bl_idname = "bim.unlink_material" - bl_label = "Unlink Material" - bl_options = {"REGISTER", "UNDO"} - material: bpy.props.IntProperty(name="Material ID") - - def _execute(self, context): - core.unlink_material(tool.Ifc, obj=tool.Ifc.get_object(tool.Ifc.get().by_id(self.material))) - - class AssignMaterial(bpy.types.Operator, tool.Ifc.Operator): bl_idname = "bim.assign_material" bl_label = "Assign Material" diff --git a/src/blenderbim/blenderbim/bim/module/material/ui.py b/src/blenderbim/blenderbim/bim/module/material/ui.py index 5861ad398a..e823f32938 100644 --- a/src/blenderbim/blenderbim/bim/module/material/ui.py +++ b/src/blenderbim/blenderbim/bim/module/material/ui.py @@ -69,8 +69,6 @@ class BIM_PT_materials(Panel): op.material = material.ifc_definition_id op = row.operator("bim.enable_editing_material_style", text="", icon="SHADING_RENDERED") op.material = material.ifc_definition_id - op = row.operator("bim.unlink_material", icon="UNLINKED", text="") - op.material = material.ifc_definition_id row.operator("bim.remove_material", text="", icon="X").material = material.ifc_definition_id self.draw_editing_ui() diff --git a/src/blenderbim/blenderbim/core/material.py b/src/blenderbim/blenderbim/core/material.py index 5a33704ead..eb81c6df98 100644 --- a/src/blenderbim/blenderbim/core/material.py +++ b/src/blenderbim/blenderbim/core/material.py @@ -25,10 +25,6 @@ if TYPE_CHECKING: import blenderbim.tool as tool -def unlink_material(ifc: tool.Ifc, obj: bpy.types.Material) -> None: - ifc.unlink(obj=obj) - - def add_material( ifc: tool.Ifc, material: tool.Material, diff --git a/src/blenderbim/test/bim/feature/material.feature b/src/blenderbim/test/bim/feature/material.feature index 290e8aaf0c..438eb93358 100644 --- a/src/blenderbim/test/bim/feature/material.feature +++ b/src/blenderbim/test/bim/feature/material.feature @@ -59,15 +59,6 @@ Scenario: Remove material set When I press "bim.remove_material_set(material={material})" Then nothing happens -Scenario: Unlink material - 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(obj='Material')" - When I press "bim.unlink_material" - Then the material "Material" is not an IFC material - Scenario: Assign material - single material Given an empty IFC project And I add a cube diff --git a/src/blenderbim/test/core/test_material.py b/src/blenderbim/test/core/test_material.py index 32e7abb2ca..ee7d5189cc 100644 --- a/src/blenderbim/test/core/test_material.py +++ b/src/blenderbim/test/core/test_material.py @@ -20,12 +20,6 @@ import blenderbim.core.material as subject from test.core.bootstrap import ifc, material, style, spatial -class TestUnlinkMaterial: - def test_run(self, ifc): - ifc.unlink(obj="obj").should_be_called() - subject.unlink_material(ifc, obj="obj") - - class TestAddMaterial: def test_add_a_default_material(self, ifc, material, style): material.add_default_material_object("name").should_be_called().will_return("obj")