mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-26 10:11:46 +00:00
Fix #6359. No longer sync materials at export sync we have a proper material / style manager now not Blender materials.
This commit is contained in:
@@ -100,27 +100,12 @@ class IfcExporter:
|
|||||||
result = self.sync_object_placement(obj)
|
result = self.sync_object_placement(obj)
|
||||||
if result:
|
if result:
|
||||||
results.append(result)
|
results.append(result)
|
||||||
result = self.sync_object_material(obj)
|
|
||||||
# TODO: sync_object_material always returns None
|
|
||||||
# so it's never really appended
|
|
||||||
if result:
|
if result:
|
||||||
results.append(result)
|
results.append(result)
|
||||||
except ReferenceError:
|
except ReferenceError:
|
||||||
pass # The object is likely deleted
|
pass # The object is likely deleted
|
||||||
return results
|
return results
|
||||||
|
|
||||||
def sync_object_material(self, obj: bpy.types.Object) -> None:
|
|
||||||
if not obj.data or not isinstance(obj.data, bpy.types.Mesh):
|
|
||||||
return
|
|
||||||
if not self.has_changed_materials(obj):
|
|
||||||
return
|
|
||||||
bpy.ops.bim.update_representation(obj=obj.name)
|
|
||||||
|
|
||||||
def has_changed_materials(self, obj: bpy.types.Object) -> bool:
|
|
||||||
mprops = tool.Geometry.get_mesh_props(obj.data)
|
|
||||||
checksum = mprops.material_checksum
|
|
||||||
return checksum != tool.Geometry.get_material_checksum(obj)
|
|
||||||
|
|
||||||
def sync_object_placement(self, obj: bpy.types.Object) -> Union[ifcopenshell.entity_instance, None]:
|
def sync_object_placement(self, obj: bpy.types.Object) -> Union[ifcopenshell.entity_instance, None]:
|
||||||
element = self.file.by_id(tool.Blender.get_object_bim_props(obj).ifc_definition_id)
|
element = self.file.by_id(tool.Blender.get_object_bim_props(obj).ifc_definition_id)
|
||||||
if tool.Geometry.is_scaled(obj):
|
if tool.Geometry.is_scaled(obj):
|
||||||
|
|||||||
Reference in New Issue
Block a user