From 47440edb8b011d79c793c7975dad61e8b999400b Mon Sep 17 00:00:00 2001 From: Dion Moult Date: Fri, 6 Aug 2021 10:26:18 +1000 Subject: [PATCH] Fix bug where undoing broke the IFC link for child objects --- src/blenderbim/blenderbim/bim/ifc.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/blenderbim/blenderbim/bim/ifc.py b/src/blenderbim/blenderbim/bim/ifc.py index 6390ac630f..c83dc0e613 100644 --- a/src/blenderbim/blenderbim/bim/ifc.py +++ b/src/blenderbim/blenderbim/bim/ifc.py @@ -79,15 +79,18 @@ class IfcStore: in a regular Python list, there is the likely probability that the object will be invalidated when undo or redo occurs. Object invalidation seems to only occur for selected objects either pre/post undo/redo event, including - selected objects for consecutive undo/redos. + selected objects for consecutive undo/redos, and all children. So if I first select o1, then o2, then o3, then press undo, o3 will be invalidated. If instead I press undo twice, o3 and o2 will be invalidated. """ if bpy.context.active_object: objects = set([o.name for o in bpy.context.selected_objects + [bpy.context.active_object]]) + objects.update([o.name for o in bpy.context.active_object.children]) else: objects = set([o.name for o in bpy.context.selected_objects]) + for obj in bpy.context.selected_objects: + objects.update([o.name for o in obj.children]) IfcStore.undo_redo_stack_objects |= objects @staticmethod