[Bf-extensions-cvs] [4d6d1f7e] master: Collection Manager: Fix popup sizing. Task: T69577

Ryan Inch noreply at git.blender.org
Sat Dec 21 08:45:53 CET 2019


Commit: 4d6d1f7eed8bbeb9f439e4294a58568f9c13317b
Author: Ryan Inch
Date:   Sat Dec 21 02:43:15 2019 -0500
Branches: master
https://developer.blender.org/rBA4d6d1f7eed8bbeb9f439e4294a58568f9c13317b

Collection Manager: Fix popup sizing. Task: T69577

Fix bug with automatic window sizing based on the maximum number
of sub-levels present.

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

M	object_collection_manager/__init__.py
M	object_collection_manager/internals.py

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

diff --git a/object_collection_manager/__init__.py b/object_collection_manager/__init__.py
index 828682a5..0c4dcca7 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,2),
+    "version": (1,8,3),
     "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/internals.py b/object_collection_manager/internals.py
index fc186684..5deadece 100644
--- a/object_collection_manager/internals.py
+++ b/object_collection_manager/internals.py
@@ -78,6 +78,10 @@ def update_collection_tree(context):
 
 def get_all_collections(context, collections, parent, tree, level=0, visible=False):
     global row_index
+    global max_lvl
+    
+    if level > max_lvl:
+        max_lvl = level
 
     for item in collections:
         laycol = {"id": len(layer_collections) +1,
@@ -98,8 +102,6 @@ def get_all_collections(context, collections, parent, tree, level=0, visible=Fal
         tree.append(laycol)
 
         if len(item.children) > 0:
-            global max_lvl
-            max_lvl += 1
             laycol["has_children"] = True
 
             if item.name in expanded and laycol["visible"]:



More information about the Bf-extensions-cvs mailing list