Fix bug where an added default material was not linked and auto synced.

This commit is contained in:
Dion Moult
2021-11-10 18:01:10 +11:00
parent a7b3b5261f
commit 28e5af853d
11 changed files with 55 additions and 42 deletions
-19
View File
@@ -34,22 +34,3 @@ class TestAddDefaultMaterialObject(NewFile):
material = subject.add_default_material_object()
assert isinstance(material, bpy.types.Material)
assert material.name == "Default"
class TestLink(NewFile):
def test_run(self):
obj = bpy.data.materials.new("Material")
ifc = ifcopenshell.file()
material = ifc.createIfcMaterial()
subject.link(material, obj)
assert obj.BIMObjectProperties.ifc_definition_id == material.id()
class TestUnlink(NewFile):
def test_run(self):
obj = bpy.data.materials.new("Material")
ifc = ifcopenshell.file()
material = ifc.createIfcMaterial()
subject.link(material, obj)
subject.unlink(obj)
assert obj.BIMObjectProperties.ifc_definition_id == 0