Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Goudey <h.goudey@me.com>2021-06-10 17:42:30 +0300
committerHans Goudey <h.goudey@me.com>2021-06-10 17:42:30 +0300
commit69582bf5b7464501475173226250f7d97c81d75a (patch)
tree47ed358af6b6f1fec17e527105de7718b8fee3e2
parent4c6e29a8e73e39db5d0d4baacba1521a1804a734 (diff)
Change default to "Count", divide radius by 10geometry-nodes-curve-to-points-node
-rw-r--r--source/blender/nodes/geometry/nodes/node_geo_curve_to_points.cc15
1 files changed, 10 insertions, 5 deletions
diff --git a/source/blender/nodes/geometry/nodes/node_geo_curve_to_points.cc b/source/blender/nodes/geometry/nodes/node_geo_curve_to_points.cc
index 069b9031466..af3c2d5f5e9 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_curve_to_points.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_curve_to_points.cc
@@ -48,7 +48,7 @@ static void geo_node_curve_to_points_init(bNodeTree *UNUSED(tree), bNode *node)
NodeGeometryCurveToPoints *data = (NodeGeometryCurveToPoints *)MEM_callocN(
sizeof(NodeGeometryCurveToPoints), __func__);
- data->mode = GEO_NODE_CURVE_SAMPLE_EVALUATED;
+ data->mode = GEO_NODE_CURVE_SAMPLE_COUNT;
node->storage = data;
}
@@ -85,14 +85,14 @@ static Array<int> calculate_spline_point_offsets(GeoNodeExecParams &params,
const CurveEval &curve,
const Span<SplinePtr> splines)
{
- const int splines_size = curve.splines().size();
+ const int size = curve.splines().size();
switch (mode) {
case GEO_NODE_CURVE_SAMPLE_COUNT: {
const int count = params.extract_input<int>("Count");
if (count < 1) {
return {0};
}
- Array<int> offsets(splines_size + 1);
+ Array<int> offsets(size + 1);
for (const int i : offsets.index_range()) {
offsets[i] = count * i;
}
@@ -101,9 +101,9 @@ static Array<int> calculate_spline_point_offsets(GeoNodeExecParams &params,
case GEO_NODE_CURVE_SAMPLE_LENGTH: {
/* Don't allow asymptotic count increase for low resolution values. */
const float resolution = std::max(params.extract_input<float>("Length"), 0.0001f);
- Array<int> offsets(splines_size + 1);
+ Array<int> offsets(size + 1);
int offset = 0;
- for (const int i : IndexRange(splines_size)) {
+ for (const int i : IndexRange(size)) {
offsets[i] = offset;
offset += splines[i]->length() / resolution;
}
@@ -367,6 +367,11 @@ static void geo_node_curve_to_points_exec(GeoNodeExecParams params)
copy_spline_domain_attributes(curve_component, offsets, point_component);
create_default_rotation_attribute(new_attributes);
+ /* The default radius is way too large for points, divide by 10. */
+ for (float &radius : new_attributes.radii) {
+ radius *= 0.1f;
+ }
+
params.set_output("Geometry", std::move(result));
}