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

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <campbell@blender.org>2022-01-18 02:45:14 +0300
committerCampbell Barton <campbell@blender.org>2022-01-18 02:47:12 +0300
commitc11c2a4b91d57bed588615734da858ac3c2af5b3 (patch)
treeb292e8096e854543fcd9fb34540416b1777b35fc
parent54fb1a75ee191e5d97cda29a1e4dc78b4563bfb3 (diff)
WM: batch rename collections outside the outliner
Use selected objects collection instances to rename in the 3D view.
-rw-r--r--release/scripts/startup/bl_operators/wm.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/release/scripts/startup/bl_operators/wm.py b/release/scripts/startup/bl_operators/wm.py
index 798e745ce95..5ee857d7ea2 100644
--- a/release/scripts/startup/bl_operators/wm.py
+++ b/release/scripts/startup/bl_operators/wm.py
@@ -2597,6 +2597,20 @@ class WM_OT_batch_rename(Operator):
"name",
"Object(s)",
)
+ elif data_type == 'COLLECTION':
+ data = (
+ tuple(set(
+ ob.instance_collection
+ for ob in context.selected_objects
+ if ((ob.instance_type == 'COLLECTION') and
+ (collection := ob.instance_collection) is not None and
+ (collection.library is None))
+ ))
+ if only_selected else
+ [id for id in bpy.data.collections if id.library is None],
+ "name",
+ "Collection(s)",
+ )
elif data_type == 'MATERIAL':
data = (
tuple(set(