[Bf-extensions-cvs] [c4e727c0] master: Collection Manager: Fix bug with sync selection. Task: T69577 Prevent syncing to the Master Collection when the popup is called.

Ryan Inch noreply at git.blender.org
Mon Nov 4 10:20:51 CET 2019


Commit: c4e727c026dd1470b78aba6b06d304640fbc434a
Author: Ryan Inch
Date:   Mon Nov 4 04:14:10 2019 -0500
Branches: master
https://developer.blender.org/rBACc4e727c026dd1470b78aba6b06d304640fbc434a

Collection Manager: Fix bug with sync selection. Task: T69577
Prevent syncing to the Master Collection when the popup is called.

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

M	collection_manager/__init__.py
M	collection_manager/ui.py

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

diff --git a/collection_manager/__init__.py b/collection_manager/__init__.py
index 1bf2910e..3f675145 100644
--- a/collection_manager/__init__.py
+++ b/collection_manager/__init__.py
@@ -23,7 +23,7 @@ bl_info = {
     "name": "Collection Manager",
     "description": "Manage collections and their objects",
     "author": "Ryan Inch",
-    "version": (1,2,1),
+    "version": (1,2,2),
     "blender": (2, 80, 0),
     "location": "View3D - Object Mode (Shortcut - M)",
     "warning": '',  # used for warning icon and text in addons panel
diff --git a/collection_manager/ui.py b/collection_manager/ui.py
index b71d7fe3..54886dea 100644
--- a/collection_manager/ui.py
+++ b/collection_manager/ui.py
@@ -117,9 +117,7 @@ class CollectionManager(Operator):
         #hideall_history.clear()
         #disableviewall_history.clear()
         #disablerenderall_history.clear()
-        
-        
-        #context.scene.CMListIndex = 0
+
         update_property_group(context)
         
         lvl = get_max_lvl()
@@ -130,9 +128,12 @@ class CollectionManager(Operator):
         self.view_layer = context.view_layer.name
         
         # sync selection in ui list with active layer collection
-        active_laycol_name = context.view_layer.active_layer_collection.name
-        active_laycol_row_index = layer_collections[active_laycol_name]["row_index"]
-        context.scene.CMListIndex = active_laycol_row_index
+        try:
+            active_laycol_name = context.view_layer.active_layer_collection.name
+            active_laycol_row_index = layer_collections[active_laycol_name]["row_index"]
+            context.scene.CMListIndex = active_laycol_row_index
+        except:
+            context.scene.CMListIndex = 0
         
         return wm.invoke_popup(self, width=(400+(lvl*20)))



More information about the Bf-extensions-cvs mailing list