[Bf-blender-cvs] [c2ba9be0981] blender-v2.93-release: Fix NLA action cannot be unlinked in certain cases

Philipp Oeser noreply at git.blender.org
Mon Aug 23 09:35:49 CEST 2021


Commit: c2ba9be09810026ad7f0fe79857ee65c878e49b3
Author: Philipp Oeser
Date:   Wed Apr 21 18:08:50 2021 +0200
Branches: blender-v2.93-release
https://developer.blender.org/rBc2ba9be09810026ad7f0fe79857ee65c878e49b3

Fix NLA action cannot be unlinked in certain cases

The poll for unlinking calls `nla_panel_context` without providing an
adt pointer, and there is a check for this pointer in
`nla_panel_context` leading to never returning true if it is not
provided. (this is fine if there are tracks already, poll would succeed
in this case, `nla_panel_context` goes a different code path then)

Same call to `nla_panel_context` is also done in the beginning of the
corresponding unlink exec function (but this time providing the pointer
because it is used later), so it makes sense to do the same thing in the
poll function. Equal check is also done in the panel poll function, so
now these are all in sync.

Part of T87681.

Maniphest Tasks: T87681

Differential Revision: https://developer.blender.org/D11041

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

M	source/blender/editors/space_nla/nla_channels.c

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

diff --git a/source/blender/editors/space_nla/nla_channels.c b/source/blender/editors/space_nla/nla_channels.c
index f2cea23af76..4ccbd7657a7 100644
--- a/source/blender/editors/space_nla/nla_channels.c
+++ b/source/blender/editors/space_nla/nla_channels.c
@@ -562,7 +562,8 @@ void NLA_OT_action_pushdown(wmOperatorType *ot)
 static bool nla_action_unlink_poll(bContext *C)
 {
   if (ED_operator_nla_active(C)) {
-    return nla_panel_context(C, NULL, NULL, NULL);
+    PointerRNA adt_ptr;
+    return (nla_panel_context(C, &adt_ptr, NULL, NULL) && (adt_ptr.data != NULL));
   }
 
   /* something failed... */



More information about the Bf-blender-cvs mailing list