Differential D15705 Diff 54888 source/blender/nodes/geometry/nodes/node_geo_curve_spline_parameter.cc
Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/geometry/nodes/node_geo_curve_spline_parameter.cc
| Show First 20 Lines • Show All 137 Lines • ▼ Show 20 Lines | if (domain == ATTR_DOMAIN_POINT) { | ||||
| }); | }); | ||||
| return VArray<float>::ForContainer(std::move(result)); | return VArray<float>::ForContainer(std::move(result)); | ||||
| } | } | ||||
| if (domain == ATTR_DOMAIN_CURVE) { | if (domain == ATTR_DOMAIN_CURVE) { | ||||
| Array<float> lengths = accumulated_lengths_curve_domain(curves); | Array<float> lengths = accumulated_lengths_curve_domain(curves); | ||||
| const int last_index = curves.curves_num() - 1; | const int last_index = curves.curves_num() - 1; | ||||
| const int total_length = lengths.last() + curves.evaluated_length_total_for_curve( | const float total_length = lengths.last() + curves.evaluated_length_total_for_curve( | ||||
| last_index, cyclic[last_index]); | last_index, cyclic[last_index]); | ||||
| if (total_length > 0.0f) { | if (total_length > 0.0f) { | ||||
| const float factor = 1.0f / total_length; | const float factor = 1.0f / total_length; | ||||
| for (float &value : lengths) { | for (float &value : lengths) { | ||||
| value *= factor; | value *= factor; | ||||
| } | } | ||||
| } | } | ||||
| else { | else { | ||||
| /* It is arbitrary what to do in those rare cases when all the points are | /* It is arbitrary what to do in those rare cases when all the points are | ||||
| ▲ Show 20 Lines • Show All 175 Lines • Show Last 20 Lines | |||||