diff options
author | Iyad Ahmed <iyadahmed430@gmail.com> | 2022-09-26 14:11:23 +0300 |
---|---|---|
committer | Campbell Barton <campbell@blender.org> | 2022-09-27 05:13:08 +0300 |
commit | cd7ec0dac6a8660411f21949674422d5aed4d256 (patch) | |
tree | b3cfbd279f67ab37d66fe21f7d5bb0672f7f210a | |
parent | 2edb8ab7394580cfe00f838a3dab65d68c743c13 (diff) |
WM: batch rename action clips
Batch rename for action clips works in outliner and 3d view.
Reviewed By: campbellbarton
Ref D15819
-rw-r--r-- | release/scripts/startup/bl_operators/wm.py | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/release/scripts/startup/bl_operators/wm.py b/release/scripts/startup/bl_operators/wm.py index f8cb57d638a..9d04cfd5bc8 100644 --- a/release/scripts/startup/bl_operators/wm.py +++ b/release/scripts/startup/bl_operators/wm.py @@ -2518,6 +2518,7 @@ class WM_OT_batch_rename(Operator): ('BONE', "Bones", ""), ('NODE', "Nodes", ""), ('SEQUENCE_STRIP', "Sequence Strips", ""), + ('ACTION_CLIP', "Action Clips", ""), ), description="Type of data to rename", ) @@ -2690,6 +2691,30 @@ class WM_OT_batch_rename(Operator): "name", iface_("Material(s)"), ) + elif data_type == "ACTION_CLIP": + data = ( + ( + # Outliner. + tuple(set( + action for id in context.selected_ids + if (((animation_data := id.animation_data) is not None) and + ((action := animation_data.action) is not None) and + (action.library is None)) + )) + if space_type == 'OUTLINER' else + # 3D View (default). + tuple(set( + action for ob in context.selected_objects + if (((animation_data := ob.animation_data) is not None) and + ((action := animation_data.action) is not None) and + (action.library is None)) + )) + ) + if only_selected else + [id for id in bpy.data.actions if id.library is None], + "name", + iface_("Action(s)"), + ) elif data_type in object_data_type_attrs_map.keys(): attr, descr, ty = object_data_type_attrs_map[data_type] data = ( |