Merge branch 'blender-v4.1-release'

This commit is contained in:
Philipp Oeser
2024-02-26 17:41:17 +01:00
3 changed files with 9 additions and 1 deletions
+1 -1
View File
@@ -87,7 +87,7 @@ FCurve *action_fcurve_ensure(Main *bmain,
agrp = action_groups_add_new(act, group);
/* Sync bone group colors if applicable. */
if (ptr && (ptr->type == &RNA_PoseBone)) {
if (ptr && (ptr->type == &RNA_PoseBone) && ptr->data) {
const bPoseChannel *pchan = static_cast<const bPoseChannel *>(ptr->data);
action_group_colors_set_from_posebone(agrp, pchan);
}
+2
View File
@@ -136,6 +136,8 @@ void action_group_colors_set(struct bActionGroup *grp, const struct BoneColor *c
*
* If `pchan->color` is set to a non-default color, that is used. Otherwise the
* armature bone color is used.
*
* Note that if `pchan->bone` is `nullptr`, this function silently does nothing.
*/
void action_group_colors_set_from_posebone(bActionGroup *grp, const bPoseChannel *pchan);
@@ -375,6 +375,12 @@ void action_group_colors_sync(bActionGroup *grp, const bActionGroup *ref_grp)
void action_group_colors_set_from_posebone(bActionGroup *grp, const bPoseChannel *pchan)
{
BLI_assert_msg(pchan, "cannot 'set action group colors from posebone' without a posebone");
if (!pchan->bone) {
/* pchan->bone is only set after leaving editmode. */
return;
}
const BoneColor &color = blender::animrig::ANIM_bonecolor_posebone_get(pchan);
action_group_colors_set(grp, &color);
}