Page MenuHome

Fix Action Editor unlink button when in tweak mode
ClosedPublic

Authored by Philipp Oeser (lichtwerk) on Apr 22 2021, 4:56 PM.

Details

Summary

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).

Diff Detail

Repository
rB Blender
Branch
T87681_d (branched from master)
Build Status
Buildable 14174
Build 14174: arc lint + arc unit

Event Timeline

Philipp Oeser (lichtwerk) requested review of this revision.Apr 22 2021, 4:56 PM
Philipp Oeser (lichtwerk) created this revision.
Sybren A. Stüvel (sybren) added inline comments.
source/blender/editors/space_action/action_data.c
606–609

This works, but I do wonder why this is not always necessary after calling BKE_nla_tweakmode_exit(). Shouldn't that function get a scene parameter and just always clear the flag when tweakmode exits?

This revision is now accepted and ready to land.Aug 12 2021, 6:00 PM
source/blender/editors/space_action/action_data.c
606–609

That sounds good, I'll investigate this further.
Providing scene from RNA callback might not be possible, but if none is provided skipping of flag-clearing should not be a problem.

note: I found this comment from rBf283aa61c5a5: Fix T48397: Can not bake tweaked NLA regarding the SCE_NLA_EDIT_ON flag:

/* NOTE: technically we should also set/unset SCE_NLA_EDIT_ON flag on the
 * scene which is used to make polling tests faster, but this flag is weak
 * and can easily break e.g. by changing layer visibility. This needs to be
 * dealt with at some point. */

Even though this mentions the "weakness" of this flag, I'll still commit this solution here (since the "weakness" is still better then total failure).