Fix #123943: manual channel ordering no longer works

The issue was that the function `animfilter_action` got a new
code segment at the start which checked `if (action.is_empty())`.
That function didn't check if the `groups` list of the action is empty
though. Regular keyframe animation is usually sorted into
keyframe groups, which means it is not stored under `curves` of the action.
However in the anim filtering code, the function `split_groups_action_temp`
moves the fcurves to their groups under the `groups` listbase.

Pull Request: https://projects.blender.org/blender/blender/pulls/124172
This commit is contained in:
Christoph Lendenfeld 2024-07-05 17:56:45 +02:00 committed by Christoph Lendenfeld
parent e4c9b73051
commit c446813dd3

@ -124,8 +124,12 @@ template<typename T> static void shrink_array(T **array, int *num, const int shr
bool Action::is_empty() const
{
/* The check for emptyness has to include the check for an empty `groups` ListBase because of the
* animation filtering code. With the functions `rearrange_action_channels` and
* `join_groups_action_temp` the ownership of FCurves is temporarily transferred to the `groups`
* ListBase leaving `curves` potentially empty. */
return this->layer_array_num == 0 && this->binding_array_num == 0 &&
BLI_listbase_is_empty(&this->curves);
BLI_listbase_is_empty(&this->curves) && BLI_listbase_is_empty(&this->groups);
}
bool Action::is_action_legacy() const
{
@ -137,7 +141,7 @@ bool Action::is_action_layered() const
/* This is a valid layered Action if there is ANY layered info (because that
* takes precedence) or when there is no legacy info. */
return this->layer_array_num > 0 || this->binding_array_num > 0 ||
BLI_listbase_is_empty(&this->curves);
(BLI_listbase_is_empty(&this->curves) && BLI_listbase_is_empty(&this->groups));
}
blender::Span<const Layer *> Action::layers() const