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:
authorRed Mser <RedMser>2022-01-18 02:26:20 +0300
committerCampbell Barton <campbell@blender.org>2022-01-18 02:26:20 +0300
commit54fb1a75ee191e5d97cda29a1e4dc78b4563bfb3 (patch)
tree2fc24f5391e348f7853a7fe18d766dd105ea34d3 /release
parent0fa36c81d906264c340cecc457656acf673770cb (diff)
WM: batch rename collections
User must activate the operator from the outliner, so that the selected collections can be determined. Reviewed By: campbellbarton Ref D13821
Diffstat (limited to 'release')
-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 a2f482d1a55..798e745ce95 100644
--- a/release/scripts/startup/bl_operators/wm.py
+++ b/release/scripts/startup/bl_operators/wm.py
@@ -23,6 +23,7 @@ import bpy
from bpy.types import (
Menu,
Operator,
+ Collection,
bpy_prop_array,
)
from bpy.props import (
@@ -2467,6 +2468,7 @@ class WM_OT_batch_rename(Operator):
name="Type",
items=(
('OBJECT', "Objects", ""),
+ ('COLLECTION', "Collections", ""),
('MATERIAL', "Materials", ""),
None,
# Enum identifiers are compared with 'object.type'.
@@ -2531,6 +2533,18 @@ class WM_OT_batch_rename(Operator):
"name",
"Node(s)",
)
+ elif space_type == 'OUTLINER':
+ data_type_test = 'COLLECTION'
+ if check_context:
+ return data_type_test
+ if data_type == data_type_test:
+ data = (
+ [id for id in context.selected_ids if isinstance(id, Collection)]
+ if only_selected else
+ scene.collection.children_recursive,
+ "name",
+ "Collection(s)",
+ )
else:
if mode == 'POSE' or (mode == 'WEIGHT_PAINT' and context.pose_object):
data_type_test = 'BONE'