WM: batch rename collections outside the outliner

Use selected objects collection instances to rename in the 3D view.
This commit is contained in:
Campbell Barton 2022-01-18 10:45:14 +11:00
parent 54fb1a75ee
commit c11c2a4b91
1 changed files with 14 additions and 0 deletions

View File

@ -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(