From 91c936e01c3d4516fa83a3c827356ff468591cc2 Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Thu, 30 Nov 2023 23:40:34 -0500 Subject: [PATCH] Fix #115108: Object dimensions infinite for armatures The initialization of min and max was reversed. Switch to C++ numeric limits, which I'm a bit more used to ad this point. --- source/blender/blenkernel/intern/armature.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/blender/blenkernel/intern/armature.cc b/source/blender/blenkernel/intern/armature.cc index 3b236c57873..787a433a3ee 100644 --- a/source/blender/blenkernel/intern/armature.cc +++ b/source/blender/blenkernel/intern/armature.cc @@ -12,6 +12,7 @@ #include #include #include +#include #include "MEM_guardedalloc.h" @@ -2919,8 +2920,8 @@ std::optional> BKE_armature_min_max(const bPose if (BLI_listbase_is_empty(&pose->chanbase)) { return std::nullopt; } - blender::float3 min(-FLT_MAX); - blender::float3 max(FLT_MAX); + blender::float3 min(std::numeric_limits::max()); + blender::float3 max(std::numeric_limits::lowest()); /* For now, we assume BKE_pose_where_is has already been called * (hence we have valid data in pachan). */ LISTBASE_FOREACH (bPoseChannel *, pchan, &pose->chanbase) {