Batch rename: add brush and scene data types

Ref !111772.
This commit is contained in:
Iyad Ahmed
2023-10-10 20:33:45 +11:00
committed by Campbell Barton
parent 1ccba4d9fe
commit 87baecf33d

View File

@@ -2688,6 +2688,9 @@ class WM_OT_batch_rename(Operator):
('NODE', "Nodes", ""),
('SEQUENCE_STRIP', "Sequence Strips", ""),
('ACTION_CLIP', "Action Clips", ""),
None,
('SCENE', "Scenes", ""),
('BRUSH', "Brushes", ""),
),
description="Type of data to rename",
)
@@ -2884,6 +2887,26 @@ class WM_OT_batch_rename(Operator):
"name",
iface_("Action(s)"),
)
elif data_type == 'SCENE':
data = (
(
# Outliner.
cls._selected_ids_from_outliner_by_type(context, bpy.types.Scene)
if ((space_type == 'OUTLINER') and only_selected) else [id for id in bpy.data.scenes if id.library is None]
),
"name",
iface_("Scene(s)"),
)
elif data_type == 'BRUSH':
data = (
(
# Outliner.
cls._selected_ids_from_outliner_by_type(context, bpy.types.Brush)
if ((space_type == 'OUTLINER') and only_selected) else [id for id in bpy.data.brushes if id.library is None]
),
"name",
iface_("Brush(es)"),
)
elif data_type in object_data_type_attrs_map.keys():
attr, descr, ty = object_data_type_attrs_map[data_type]
data = (