Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Inch <mythologylover75@gmail.com>2021-10-26 11:10:38 +0300
committerRyan Inch <mythologylover75@gmail.com>2021-10-26 11:10:38 +0300
commit11aebc017869f0ae86cbd8aa8927e6bb511fec85 (patch)
treeae8c7d0cfb686bad03b0d48bdfcc161fd5f79e2d
parent823910c50d1c4814c4aa1962a31b91e4dc1c183b (diff)
Collection Manager: Fix nested selection bug. Task: T69577
Fix a bug where attempting to deselect nested collections fails when there are no objects present in the parent collection. Reported by 1D_Inc
-rw-r--r--object_collection_manager/__init__.py2
-rw-r--r--object_collection_manager/operator_utils.py24
2 files changed, 13 insertions, 13 deletions
diff --git a/object_collection_manager/__init__.py b/object_collection_manager/__init__.py
index aa9211d6..53004bac 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": (2, 23, 0),
+ "version": (2, 23, 1),
"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/operator_utils.py b/object_collection_manager/operator_utils.py
index 820ab1bb..ec72fdb4 100644
--- a/object_collection_manager/operator_utils.py
+++ b/object_collection_manager/operator_utils.py
@@ -134,7 +134,7 @@ def set_rto(layer_collection, rto, value):
setattr(collection, rto_path[rto].split(".")[1], value)
-def apply_to_children(parent, apply_function):
+def apply_to_children(parent, apply_function, *args, **kwargs):
# works for both Collections & LayerCollections
child_lists = [parent.children]
@@ -143,7 +143,7 @@ def apply_to_children(parent, apply_function):
for child_list in child_lists:
for child in child_list:
- apply_function(child)
+ apply_function(child, *args, **kwargs)
if child.children:
new_child_lists.append(child.children)
@@ -620,20 +620,20 @@ def select_collection_objects(is_master_collection, collection_name, replace, ne
if replace:
bpy.ops.object.select_all(action='DESELECT')
- if selection_state == None:
- selection_state = get_move_selection().isdisjoint(target_collection.objects)
+ def select_objects(collection, selection_state):
+ if selection_state == None:
+ selection_state = get_move_selection().isdisjoint(collection.objects)
- def select_objects(collection):
- for obj in collection.objects:
- try:
- obj.select_set(selection_state)
- except RuntimeError:
- pass
+ for obj in collection.objects:
+ try:
+ obj.select_set(selection_state)
+ except RuntimeError:
+ pass
- select_objects(target_collection)
+ select_objects(target_collection, selection_state)
if nested:
- apply_to_children(target_collection, select_objects)
+ apply_to_children(target_collection, select_objects, selection_state)
def set_exclude_state(target_layer_collection, state):
# get current child exclusion state