[Bf-extensions-cvs] [4d30d104] master: Collection Manager: Fix T75474. Task: T69577

Ryan Inch noreply at git.blender.org
Wed Apr 8 05:32:09 CEST 2020


Commit: 4d30d104c4c658bf422191a8b316090ab1fe1979
Author: Ryan Inch
Date:   Tue Apr 7 23:27:28 2020 -0400
Branches: master
https://developer.blender.org/rBA4d30d104c4c658bf422191a8b316090ab1fe1979

Collection Manager: Fix T75474. Task: T69577

Fix crash when changing templates.

===================================================================

M	object_collection_manager/__init__.py
M	object_collection_manager/ui.py

===================================================================

diff --git a/object_collection_manager/__init__.py b/object_collection_manager/__init__.py
index c968cb79..54a0bba2 100644
--- a/object_collection_manager/__init__.py
+++ b/object_collection_manager/__init__.py
@@ -22,7 +22,7 @@ bl_info = {
     "name": "Collection Manager",
     "description": "Manage collections and their objects",
     "author": "Ryan Inch",
-    "version": (2,5,1),
+    "version": (2,5,2),
     "blender": (2, 80, 0),
     "location": "View3D - Object Mode (Shortcut - M)",
     "warning": '',  # used for warning icon and text in addons panel
diff --git a/object_collection_manager/ui.py b/object_collection_manager/ui.py
index 2209f18f..0e2739c2 100644
--- a/object_collection_manager/ui.py
+++ b/object_collection_manager/ui.py
@@ -60,6 +60,11 @@ class CollectionManager(Operator):
 
     last_view_layer = ""
 
+    window_open = False
+
+    def __init__(self):
+        self.window_open = True
+
     def draw(self, context):
         layout = self.layout
         cm = context.scene.collection_manager
@@ -328,6 +333,10 @@ class CollectionManager(Operator):
     def __del__(self):
         global collection_state
 
+        if not self.window_open:
+            # prevent destructor execution when changing templates
+            return
+
         collection_state.clear()
         collection_state.update(generate_state())



More information about the Bf-extensions-cvs mailing list