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:
authorPhilipp Oeser <info@graphics-engineer.com>2021-04-22 16:50:29 +0300
committerPhilipp Oeser <info@graphics-engineer.com>2021-08-13 12:07:27 +0300
commitfd29a161cc892730859f6b28a026460f9dd4a1c5 (patch)
treeaa2ad9144e490991ddcbce07f5c35b61c914c502
parent00f264ea42fb657cd4c62be54ae43459f480a6d8 (diff)
Fix Action Editor unlink button when in tweak mode
When in NLA tweak mode, the action unlink button in the Dopesheet / Action Editor should be a mere shortcut to exiting tweak mode [nothing else]. Instead, it was also clearing the action fully, not returning to the previous edited action before going into tweak mode. Now dont "flush" by clearing the action, instead exit tweakmode, clear the scenes SCE_NLA_EDIT_ON flag (if this isnt done some NLA operators like pushdown were not immediately available because their poll checked this flag) and send appropriate notifier to have everything update nicely. Part of T87681 (Bug 4/5/6). Maniphest Tasks: T87681 Differential Revision: https://developer.blender.org/D11052
-rw-r--r--source/blender/editors/space_action/action_data.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/source/blender/editors/space_action/action_data.c b/source/blender/editors/space_action/action_data.c
index d69c7ab8d48..717d87c4972 100644
--- a/source/blender/editors/space_action/action_data.c
+++ b/source/blender/editors/space_action/action_data.c
@@ -599,16 +599,13 @@ void ED_animedit_unlink_action(
id_fake_user_clear(&act->id);
}
- /* If in Tweak Mode, don't unlink. Instead, this
- * becomes a shortcut to exit Tweak Mode instead
- */
+ /* If in Tweak Mode, don't unlink. Instead, this becomes a shortcut to exit Tweak Mode. */
if ((adt) && (adt->flag & ADT_NLA_EDIT_ON)) {
- /* Exit Tweak Mode */
BKE_nla_tweakmode_exit(adt);
- /* Flush this to the Action Editor (if that's where this change was initiated) */
- if (area->spacetype == SPACE_ACTION) {
- actedit_change_action(C, NULL);
+ Scene *scene = CTX_data_scene(C);
+ if (scene != NULL) {
+ scene->flag &= ~SCE_NLA_EDIT_ON;
}
}
else {
@@ -660,6 +657,9 @@ static int action_unlink_exec(bContext *C, wmOperator *op)
ED_animedit_unlink_action(C, NULL, adt, adt->action, op->reports, force_delete);
}
+ /* Unlink is also abused to exit NLA tweak mode. */
+ WM_main_add_notifier(NC_ANIMATION | ND_NLA_ACTCHANGE, NULL);
+
return OPERATOR_FINISHED;
}