[Bf-extensions-cvs] [4c21cd16] master: Collection Manager: Fixed filtering bug. Task: T69577
Ryan Inch
noreply at git.blender.org
Sat Nov 16 08:13:25 CET 2019
Commit: 4c21cd164790e10e338cafa4e60428f583d0f5df
Author: Ryan Inch
Date: Thu Nov 14 00:59:19 2019 -0500
Branches: master
https://developer.blender.org/rBAC4c21cd164790e10e338cafa4e60428f583d0f5df
Collection Manager: Fixed filtering bug. Task: T69577
When a collection's name changed it wouldn't update the UIList's collection
property immediately. So when you tried to filter on the new name
nothing would show up.
===================================================================
M collection_manager/__init__.py
M collection_manager/internals.py
M collection_manager/ui.py
===================================================================
diff --git a/collection_manager/__init__.py b/collection_manager/__init__.py
index ea5c9992..0daca32c 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,3,0),
+ "version": (1,3,1),
"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/internals.py b/collection_manager/internals.py
index 59a0aa3c..3f35f143 100644
--- a/collection_manager/internals.py
+++ b/collection_manager/internals.py
@@ -18,8 +18,22 @@ def clone_list(l1, l2):
for x in l2:
l1.append(x)
+def update_col_name(self, context):
+ if self.name != self.last_name:
+ if self.name == '':
+ self.name = self.last_name
+ return
+
+ if self.last_name != '':
+ layer_collections[self.last_name]["ptr"].collection.name = self.name
+
+ update_property_group(context)
+
+ self.last_name = self.name
+
class CMListCollection(PropertyGroup):
- name: StringProperty()
+ name: StringProperty(update=update_col_name)
+ last_name: StringProperty()
def update_collection_tree(context):
diff --git a/collection_manager/ui.py b/collection_manager/ui.py
index 4ea57bbe..6033bdc5 100644
--- a/collection_manager/ui.py
+++ b/collection_manager/ui.py
@@ -206,7 +206,7 @@ class CM_UL_items(UIList):
#name_row.activate_init = True
#rename[0] = False
- name_row.prop(collection, "name", text="", expand=True)
+ name_row.prop(item, "name", text="", expand=True)
# used as a separator (actual separator not wide enough)
row.label()
More information about the Bf-extensions-cvs
mailing list