Commit: 5791835678067b5656469647990d769249065ee1 Author: Jacques Lucke Date: Tue Mar 8 16:09:44 2022 +0100 Branches: master https://developer.blender.org/rB5791835678067b5656469647990d769249065ee1
Geometry Nodes: fix spline length node after recent refactor Differential Revision: https://developer.blender.org/D14276 =================================================================== M source/blender/nodes/geometry/nodes/node_geo_input_spline_length.cc =================================================================== diff --git a/source/blender/nodes/geometry/nodes/node_geo_input_spline_length.cc b/source/blender/nodes/geometry/nodes/node_geo_input_spline_length.cc index f952e15fbbe..c3d87055745 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_input_spline_length.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_input_spline_length.cc @@ -25,13 +25,16 @@ static VArray<float> construct_spline_length_gvarray(const CurveComponent &compo const std::unique_ptr<CurveEval> curve = curves_to_curve_eval(*component.get_for_read()); Span<SplinePtr> splines = curve->splines(); - auto length_fn = [splines](int i) { return splines[i]->length(); }; + Array<float> spline_lenghts(splines.size()); + for (const int i : splines.index_range()) { + spline_lenghts[i] = splines[i]->length(); + } if (domain == ATTR_DOMAIN_CURVE) { - return VArray<float>::ForFunc(splines.size(), length_fn); + return VArray<float>::ForContainer(std::move(spline_lenghts)); } if (domain == ATTR_DOMAIN_POINT) { - VArray<float> length = VArray<float>::ForFunc(splines.size(), length_fn); + VArray<float> length = VArray<float>::ForContainer(std::move(spline_lenghts)); return component.attribute_try_adapt_domain<float>( std::move(length), ATTR_DOMAIN_CURVE, ATTR_DOMAIN_POINT); } _______________________________________________ Bf-blender-cvs mailing list [email protected] List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
