[Bf-blender-cvs] [fd29a161cc8] master: Fix Action Editor unlink button when in tweak mode

Philipp Oeser noreply at git.blender.org
Fri Aug 13 11:09:49 CEST 2021


Commit: fd29a161cc892730859f6b28a026460f9dd4a1c5
Author: Philipp Oeser
Date:   Thu Apr 22 15:50:29 2021 +0200
Branches: master
https://developer.blender.org/rBfd29a161cc892730859f6b28a026460f9dd4a1c5

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

===================================================================

M	source/blender/editors/space_action/action_data.c

===================================================================

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;
 }



More information about the Bf-blender-cvs mailing list