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-17 19:39:23 +0300
committerHans Goudey <h.goudey@me.com>2021-06-17 19:39:23 +0300
commited4222258ea6fff51c17a2e244b497f03a8e0162 (patch)
tree9546f2679bae2fdf32cc0061af6214e60b13b090 /source/blender/nodes/intern/node_geometry_exec.cc
parent7c1bb239bebd48fa8bacceeff42b2fcb6e7cfbda (diff)
Geometry Nodes: Add Curve Subdivision Node
This node creates splines with more control points in between the existing control points. The point is to give the splines more definition for further tweaking like randomization with white noise, instead of deforming a resampled poly spline with a noise texture. For poly splines and NURBS, the node simply interpolates new values between the existing control points. However, for Bezier splines, the result follows the existing evaluated shape of the curve, changing the handle positions and handle types to make that possible. The number of "cuts" can be controlled by an integer input, or an attribute can be used. Both spline and point domain attributes are supported, so the number of cuts can vary using the value from the point at the start of each segment. Dynamic curve attributes are interpolated to the result with linear interpolation. Differential Revision: https://developer.blender.org/D11421
Diffstat (limited to 'source/blender/nodes/intern/node_geometry_exec.cc')
-rw-r--r--source/blender/nodes/intern/node_geometry_exec.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/nodes/intern/node_geometry_exec.cc b/source/blender/nodes/intern/node_geometry_exec.cc
index 188d198e159..17a13f2d1b0 100644
--- a/source/blender/nodes/intern/node_geometry_exec.cc
+++ b/source/blender/nodes/intern/node_geometry_exec.cc
@@ -97,6 +97,12 @@ GVArrayPtr GeoNodeExecParams::get_input_attribute(const StringRef name,
conversions.convert_to_uninitialized(CPPType::get<float>(), *cpp_type, &value, buffer);
return std::make_unique<fn::GVArray_For_SingleValue>(*cpp_type, domain_size, buffer);
}
+ if (found_socket->type == SOCK_INT) {
+ const int value = this->get_input<int>(found_socket->identifier);
+ BUFFER_FOR_CPP_TYPE_VALUE(*cpp_type, buffer);
+ conversions.convert_to_uninitialized(CPPType::get<int>(), *cpp_type, &value, buffer);
+ return std::make_unique<fn::GVArray_For_SingleValue>(*cpp_type, domain_size, buffer);
+ }
if (found_socket->type == SOCK_VECTOR) {
const float3 value = this->get_input<float3>(found_socket->identifier);
BUFFER_FOR_CPP_TYPE_VALUE(*cpp_type, buffer);