[Bf-blender-cvs] [83077d36834] master: Fix: wrong pivot point output in String to Curves node

Jacques Lucke noreply at git.blender.org
Mon Dec 5 13:20:58 CET 2022


Commit: 83077d36834a1170ddbeb314f3a0ef86d46a442e
Author: Jacques Lucke
Date:   Mon Dec 5 13:20:16 2022 +0100
Branches: master
https://developer.blender.org/rB83077d36834a1170ddbeb314f3a0ef86d46a442e

Fix: wrong pivot point output in String to Curves node

The issue was that using `curves.bounds_min_max` included the radius
which does not make sense in this context.

===================================================================

M	source/blender/nodes/geometry/nodes/node_geo_string_to_curves.cc

===================================================================

diff --git a/source/blender/nodes/geometry/nodes/node_geo_string_to_curves.cc b/source/blender/nodes/geometry/nodes/node_geo_string_to_curves.cc
index 405c2761711..5025feed7c4 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_string_to_curves.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_string_to_curves.cc
@@ -9,6 +9,7 @@
 #include "BKE_instances.hh"
 #include "BKE_vfont.h"
 
+#include "BLI_bounds.hh"
 #include "BLI_hash.h"
 #include "BLI_string_utf8.h"
 #include "BLI_task.hh"
@@ -109,12 +110,14 @@ static float3 get_pivot_point(GeoNodeExecParams &params, bke::CurvesGeometry &cu
   const GeometryNodeStringToCurvesPivotMode pivot_mode = (GeometryNodeStringToCurvesPivotMode)
                                                              storage.pivot_mode;
 
-  float3 min(FLT_MAX), max(FLT_MIN);
+  const std::optional<Bounds<float3>> bounds = bounds::min_max(curves.positions());
 
   /* Check if curve is empty. */
-  if (!curves.bounds_min_max(min, max)) {
+  if (!bounds.has_value()) {
     return {0.0f, 0.0f, 0.0f};
   }
+  const float3 min = bounds->min;
+  const float3 max = bounds->max;
 
   switch (pivot_mode) {
     case GEO_NODE_STRING_TO_CURVES_PIVOT_MODE_MIDPOINT:



More information about the Bf-blender-cvs mailing list