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-09-22 01:37:16 +0300
committerHans Goudey <h.goudey@me.com>2021-09-22 01:38:37 +0300
commit4d881d9dad764dec22c057f434d3f91c26f0b0ef (patch)
treeb06e397afcd85cb1f15e7f694289dfac22a0b15d /source/blender/blenkernel
parent41e3bf8a8e79c8c42f72d49dea64b634aa243ff7 (diff)
Geometry Nodes: Curve Parameter Node
This commit adds a field input node that outputs the fraction of the total length of the spline on each control point. This is useful for anything that involves varying a value depending on how far along the spline it is. It also works when evaluated on the spline domain, where it outputs the fraction of the total length of all of the splines at the start. The operation isn't as well defined for NURB splines for the reasons noted in the code comment. That can be said explicitly in the docs. Differential Revision: https://developer.blender.org/D12548
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r--source/blender/blenkernel/BKE_node.h1
-rw-r--r--source/blender/blenkernel/intern/node.cc1
2 files changed, 2 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_node.h b/source/blender/blenkernel/BKE_node.h
index e242aed879f..42e2cda8de3 100644
--- a/source/blender/blenkernel/BKE_node.h
+++ b/source/blender/blenkernel/BKE_node.h
@@ -1498,6 +1498,7 @@ int ntreeTexExecTree(struct bNodeTree *ntree,
#define GEO_NODE_CURVE_SAMPLE 1085
#define GEO_NODE_INPUT_TANGENT 1086
#define GEO_NODE_STRING_JOIN 1087
+#define GEO_NODE_CURVE_PARAMETER 1088
/** \} */
diff --git a/source/blender/blenkernel/intern/node.cc b/source/blender/blenkernel/intern/node.cc
index 7f423e53161..2d0239740f8 100644
--- a/source/blender/blenkernel/intern/node.cc
+++ b/source/blender/blenkernel/intern/node.cc
@@ -5187,6 +5187,7 @@ static void registerGeometryNodes()
register_node_type_geo_curve_endpoints();
register_node_type_geo_curve_fill();
register_node_type_geo_curve_length();
+ register_node_type_geo_curve_parameter();
register_node_type_geo_curve_primitive_bezier_segment();
register_node_type_geo_curve_primitive_circle();
register_node_type_geo_curve_primitive_line();