Cleanup: quiet warning for a NONULL argument being NULL

Only call BKE_pose_blend_write when the object has a pose.
This commit is contained in:
Campbell Barton 2023-07-12 13:29:35 +10:00
parent f9316e4079
commit 46815ac188
3 changed files with 6 additions and 9 deletions

View File

@ -387,7 +387,7 @@ void BKE_pose_rest(struct bPose *pose, bool selected_bones_only);
void BKE_pose_tag_recalc(struct Main *bmain, struct bPose *pose) ATTR_NONNULL(1, 2);
void BKE_pose_blend_write(struct BlendWriter *writer, struct bPose *pose, struct bArmature *arm)
ATTR_NONNULL(1, 3);
ATTR_NONNULL(1, 2, 3);
void BKE_pose_blend_read_data(struct BlendDataReader *reader, struct bPose *pose) ATTR_NONNULL(1);
void BKE_pose_blend_read_lib(struct BlendLibReader *reader, struct Object *ob, struct bPose *pose)
ATTR_NONNULL(1, 2);

View File

@ -1839,13 +1839,8 @@ void BKE_pose_check_uuids_unique_and_report(const bPose *pose)
void BKE_pose_blend_write(BlendWriter *writer, bPose *pose, bArmature *arm)
{
/* Write each channel */
if (pose == NULL) {
return;
}
#ifndef __GNUC__ /* Ensured by the function attribute. */
BLI_assert(arm != NULL);
#ifndef __GNUC__
BLI_assert(pose != NULL && arm != NULL);
#endif
/* Write channels */

View File

@ -577,7 +577,9 @@ static void object_blend_write(BlendWriter *writer, ID *id, const void *id_addre
arm = (bArmature *)ob->data;
}
BKE_pose_blend_write(writer, ob->pose, arm);
if (ob->pose) {
BKE_pose_blend_write(writer, ob->pose, arm);
}
BKE_constraint_blend_write(writer, &ob->constraints);
animviz_motionpath_blend_write(writer, ob->mpath);