remove bim.unlink_material #4843

This commit is contained in:
Andrej730
2024-06-11 18:01:09 +05:00
parent f803447651
commit 2fbac57faf
6 changed files with 0 additions and 32 deletions
@@ -58,7 +58,6 @@ classes = (
operator.SelectByMaterial,
operator.UnassignMaterial,
operator.UnassignMaterialStyle,
operator.UnlinkMaterial,
prop.Material,
prop.BIMMaterialProperties,
prop.BIMObjectMaterialProperties,
@@ -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"
@@ -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()
@@ -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,
@@ -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
@@ -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")