From 6d8e3959b07eeaf2f28fc17ff9688c3634d2c021 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Tue, 24 Sep 2024 09:48:45 +0200 Subject: [PATCH] Anim: Fix legacy/layered choice in action_fcurve_ensure() Fix the code that decides whether to create a new F-Curve in a legacy or layered style. The old code went for layered if: - The experimental feature is enabled AND the Action is already layered. The new code goes for layered if: - The experimental feature is enabled AND the Action is empty, OR - The Action is already layered. Pull Request: https://projects.blender.org/blender/blender/pulls/128036 --- source/blender/animrig/intern/action.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/blender/animrig/intern/action.cc b/source/blender/animrig/intern/action.cc index 38eaa1590eb..116c18cebe5 100644 --- a/source/blender/animrig/intern/action.cc +++ b/source/blender/animrig/intern/action.cc @@ -2229,7 +2229,9 @@ FCurve *action_fcurve_ensure(Main *bmain, } Action &action = act->wrap(); - if (USER_EXPERIMENTAL_TEST(&U, use_animation_baklava) && action.is_action_layered()) { + if ((USER_EXPERIMENTAL_TEST(&U, use_animation_baklava) && action.is_empty()) || + !action.is_action_legacy()) + { /* NOTE: for layered actions we require the following: * * - `ptr` is non-null.