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:
authorCampbell Barton <ideasman42@gmail.com>2018-08-20 04:27:49 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-08-20 04:27:49 +0300
commit143511b9613faeb974082be036ee0b45917200ae (patch)
tree83725a8b33364bad5281d45e23e2e57b2588bdf6 /source/blender/makesrna/intern/rna_curve_api.c
parentb831accc01a5790b6112f70e8bb5d6b3a8e8ab4d (diff)
parent98efcdb1a0e31beff50922132e475695c3ae6af7 (diff)
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/makesrna/intern/rna_curve_api.c')
-rw-r--r--source/blender/makesrna/intern/rna_curve_api.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_curve_api.c b/source/blender/makesrna/intern/rna_curve_api.c
index b0c07465958..dc1cbed824e 100644
--- a/source/blender/makesrna/intern/rna_curve_api.c
+++ b/source/blender/makesrna/intern/rna_curve_api.c
@@ -55,6 +55,11 @@ static void rna_Curve_update_gpu_tag(Curve *cu)
BKE_curve_batch_cache_dirty(cu, BKE_CURVE_BATCH_DIRTY_ALL);
}
+static float rna_Nurb_calc_length(Nurb *nu, int resolution_u)
+{
+ return BKE_nurb_calc_length(nu, resolution_u);
+}
+
#else
void RNA_api_curve(StructRNA *srna)
@@ -77,4 +82,20 @@ void RNA_api_curve(StructRNA *srna)
RNA_def_function(srna, "update_gpu_tag", "rna_Curve_update_gpu_tag");
}
+void RNA_api_curve_nurb(StructRNA *srna)
+{
+ FunctionRNA *func;
+ PropertyRNA *parm;
+
+ func = RNA_def_function(srna, "calc_length", "rna_Nurb_calc_length");
+ RNA_def_function_ui_description(func, "Calculate spline length");
+ RNA_def_int(
+ func, "resolution", 0, 0, 1024, "Resolution",
+ "Spline resolution to be used, 0 defaults to the resolution_u", 0, 64);
+ parm = RNA_def_float_distance(
+ func, "length", 0.0f, 0.0f, FLT_MAX, "Length",
+ "Length of the polygonaly approximated spline", 0.0f, FLT_MAX);
+ RNA_def_function_return(func, parm);
+}
+
#endif