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:
Diffstat (limited to 'source/blender/makesrna/intern/rna_fcurve.c')
-rw-r--r--source/blender/makesrna/intern/rna_fcurve.c28
1 files changed, 25 insertions, 3 deletions
diff --git a/source/blender/makesrna/intern/rna_fcurve.c b/source/blender/makesrna/intern/rna_fcurve.c
index a8a73d15c9d..1fe22e8fdd8 100644
--- a/source/blender/makesrna/intern/rna_fcurve.c
+++ b/source/blender/makesrna/intern/rna_fcurve.c
@@ -546,6 +546,11 @@ static void rna_FKeyframe_points_remove(FCurve *fcu, ReportList *reports, BezTri
delete_fcurve_key(fcu, index, !do_fast);
}
+static void rna_fcurve_range(FCurve *fcu, float range[2])
+{
+ calc_fcurve_range(fcu, range, range+1);
+}
+
#else
static void rna_def_fmodifier_generator(BlenderRNA *brna)
@@ -852,7 +857,7 @@ static void rna_def_fmodifier_noise(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Phase", "A random seed for the noise effect");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
- prop= RNA_def_property(srna, "depth", PROP_INT, PROP_NONE);
+ prop= RNA_def_property(srna, "depth", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "depth");
RNA_def_property_ui_text(prop, "Depth", "Amount of fine level detail present in the noise");
RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
@@ -1321,7 +1326,9 @@ static void rna_def_fcurve(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
-
+ FunctionRNA *func;
+ PropertyRNA *parm;
+
static EnumPropertyItem prop_mode_extend_items[] = {
{FCURVE_EXTRAPOLATE_CONSTANT, "CONSTANT", 0, "Constant", ""},
{FCURVE_EXTRAPOLATE_LINEAR, "LINEAR", 0, "Linear", ""},
@@ -1423,8 +1430,23 @@ static void rna_def_fcurve(BlenderRNA *brna)
prop= RNA_def_property(srna, "modifiers", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_type(prop, "FModifier");
RNA_def_property_ui_text(prop, "Modifiers", "Modifiers affecting the shape of the F-Curve");
-
rna_def_fcurve_modifiers(brna, prop);
+
+ /* Functions */
+ func= RNA_def_function(srna, "evaluate", "evaluate_fcurve"); /* calls the C/API direct */
+ RNA_def_function_ui_description(func, "Evaluate fcurve.");
+ parm= RNA_def_float(func, "frame", 1.0f, -FLT_MAX, FLT_MAX, "Frame", "Evaluate fcurve at given frame", -FLT_MAX, FLT_MAX);
+ RNA_def_property_flag(parm, PROP_REQUIRED);
+ /* return value */
+ parm= RNA_def_float(func, "position", 0, -FLT_MAX, FLT_MAX, "Position", "Fcurve position", -FLT_MAX, FLT_MAX);
+ RNA_def_function_return(func, parm);
+
+ func= RNA_def_function(srna, "range", "rna_fcurve_range");
+ RNA_def_function_ui_description(func, "Get the time extents for F-Curve.");
+ /* return value */
+ parm= RNA_def_float_vector(func, "range", 2, NULL, -FLT_MAX, FLT_MAX, "Range", "Min/Max values", -FLT_MAX, FLT_MAX);
+ RNA_def_property_flag(parm, PROP_THICK_WRAP);
+ RNA_def_function_output(func, parm);
}
/* *********************** */