mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-10-03 05:22:06 +00:00
Only allow material assignment if we have available materials to assign. See #1222.
This commit is contained in:
@@ -25,6 +25,7 @@ class AddMaterial(bpy.types.Operator):
|
||||
self.file = IfcStore.get_file()
|
||||
result = add_material.Usecase(self.file, {"Name": obj.name}).execute()
|
||||
obj.BIMObjectProperties.ifc_definition_id = result.id()
|
||||
Data.load()
|
||||
return {"FINISHED"}
|
||||
|
||||
|
||||
@@ -40,6 +41,7 @@ class RemoveMaterial(bpy.types.Operator):
|
||||
self.file, {"material": self.file.by_id(obj.BIMObjectProperties.ifc_definition_id)}
|
||||
).execute()
|
||||
obj.BIMObjectProperties.ifc_definition_id = 0
|
||||
Data.load()
|
||||
return {"FINISHED"}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user