diff options
-rw-r--r-- | source/blender/blenkernel/intern/action.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/action.c b/source/blender/blenkernel/intern/action.c index f94f1e72638..1bae65a7fb4 100644 --- a/source/blender/blenkernel/intern/action.c +++ b/source/blender/blenkernel/intern/action.c @@ -1002,8 +1002,12 @@ void BKE_pose_remove_group(bPose *pose, bActionGroup *grp, const int index) /* now, remove it from the pose */ BLI_freelinkN(&pose->agroups, grp); if (pose->active_group >= idx) { + const bool has_groups = !BLI_listbase_is_empty(&pose->agroups); pose->active_group--; - if (pose->active_group < 0 || BLI_listbase_is_empty(&pose->agroups)) { + if (pose->active_group == 0 && has_groups) { + pose->active_group = 1; + } + else if (pose->active_group < 0 || !has_groups) { pose->active_group = 0; } } |