[Bf-extensions-cvs] [9f12957b] master: Collection Manager: Fix Phantom Mode bugs. Task: T69577

Ryan Inch noreply at git.blender.org
Wed Dec 18 08:37:46 CET 2019


Commit: 9f12957bf2a3b9a7f5cb7d78a26d53c1d0aceb13
Author: Ryan Inch
Date:   Wed Dec 18 02:35:20 2019 -0500
Branches: master
https://developer.blender.org/rBA9f12957bf2a3b9a7f5cb7d78a26d53c1d0aceb13

Collection Manager: Fix Phantom Mode bugs. Task: T69577

Fix rto toggles not working after leaving Phantom Mode.
Fix rto history not being properly restored after leaving Phantom Mode.

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

M	object_collection_manager/__init__.py
M	object_collection_manager/operators.py

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

diff --git a/object_collection_manager/__init__.py b/object_collection_manager/__init__.py
index 5f41598a..828682a5 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": (1,8,1),
+    "version": (1,8,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/operators.py b/object_collection_manager/operators.py
index 43427efd..57e1c537 100644
--- a/object_collection_manager/operators.py
+++ b/object_collection_manager/operators.py
@@ -20,6 +20,8 @@
 
 import bpy
 
+from copy import deepcopy
+
 from bpy.types import (
     Operator,
 )
@@ -1193,7 +1195,8 @@ class CMPhantomModeOperator(Operator):
 
             # save current rto history
             for rto, history, in rto_history.items():
-                phantom_history[rto+"_history"] = history.get(view_layer, [] if rto[-3:] == "all" else {}).copy()
+                if history.get(view_layer, None):
+                    phantom_history[rto+"_history"] = deepcopy(history[view_layer])
 
 
         # return to normal mode
@@ -1229,7 +1232,13 @@ class CMPhantomModeOperator(Operator):
 
             # restore previous rto history
             for rto, history, in rto_history.items():
-                history[view_layer] = phantom_history[rto+"_history"].copy()
+                if view_layer in history:
+                    del history[view_layer]
+                
+                if phantom_history[rto+"_history"]:
+                    history[view_layer] = deepcopy(phantom_history[rto+"_history"])
+                
+                phantom_history[rto+"_history"].clear()
 
             scn.CM_Phantom_Mode = False



More information about the Bf-extensions-cvs mailing list