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-21 04:23:26 +0300
committerHans Goudey <h.goudey@me.com>2021-09-21 04:23:26 +0300
commit17021adceaee28295b89301b4f715b6bcd8d5fca (patch)
treea8854e95ccf4a895cf16d4dab389b9d0ec150b1c /source/blender/makesrna/intern/rna_nodetree.c
parent9e939a614ec5cda5dd6e5392bf9c209d21127c33 (diff)
Geometry Nodes: Curve Sample Node
This node allows sampling positions, tangents, and normals at any arbitrary point along a curve. The curve can include multiple splines, all are taken into account. The node does not yet support transferring generic attributes like radius, because some more general tooling will make that much more feasible and useful in different scenarios. This is a field node, so it is evaluated in the context of a data-flow node like "Set Position". One nice thing about that is it can easily be used to move an entire geometry like the follow path constraint. The point along the curve is chosen either with a factor of the total length of the curve, or a length into the curve, the same choice used in the curve trim node. Differential Revision: https://developer.blender.org/D12565
Diffstat (limited to 'source/blender/makesrna/intern/rna_nodetree.c')
-rw-r--r--source/blender/makesrna/intern/rna_nodetree.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c
index ae5f8d5f5da..d0bf60d5d02 100644
--- a/source/blender/makesrna/intern/rna_nodetree.c
+++ b/source/blender/makesrna/intern/rna_nodetree.c
@@ -9088,6 +9088,30 @@ static void def_geo_curve_primitive_bezier_segment(StructRNA *srna)
RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_socket_update");
}
+static void def_geo_curve_sample(StructRNA *srna)
+{
+ static EnumPropertyItem mode_items[] = {
+ {GEO_NODE_CURVE_SAMPLE_FACTOR,
+ "FACTOR",
+ 0,
+ "Factor",
+ "Find sample positions on the curve using a factor of its total length"},
+ {GEO_NODE_CURVE_SAMPLE_LENGTH,
+ "LENGTH",
+ 0,
+ "Length",
+ "Find sample positions on the curve using a distance from its beginning"},
+ {0, NULL, 0, NULL, NULL},
+ };
+
+ RNA_def_struct_sdna_from(srna, "NodeGeometryCurveSample", "storage");
+
+ PropertyRNA *prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_items(prop, mode_items);
+ RNA_def_property_ui_text(prop, "Mode", "Method for sampling input");
+ RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_socket_update");
+}
+
static void def_geo_triangulate(StructRNA *srna)
{
PropertyRNA *prop;