diff options
author | Ryan Inch <mythologylover75@gmail.com> | 2020-04-18 09:43:46 +0300 |
---|---|---|
committer | Julien Duroure <julien.duroure@gmail.com> | 2020-04-18 10:04:15 +0300 |
commit | 583a81397e1f45542c7264eb7f29c6253912e8d7 (patch) | |
tree | 631e6b14f66789fa22f2c6314247cbedeea9ebca /object_collection_manager/operators.py | |
parent | 926d8beb555d9e1308c544a3d7b525a74c1261a5 (diff) |
Collection Manager: Expander fix. Task T69577
Fix expanded and expand history not getting updated
on collection removal.
Diffstat (limited to 'object_collection_manager/operators.py')
-rw-r--r-- | object_collection_manager/operators.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/object_collection_manager/operators.py b/object_collection_manager/operators.py index b1d4d4ca..c1259acd 100644 --- a/object_collection_manager/operators.py +++ b/object_collection_manager/operators.py @@ -851,6 +851,7 @@ class CMRemoveCollectionOperator(Operator): def execute(self, context): global rto_history + global expand_history global qcd_slots cm = context.scene.collection_manager @@ -872,8 +873,16 @@ class CMRemoveCollectionOperator(Operator): parent_collection.children.link(subcollection) - # remove collection and update tree view + # remove collection, update expanded, and update tree view bpy.data.collections.remove(collection) + expanded.discard(self.collection_name) + + if expand_history["target"] == self.collection_name: + expand_history["target"] = "" + + if self.collection_name in expand_history["history"]: + expand_history["history"].remove(self.collection_name) + update_property_group(context) |