Cleanup: Anim, add const to BKE_pose_minmax()

Make the `Object *` argument `const` in `BKE_pose_minmax()`. There is no
writing to the object to cache the bounding box, and that's now clear from
the declaration as well.

No functional changes.
This commit is contained in:
Sybren A. Stüvel
2024-05-13 12:40:43 +02:00
parent 281bbe198d
commit 547067f599
2 changed files with 5 additions and 4 deletions
+1 -1
View File
@@ -185,7 +185,7 @@ void BKE_pchan_minmax(const Object *ob,
*
* \note This uses #BKE_pchan_minmax, see its documentation for details on bounds calculation.
*/
bool BKE_pose_minmax(Object *ob, float r_min[3], float r_max[3], bool use_hidden, bool use_select);
bool BKE_pose_minmax(const Object *ob, float r_min[3], float r_max[3], bool use_hidden, bool use_select);
/**
* Finds the best possible extension to the name on a particular axis.
+4 -3
View File
@@ -3085,14 +3085,15 @@ void BKE_pchan_minmax(const Object *ob,
}
}
bool BKE_pose_minmax(Object *ob, float r_min[3], float r_max[3], bool use_hidden, bool use_select)
bool BKE_pose_minmax(
const Object *ob, float r_min[3], float r_max[3], bool use_hidden, bool use_select)
{
bool changed = false;
if (ob->pose) {
bArmature *arm = static_cast<bArmature *>(ob->data);
const bArmature *arm = static_cast<const bArmature *>(ob->data);
LISTBASE_FOREACH (bPoseChannel *, pchan, &ob->pose->chanbase) {
LISTBASE_FOREACH (const bPoseChannel *, pchan, &ob->pose->chanbase) {
/* XXX pchan->bone may be nullptr for duplicated bones, see duplicateEditBoneObjects()
* comment (editarmature.c:2592)... Skip in this case too! */
if (pchan->bone && (!((use_hidden == false) && (PBONE_VISIBLE(arm, pchan->bone) == false)) &&