Collection Manager: Fix T75474. Task: T69577
Fix crash when changing templates.
This commit is contained in:
parent
fb6d7c4ed8
commit
4d30d104c4
Notes:
blender-bot
2023-02-14 18:57:49 +01:00
Referenced by issue #75474, Object Collection Manager: causes loading new files from templates to crash
|
@ -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
|
||||
|
|
|
@ -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())
|
||||
|
||||
|
|
Loading…
Reference in New Issue