Fix bug where style colours were not auto synchronised.

This commit is contained in:
Dion Moult
2021-11-11 14:18:44 +11:00
parent 9355969110
commit d5b92c0fea
13 changed files with 106 additions and 49 deletions
+4 -2
View File
@@ -36,7 +36,9 @@ class Geometry(blenderbim.core.tool.Geometry):
@classmethod
def clear_cache(cls, element):
IfcStore.get_cache().remove(element.GlobalId)
cache = IfcStore.get_cache()
if cache:
cache.remove(element.GlobalId)
@classmethod
def clear_modifiers(cls, obj):
@@ -224,7 +226,7 @@ class Geometry(blenderbim.core.tool.Geometry):
def replace_object_with_empty(cls, obj):
element = tool.Ifc.get_entity(obj)
name = obj.name
tool.Ifc.unlink(obj)
tool.Ifc.unlink(obj=obj, element=element)
obj.name = ifcopenshell.guid.new()
new_obj = bpy.data.objects.new(name, None)
if element:
-8
View File
@@ -108,11 +108,3 @@ class Style(blenderbim.core.tool.Style):
def import_surface_attributes(cls, style, obj):
obj.BIMStyleProperties.attributes.clear()
blenderbim.bim.helper.import_attributes2(style, obj.BIMStyleProperties.attributes)
@classmethod
def link(cls, style, obj):
obj.BIMMaterialProperties.ifc_style_id = style.id()
@classmethod
def unlink(self, obj):
obj.BIMMaterialProperties.ifc_style_id = 0