From 8183f21258cd15d3aab1dfc5b1344f42e9560f78 Mon Sep 17 00:00:00 2001 From: Nate Rupsis Date: Thu, 27 Jul 2023 18:14:05 +0200 Subject: [PATCH] Animation: Default NLA duplucation hot keys to duplicate linked ## Overview Much like node groups, or a VSE clip, when we duplicate we actually want a _linked_ duplicate. This PR updates the NLA key board for Duplicate linked to `Shift + D`, and Duplicate to `Alt + D`. Additionally, update Tool tips to reflect duplicate vs linked duplicate. Pull Request: https://projects.blender.org/blender/blender/pulls/110316 --- scripts/presets/keyconfig/keymap_data/blender_default.py | 4 ++-- scripts/startup/bl_ui/space_nla.py | 8 ++++---- source/blender/editors/space_nla/nla_edit.cc | 3 +-- source/blender/editors/space_nla/nla_ops.cc | 5 +++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/scripts/presets/keyconfig/keymap_data/blender_default.py b/scripts/presets/keyconfig/keymap_data/blender_default.py index 12f250ba5a4..b9c0cd47d5f 100644 --- a/scripts/presets/keyconfig/keymap_data/blender_default.py +++ b/scripts/presets/keyconfig/keymap_data/blender_default.py @@ -2654,8 +2654,8 @@ def km_nla_editor(params): ("nla.soundclip_add", {"type": 'K', "value": 'PRESS', "shift": True}, None), ("nla.meta_add", {"type": 'G', "value": 'PRESS', "ctrl": True}, None), ("nla.meta_remove", {"type": 'G', "value": 'PRESS', "ctrl": True, "alt": True}, None), - ("nla.duplicate_move", {"type": 'D', "value": 'PRESS', "shift": True}, None), - ("nla.duplicate_linked_move", {"type": 'D', "value": 'PRESS', "alt": True}, None), + ("nla.duplicate_linked_move", {"type": 'D', "value": 'PRESS', "shift": True}, None), + ("nla.duplicate_move", {"type": 'D', "value": 'PRESS', "alt": True}, None), ("nla.make_single_user", {"type": 'U', "value": 'PRESS'}, None), ("nla.delete", {"type": 'X', "value": 'PRESS'}, None), ("nla.delete", {"type": 'DEL', "value": 'PRESS'}, None), diff --git a/scripts/startup/bl_ui/space_nla.py b/scripts/startup/bl_ui/space_nla.py index 0fc444f0dbb..d7498ef0bfc 100644 --- a/scripts/startup/bl_ui/space_nla.py +++ b/scripts/startup/bl_ui/space_nla.py @@ -181,8 +181,8 @@ class NLA_MT_edit(Menu): layout.separator() layout.operator("nla.bake", text="Bake Action") - layout.operator("nla.duplicate", text="Duplicate").linked = False - layout.operator("nla.duplicate", text="Linked Duplicate").linked = True + layout.operator("nla.duplicate_move") + layout.operator("nla.duplicate_linked_move") layout.operator("nla.split") layout.operator("nla.delete") layout.operator("nla.tracks_delete") @@ -302,8 +302,8 @@ class NLA_MT_context_menu(Menu): props = layout.operator("wm.call_panel", text="Rename...") props.name = "TOPBAR_PT_name" props.keep_open = False - layout.operator("nla.duplicate", text="Duplicate").linked = False - layout.operator("nla.duplicate", text="Linked Duplicate").linked = True + layout.operator("nla.duplicate_move") + layout.operator("nla.duplicate_linked_move") layout.separator() diff --git a/source/blender/editors/space_nla/nla_edit.cc b/source/blender/editors/space_nla/nla_edit.cc index 1158305ff6f..b1a6bd0b99b 100644 --- a/source/blender/editors/space_nla/nla_edit.cc +++ b/source/blender/editors/space_nla/nla_edit.cc @@ -1220,8 +1220,7 @@ void NLA_OT_duplicate(wmOperatorType *ot) /* identifiers */ ot->name = "Duplicate Strips"; ot->idname = "NLA_OT_duplicate"; - ot->description = - "Duplicate selected NLA-Strips, adding the new strips in new tracks above the originals"; + ot->description = "Duplicate selected NLA-Strips, adding the new strips to new track(s)"; /* api callbacks */ ot->invoke = nlaedit_duplicate_invoke; diff --git a/source/blender/editors/space_nla/nla_ops.cc b/source/blender/editors/space_nla/nla_ops.cc index 0781a8bf37e..1775d79d9a0 100644 --- a/source/blender/editors/space_nla/nla_ops.cc +++ b/source/blender/editors/space_nla/nla_ops.cc @@ -148,7 +148,7 @@ void ED_operatormacros_nla() ot = WM_operatortype_append_macro("NLA_OT_duplicate_move", "Duplicate", - "Duplicate selected strips and their Actions and move them", + "Duplicate selected NLA-Strips, adding the new strips to new track(s)", OPTYPE_UNDO | OPTYPE_REGISTER); otmacro = WM_operatortype_macro_define(ot, "NLA_OT_duplicate"); RNA_boolean_set(otmacro->ptr, "linked", false); @@ -156,8 +156,9 @@ void ED_operatormacros_nla() ot = WM_operatortype_append_macro("NLA_OT_duplicate_linked_move", "Duplicate Linked", - "Duplicate selected strips and move them", + "Duplicate Linked selected NLA-Strips, adding the new strips to new track(s)", OPTYPE_UNDO | OPTYPE_REGISTER); + otmacro = WM_operatortype_macro_define(ot, "NLA_OT_duplicate"); RNA_boolean_set(otmacro->ptr, "linked", true); WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");