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-07-02 23:23:43 +0300
committerHans Goudey <h.goudey@me.com>2021-07-02 23:23:43 +0300
commit3efc50dfde43252927e094b1ebf9ef5aa6b12b07 (patch)
treef7e6bd09200b65b5c02a4f979b4bc0e6e8e086a3 /source/blender/makesrna/intern
parent5f5cf21a833fb636627121ffd94a57ebf514fac6 (diff)
Boilerplate code. Big problem is using builtin attributes
Diffstat (limited to 'source/blender/makesrna/intern')
-rw-r--r--source/blender/makesrna/intern/rna_nodetree.c36
1 files changed, 31 insertions, 5 deletions
diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c
index c927c7df6bd..88697760a77 100644
--- a/source/blender/makesrna/intern/rna_nodetree.c
+++ b/source/blender/makesrna/intern/rna_nodetree.c
@@ -9890,12 +9890,12 @@ static void def_geo_curve_resample(StructRNA *srna)
PropertyRNA *prop;
static EnumPropertyItem mode_items[] = {
- {GEO_NODE_CURVE_SAMPLE_COUNT,
+ {GEO_NODE_CURVE_RESAMPLE_COUNT,
"COUNT",
0,
"Count",
"Sample the specified number of points along each spline"},
- {GEO_NODE_CURVE_SAMPLE_LENGTH,
+ {GEO_NODE_CURVE_RESAMPLE_LENGTH,
"LENGTH",
0,
"Length",
@@ -9912,6 +9912,32 @@ static void def_geo_curve_resample(StructRNA *srna)
RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_socket_update");
}
+static void def_geo_curve_sample(StructRNA *srna)
+{
+ PropertyRNA *prop;
+
+ static EnumPropertyItem mode_items[] = {
+ {GEO_NODE_CURVE_SAMPLE_FACTOR,
+ "COUNT",
+ 0,
+ "Count",
+ "Choose sample points on the curve based on the portion of the total length"},
+ {GEO_NODE_CURVE_SAMPLE_LENGTH,
+ "LENGTH",
+ 0,
+ "Length",
+ "Choose sample points on the curve based on the assumulated length at that point"},
+ {0, NULL, 0, NULL, NULL},
+ };
+
+ RNA_def_struct_sdna_from(srna, "NodeGeometryCurveResample", "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 specify the amount of samples");
+ RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_socket_update");
+}
+
static void def_geo_curve_subdivide(StructRNA *srna)
{
PropertyRNA *prop;
@@ -9929,18 +9955,18 @@ static void def_geo_curve_to_points(StructRNA *srna)
PropertyRNA *prop;
static EnumPropertyItem mode_items[] = {
- {GEO_NODE_CURVE_SAMPLE_EVALUATED,
+ {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_SAMPLE_COUNT,
+ {GEO_NODE_CURVE_RESAMPLE_COUNT,
"COUNT",
0,
"Count",
"Sample each spline by evenly distributing the specified number of points"},
- {GEO_NODE_CURVE_SAMPLE_LENGTH,
+ {GEO_NODE_CURVE_RESAMPLE_LENGTH,
"LENGTH",
0,
"Length",