mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-19 06:39:13 +00:00
Small refactor for sync_edited_objects
1) remove materials if-branch as they're never edited 2) validate object explicitly
This commit is contained in:
@@ -115,17 +115,12 @@ class IfcExporter:
|
|||||||
for obj in IfcStore.edited_objs.copy():
|
for obj in IfcStore.edited_objs.copy():
|
||||||
if not obj:
|
if not obj:
|
||||||
continue
|
continue
|
||||||
try:
|
if not tool.Blender.is_valid_data_block(obj):
|
||||||
if isinstance(obj, bpy.types.Material):
|
continue
|
||||||
# TODO: do we add materials to edited_objs?
|
element = tool.Ifc.get_entity(obj)
|
||||||
continue
|
if element:
|
||||||
else:
|
results.append(element)
|
||||||
element = tool.Ifc.get_entity(obj)
|
bpy.ops.bim.update_representation(obj=obj.name)
|
||||||
if element:
|
|
||||||
results.append(element)
|
|
||||||
bpy.ops.bim.update_representation(obj=obj.name)
|
|
||||||
except ReferenceError:
|
|
||||||
pass # The object is likely deleted
|
|
||||||
IfcStore.edited_objs.clear()
|
IfcStore.edited_objs.clear()
|
||||||
return results
|
return results
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user