mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-23 07:42:41 +00:00
Fix bug where adding a new material didn't make it immediately available
This commit is contained in:
@@ -2,6 +2,7 @@ import bpy
|
|||||||
import json
|
import json
|
||||||
import ifcopenshell.api
|
import ifcopenshell.api
|
||||||
import ifcopenshell.util.attribute
|
import ifcopenshell.util.attribute
|
||||||
|
from blenderbim.bim.module.material.prop import purge as material_prop_purge
|
||||||
from blenderbim.bim.ifc import IfcStore
|
from blenderbim.bim.ifc import IfcStore
|
||||||
from ifcopenshell.api.material.data import Data
|
from ifcopenshell.api.material.data import Data
|
||||||
from ifcopenshell.api.profile.data import Data as ProfileData
|
from ifcopenshell.api.profile.data import Data as ProfileData
|
||||||
@@ -44,6 +45,7 @@ class AddMaterial(bpy.types.Operator):
|
|||||||
result = ifcopenshell.api.run("material.add_material", self.file, **{"Name": obj.name})
|
result = ifcopenshell.api.run("material.add_material", self.file, **{"Name": obj.name})
|
||||||
obj.BIMObjectProperties.ifc_definition_id = result.id()
|
obj.BIMObjectProperties.ifc_definition_id = result.id()
|
||||||
Data.load(IfcStore.get_file())
|
Data.load(IfcStore.get_file())
|
||||||
|
material_prop_purge()
|
||||||
return {"FINISHED"}
|
return {"FINISHED"}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user