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-10-20 18:25:49 +0300
committerHans Goudey <h.goudey@me.com>2021-10-20 18:25:49 +0300
commit334a8d9b3eebaf4abf7c8d18e4512b5f04ecffc0 (patch)
tree6eb3825ff7bfb21bf6f3acae2449bbb8b07f4f06 /source/blender/makesrna/intern/rna_nodetree.c
parente00bf04c0f59a9ed5bbe79e62f2f81861fbef2d7 (diff)
Geometry Nodes: Fields version of Curve to Points node
This commit adds an updated version of the curve to points that supports fields. Only the position and radius are transferred by default now, which should improve performance. The other outputs like tangent and rotation are outputted with anonymous attributes. I took the opportunity to change a few other small things: - Name geometry sockets "Curve" and "Points" like other nodes. - Remove the radius multiple of 0.1, which was confusing. Thanks to @Johnny Matthews (guitargeek) for an initial patch. Differential Revision: https://developer.blender.org/D12887
Diffstat (limited to 'source/blender/makesrna/intern/rna_nodetree.c')
-rw-r--r--source/blender/makesrna/intern/rna_nodetree.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c
index dfefc774b3d..438344304cf 100644
--- a/source/blender/makesrna/intern/rna_nodetree.c
+++ b/source/blender/makesrna/intern/rna_nodetree.c
@@ -10528,6 +10528,38 @@ static void def_geo_curve_fillet(StructRNA *srna)
RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_socket_update");
}
+static void def_geo_legacy_curve_to_points(StructRNA *srna)
+{
+ PropertyRNA *prop;
+
+ static EnumPropertyItem mode_items[] = {
+ {GEO_NODE_CURVE_RESAMPLE_EVALUATED,
+ "EVALUATED",
+ 0,
+ "Evaluated",
+ "Create points from the curve's evaluated points, based on the resolution attribute for "
+ "NURBS and Bezier splines"},
+ {GEO_NODE_CURVE_RESAMPLE_COUNT,
+ "COUNT",
+ 0,
+ "Count",
+ "Sample each spline by evenly distributing the specified number of points"},
+ {GEO_NODE_CURVE_RESAMPLE_LENGTH,
+ "LENGTH",
+ 0,
+ "Length",
+ "Sample each spline by splitting it into segments with the specified length"},
+ {0, NULL, 0, NULL, NULL},
+ };
+
+ RNA_def_struct_sdna_from(srna, "NodeGeometryCurveToPoints", "storage");
+
+ 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", "How to generate points from the input curve");
+ RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_socket_update");
+}
+
static void def_geo_curve_to_points(StructRNA *srna)
{
PropertyRNA *prop;