diff options
Diffstat (limited to 'source/blender/makesrna/intern/rna_fcurve.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_fcurve.c | 337 |
1 files changed, 161 insertions, 176 deletions
diff --git a/source/blender/makesrna/intern/rna_fcurve.c b/source/blender/makesrna/intern/rna_fcurve.c index ea26118f267..95a0482557f 100644 --- a/source/blender/makesrna/intern/rna_fcurve.c +++ b/source/blender/makesrna/intern/rna_fcurve.c @@ -35,74 +35,19 @@ #include "MEM_guardedalloc.h" EnumPropertyItem fmodifier_type_items[] = { - {FMODIFIER_TYPE_NULL, "NULL", "Invalid", ""}, - {FMODIFIER_TYPE_GENERATOR, "GENERATOR", "Generator", ""}, - {FMODIFIER_TYPE_ENVELOPE, "ENVELOPE", "Envelope", ""}, - {FMODIFIER_TYPE_CYCLES, "CYCLES", "Cycles", ""}, - {FMODIFIER_TYPE_NOISE, "NOISE", "Noise", ""}, - {FMODIFIER_TYPE_FILTER, "FILTER", "Filter", ""}, - {FMODIFIER_TYPE_PYTHON, "PYTHON", "Python", ""}, - {FMODIFIER_TYPE_LIMITS, "LIMITS", "Limits", ""}, - {0, NULL, NULL, NULL}}; + {FMODIFIER_TYPE_NULL, "NULL", 0, "Invalid", ""}, + {FMODIFIER_TYPE_GENERATOR, "GENERATOR", 0, "Generator", ""}, + {FMODIFIER_TYPE_FN_GENERATOR, "FNGENERATOR", 0, "Built-In Function", ""}, + {FMODIFIER_TYPE_ENVELOPE, "ENVELOPE", 0, "Envelope", ""}, + {FMODIFIER_TYPE_CYCLES, "CYCLES", 0, "Cycles", ""}, + {FMODIFIER_TYPE_NOISE, "NOISE", 0, "Noise", ""}, + {FMODIFIER_TYPE_FILTER, "FILTER", 0, "Filter", ""}, + {FMODIFIER_TYPE_PYTHON, "PYTHON", 0, "Python", ""}, + {FMODIFIER_TYPE_LIMITS, "LIMITS", 0, "Limits", ""}, + {0, NULL, 0, NULL, NULL}}; #ifdef RNA_RUNTIME -float FModGenFunc_amplitude_get(PointerRNA *ptr) -{ - FModifier *fcm = (FModifier *)(ptr->data); - FMod_Generator *data= (FMod_Generator*)(fcm->data); - return (data->coefficients) ? (float)data->coefficients[0] : 1.0f; -} - -void FModGenFunc_amplitude_set(PointerRNA *ptr, float value) -{ - FModifier *fcm = (FModifier *)(ptr->data); - FMod_Generator *data= (FMod_Generator*)(fcm->data); - if (data->coefficients) data->coefficients[0]= value; -} - -float FModGenFunc_pre_multiplier_get(PointerRNA *ptr) -{ - FModifier *fcm = (FModifier *)(ptr->data); - FMod_Generator *data= (FMod_Generator*)(fcm->data); - return (data->coefficients) ? (float)data->coefficients[1] : 1.0f; -} - -void FModGenFunc_pre_multiplier_set(PointerRNA *ptr, float value) -{ - FModifier *fcm = (FModifier *)(ptr->data); - FMod_Generator *data= (FMod_Generator*)(fcm->data); - if (data->coefficients) data->coefficients[1]= value; -} - -float FModGenFunc_x_offset_get(PointerRNA *ptr) -{ - FModifier *fcm = (FModifier *)(ptr->data); - FMod_Generator *data= (FMod_Generator*)(fcm->data); - return (data->coefficients) ? (float)data->coefficients[2] : 0.0f; -} - -void FModGenFunc_x_offset_set(PointerRNA *ptr, float value) -{ - FModifier *fcm = (FModifier *)(ptr->data); - FMod_Generator *data= (FMod_Generator*)(fcm->data); - if (data->coefficients) data->coefficients[2]= value; -} - -float FModGenFunc_y_offset_get(PointerRNA *ptr) -{ - FModifier *fcm = (FModifier *)(ptr->data); - FMod_Generator *data= (FMod_Generator*)(fcm->data); - return (data->coefficients) ? (float)data->coefficients[3] : 0.0f; -} - -void FModGenFunc_y_offset_set(PointerRNA *ptr, float value) -{ - FModifier *fcm = (FModifier *)(ptr->data); - FMod_Generator *data= (FMod_Generator*)(fcm->data); - if (data->coefficients) data->coefficients[3]= value; -} - /* --------- */ StructRNA *rna_FModifierType_refine(struct PointerRNA *ptr) @@ -111,20 +56,9 @@ StructRNA *rna_FModifierType_refine(struct PointerRNA *ptr) switch (fcm->type) { case FMODIFIER_TYPE_GENERATOR: - { - FMod_Generator *gen= (FMod_Generator *)fcm->data; - - switch (gen->mode) { - case FCM_GENERATOR_POLYNOMIAL: - return &RNA_FModifierGenerator_PolyExpanded; - //case FCM_GENERATOR_POLYNOMIAL_FACTORISED: - case FCM_GENERATOR_FUNCTION: - return &RNA_FModifierGenerator_Function; - //case FCM_GENERATOR_EXPRESSION: - default: - return &RNA_FModifierGenerator; - } - } + return &RNA_FModifierGenerator; + case FMODIFIER_TYPE_FN_GENERATOR: + return &RNA_FModifierFunctionGenerator; case FMODIFIER_TYPE_ENVELOPE: return &RNA_FModifierEnvelope; case FMODIFIER_TYPE_CYCLES: @@ -215,21 +149,22 @@ static void rna_FCurve_RnaPath_set(PointerRNA *ptr, const char *value) #else -static void rna_def_fmodifier_generator_common(StructRNA *srna) + +static void rna_def_fmodifier_generator(BlenderRNA *brna) { + StructRNA *srna; PropertyRNA *prop; static EnumPropertyItem prop_mode_items[] = { - {FCM_GENERATOR_POLYNOMIAL, "POLYNOMIAL", "Expanded Polynomial", ""}, - {FCM_GENERATOR_POLYNOMIAL_FACTORISED, "POLYNOMIAL_FACTORISED", "Factorised Polynomial", ""}, - {FCM_GENERATOR_FUNCTION, "FUNCTION", "Built-In Function", ""}, - {FCM_GENERATOR_EXPRESSION, "EXPRESSION", "Expression", ""}, - {0, NULL, NULL, NULL}}; - - /* struct wrapping settings */ - RNA_def_struct_sdna_from(srna, "FMod_Generator", "data"); + {FCM_GENERATOR_POLYNOMIAL, "POLYNOMIAL", 0, "Expanded Polynomial", ""}, + {FCM_GENERATOR_POLYNOMIAL_FACTORISED, "POLYNOMIAL_FACTORISED", 0, "Factorised Polynomial", ""}, + {0, NULL, 0, NULL, NULL}}; - /* settings */ + srna= RNA_def_struct(brna, "FModifierGenerator", "FModifier"); + RNA_def_struct_ui_text(srna, "Generator F-Curve Modifier", "Deterministically generates values for the modified F-Curve."); + RNA_def_struct_sdna_from(srna, "FMod_Generator", "data"); + + /* define common props */ prop= RNA_def_property(srna, "additive", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", FCM_GENERATOR_ADDITIVE); RNA_def_property_ui_text(prop, "Additive", "Values generated by this modifier are applied on top of the existing values instead of overwriting them."); @@ -238,94 +173,122 @@ static void rna_def_fmodifier_generator_common(StructRNA *srna) prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, prop_mode_items); RNA_def_property_ui_text(prop, "Mode", "Type of generator to use."); -} - -/* this is a temporary dummy generator-modifier wrapping (to be discarded) */ -static void rna_def_fmodifier_generator(BlenderRNA *brna) -{ - StructRNA *srna; - srna= RNA_def_struct(brna, "FModifierGenerator", "FModifier"); - RNA_def_struct_ui_text(srna, "Generator F-Curve Modifier", "Deterministically generates values for the modified F-Curve."); - - /* define common props */ - rna_def_fmodifier_generator_common(srna); -} - -static void rna_def_fmodifier_generator_polyexpanded(BlenderRNA *brna) -{ - StructRNA *srna; - PropertyRNA *prop; - - srna= RNA_def_struct(brna, "FModifierGenerator_PolyExpanded", "FModifier"); - RNA_def_struct_ui_text(srna, "Expanded Polynomial Generator", "Generates values for the modified F-Curve using expanded polynomial expresion."); - - /* define common props */ - rna_def_fmodifier_generator_common(srna); /* order of the polynomial */ // XXX this has a special validation func prop= RNA_def_property(srna, "poly_order", PROP_INT, PROP_NONE); - RNA_def_property_ui_text(prop, "Polynomial Order", "The highest power of 'x' for this polynomial. (i.e. the number of coefficients - 1)"); + RNA_def_property_ui_text(prop, "Polynomial Order", "The highest power of 'x' for this polynomial. (number of coefficients - 1)"); /* coefficients array */ - //prop= RNA_def_property(srna, "coefficients", PROP_FLOAT, PROP_NONE); - //RNA_def_property_ui_text(prop, "Coefficients", "Coefficients for 'x' (starting from lowest power)."); + // FIXME: this is quite difficult to try to wrap + //prop= RNA_def_property(srna, "coefficients", PROP_COLLECTION, PROP_NONE); + //RNA_def_property_collection_funcs(prop, "rna_FModifierGenerator_coefficients_begin", "rna_FModifierGenerator_coefficients_next", "rna_FModifierGenerator_coefficients_end", "rna_iterator_array_get", "rna_FModifierGenerator_coefficients_length", 0, 0, 0, 0); + //RNA_def_property_ui_text(prop, "Coefficients", "Coefficients for 'x' (starting from lowest power of x^0)."); } -static void rna_def_fmodifier_generator_function(BlenderRNA *brna) +/* --------- */ + +static void rna_def_fmodifier_function_generator(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; static EnumPropertyItem prop_type_items[] = { - {0, "SIN", "Sine", ""}, - {1, "COS", "Cosine", ""}, - {2, "TAN", "Tangent", ""}, - {3, "SQRT", "Square Root", ""}, - {4, "LN", "Natural Logarithm", ""}, - {0, NULL, NULL, NULL}}; - - - srna= RNA_def_struct(brna, "FModifierGenerator_Function", "FModifier"); - RNA_def_struct_ui_text(srna, "Built-In Function Generator", "Generates values for modified F-Curve using Built-In Function."); - - /* common settings */ - rna_def_fmodifier_generator_common(srna); - - /* type */ - prop= RNA_def_property(srna, "func_type", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_items(prop, prop_type_items); - RNA_def_property_ui_text(prop, "Type", "Type of Built-In function to use as generator."); + {0, "SIN", 0, "Sine", ""}, + {1, "COS", 0, "Cosine", ""}, + {2, "TAN", 0, "Tangent", ""}, + {3, "SQRT", 0, "Square Root", ""}, + {4, "LN", 0, "Natural Logarithm", ""}, + {5, "SINC", 0, "Normalised Sine", "sin(x) / x"}, + {0, NULL, 0, NULL, NULL}}; + + srna= RNA_def_struct(brna, "FModifierFunctionGenerator", "FModifier"); + RNA_def_struct_ui_text(srna, "Built-In Function F-Modifier", "Generates values using a Built-In Function."); + RNA_def_struct_sdna_from(srna, "FMod_FunctionGenerator", "data"); /* coefficients */ prop= RNA_def_property(srna, "amplitude", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_funcs(prop, "FModGenFunc_amplitude_get", "FModGenFunc_amplitude_set", NULL); - RNA_def_property_ui_text(prop, "Amplitude", "Scale factor for y-values generated by the function."); + RNA_def_property_ui_text(prop, "Amplitude", "Scale factor determining the maximum/minimum values."); - prop= RNA_def_property(srna, "pre_multiplier", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_funcs(prop, "FModGenFunc_pre_multiplier_get", "FModGenFunc_pre_multiplier_set", NULL); - RNA_def_property_ui_text(prop, "PreMultiplier", "Scale factor for x-value inputs to function."); + prop= RNA_def_property(srna, "phase_multiplier", PROP_FLOAT, PROP_NONE); + RNA_def_property_ui_text(prop, "Phase Multiplier", "Scale factor determining the 'speed' of the function."); - prop= RNA_def_property(srna, "x_offset", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_funcs(prop, "FModGenFunc_x_offset_get", "FModGenFunc_x_offset_set", NULL); - RNA_def_property_ui_text(prop, "X Offset", "Offset for x-value inputs to function."); + prop= RNA_def_property(srna, "phase_offset", PROP_FLOAT, PROP_NONE); + RNA_def_property_ui_text(prop, "Phase Offset", "Constant factor to offset time by for function."); + + prop= RNA_def_property(srna, "value_offset", PROP_FLOAT, PROP_NONE); + RNA_def_property_ui_text(prop, "Value Offset", "Constant factor to offset values by."); + + /* flags */ + prop= RNA_def_property(srna, "additive", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", FCM_GENERATOR_ADDITIVE); + RNA_def_property_ui_text(prop, "Additive", "Values generated by this modifier are applied on top of the existing values instead of overwriting them."); - prop= RNA_def_property(srna, "y_offset", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_funcs(prop, "FModGenFunc_y_offset_get", "FModGenFunc_y_offset_set", NULL); - RNA_def_property_ui_text(prop, "Y Offset", "Offset for y-values generated by the function."); + prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_items(prop, prop_type_items); + RNA_def_property_ui_text(prop, "Type", "Type of built-in function to use."); } /* --------- */ +static void rna_def_fmodifier_envelope_ctrl(BlenderRNA *brna) +{ + StructRNA *srna; + PropertyRNA *prop; + + srna= RNA_def_struct(brna, "FModifierEnvelopeControlPoint", NULL); + RNA_def_struct_ui_text(srna, "Envelope Control Point", "Control point for envelope F-Modifier."); + RNA_def_struct_sdna(srna, "FCM_EnvelopeData"); + + /* min/max extents + * - for now, these are allowed to go past each other, so that we can have inverted action + * - technically, the range is limited by the settings in the envelope-modifier data, not here... + */ + prop= RNA_def_property(srna, "minimum", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "min"); + RNA_def_property_ui_text(prop, "Minimum Value", "Lower bound of envelope at this control-point."); + + prop= RNA_def_property(srna, "maximum", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "max"); + RNA_def_property_ui_text(prop, "Maximum Value", "Upper bound of envelope at this control-point."); + + /* Frame */ + prop= RNA_def_property(srna, "frame", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "time"); + RNA_def_property_ui_text(prop, "Frame", "Frame this control-point occurs on."); + + // TODO: + // - selection flags (not implemented in UI yet though) +} + static void rna_def_fmodifier_envelope(BlenderRNA *brna) { StructRNA *srna; - //PropertyRNA *prop; + PropertyRNA *prop; srna= RNA_def_struct(brna, "FModifierEnvelope", "FModifier"); - RNA_def_struct_ui_text(srna, "Envelope F-Curve Modifier", "Scales the values of the modified F-Curve."); + RNA_def_struct_ui_text(srna, "Envelope F-Modifier", "Scales the values of the modified F-Curve."); RNA_def_struct_sdna_from(srna, "FMod_Envelope", "data"); + + /* Collections */ + prop= RNA_def_property(srna, "control_points", PROP_COLLECTION, PROP_NONE); + RNA_def_property_collection_sdna(prop, NULL, "data", "totvert"); + RNA_def_property_struct_type(prop, "FModifierEnvelopeControlPoint"); + RNA_def_property_ui_text(prop, "Control Points", "Control points defining the shape of the envelope."); + + /* Range Settings */ + prop= RNA_def_property(srna, "reference_value", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "midval"); + RNA_def_property_ui_text(prop, "Reference Value", "Value that envelope's influence is centered around / based on."); + + prop= RNA_def_property(srna, "default_minimum", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "min"); + RNA_def_property_ui_text(prop, "Default Minimum", "Lower distance from Reference Value for 1:1 default influence."); + + prop= RNA_def_property(srna, "default_maximum", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "max"); + RNA_def_property_ui_text(prop, "Default Maximum", "Upper distance from Reference Value for 1:1 default influence."); } /* --------- */ @@ -336,14 +299,14 @@ static void rna_def_fmodifier_cycles(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem prop_type_items[] = { - {FCM_EXTRAPOLATE_NONE, "NONE", "No Cycles", "Don't do anything."}, - {FCM_EXTRAPOLATE_CYCLIC, "REPEAT", "Repeat Motion", "Repeat keyframe range as-is."}, - {FCM_EXTRAPOLATE_CYCLIC_OFFSET, "REPEAT_OFFSET", "Repeat with Offset", "Repeat keyframe range, but with offset based on gradient between values"}, - {FCM_EXTRAPOLATE_MIRROR, "MIRROR", "Repeat Mirrored", "Alternate between forward and reverse playback of keyframe range"}, - {0, NULL, NULL, NULL}}; + {FCM_EXTRAPOLATE_NONE, "NONE", 0, "No Cycles", "Don't do anything."}, + {FCM_EXTRAPOLATE_CYCLIC, "REPEAT", 0, "Repeat Motion", "Repeat keyframe range as-is."}, + {FCM_EXTRAPOLATE_CYCLIC_OFFSET, "REPEAT_OFFSET", 0, "Repeat with Offset", "Repeat keyframe range, but with offset based on gradient between values"}, + {FCM_EXTRAPOLATE_MIRROR, "MIRROR", 0, "Repeat Mirrored", "Alternate between forward and reverse playback of keyframe range"}, + {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "FModifierCycles", "FModifier"); - RNA_def_struct_ui_text(srna, "Cycles F-Curve Modifier", "Repeats the values of the modified F-Curve."); + RNA_def_struct_ui_text(srna, "Cycles F-Modifier", "Repeats the values of the modified F-Curve."); RNA_def_struct_sdna_from(srna, "FMod_Cycles", "data"); /* before */ @@ -372,7 +335,7 @@ static void rna_def_fmodifier_python(BlenderRNA *brna) //PropertyRNA *prop; srna= RNA_def_struct(brna, "FModifierPython", "FModifier"); - RNA_def_struct_ui_text(srna, "Python F-Curve Modifier", "Performs user-defined operation on the modified F-Curve."); + RNA_def_struct_ui_text(srna, "Python F-Modifier", "Performs user-defined operation on the modified F-Curve."); RNA_def_struct_sdna_from(srna, "FMod_Python", "data"); } @@ -384,7 +347,7 @@ static void rna_def_fmodifier_limits(BlenderRNA *brna) PropertyRNA *prop; srna= RNA_def_struct(brna, "FModifierLimits", "FModifier"); - RNA_def_struct_ui_text(srna, "Limits F-Curve Modifier", "Limits the time/value ranges of the modified F-Curve."); + RNA_def_struct_ui_text(srna, "Limits F-Modifier", "Limits the time/value ranges of the modified F-Curve."); RNA_def_struct_sdna_from(srna, "FMod_Limits", "data"); prop= RNA_def_property(srna, "use_minimum_x", PROP_BOOLEAN, PROP_NONE); @@ -428,14 +391,14 @@ static void rna_def_fmodifier_noise(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem prop_modification_items[] = { - {FCM_NOISE_MODIF_REPLACE, "REPLACE", "Replace", ""}, - {FCM_NOISE_MODIF_ADD, "ADD", "Add", ""}, - {FCM_NOISE_MODIF_SUBTRACT, "SUBTRACT", "Subtract", ""}, - {FCM_NOISE_MODIF_MULTIPLY, "MULTIPLY", "Multiply", ""}, - {0, NULL, NULL, NULL}}; + {FCM_NOISE_MODIF_REPLACE, "REPLACE", 0, "Replace", ""}, + {FCM_NOISE_MODIF_ADD, "ADD", 0, "Add", ""}, + {FCM_NOISE_MODIF_SUBTRACT, "SUBTRACT", 0, "Subtract", ""}, + {FCM_NOISE_MODIF_MULTIPLY, "MULTIPLY", 0, "Multiply", ""}, + {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "FModifierNoise", "FModifier"); - RNA_def_struct_ui_text(srna, "Noise F-Curve Modifier", "Gives randomness to the modified F-Curve."); + RNA_def_struct_ui_text(srna, "Noise F-Modifier", "Gives randomness to the modified F-Curve."); RNA_def_struct_sdna_from(srna, "FMod_Noise", "data"); prop= RNA_def_property(srna, "modification", PROP_ENUM, PROP_NONE); @@ -471,7 +434,7 @@ void rna_def_fmodifier(BlenderRNA *brna) /* base struct definition */ srna= RNA_def_struct(brna, "FModifier", NULL); RNA_def_struct_refine_func(srna, "rna_FModifierType_refine"); - RNA_def_struct_ui_text(srna, "FCurve Modifier", "Modifier for values of F-Curve."); + RNA_def_struct_ui_text(srna, "F-Modifier", "Modifier for values of F-Curve."); #if 0 // XXX not used yet /* name */ @@ -542,10 +505,10 @@ void rna_def_channeldriver(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem prop_type_items[] = { - {DRIVER_TYPE_AVERAGE, "AVERAGE", "Averaged Value", ""}, - {DRIVER_TYPE_PYTHON, "SCRIPTED", "Scripted Expression", ""}, - {DRIVER_TYPE_ROTDIFF, "ROTDIFF", "Rotational Difference", ""}, - {0, NULL, NULL, NULL}}; + {DRIVER_TYPE_AVERAGE, "AVERAGE", 0, "Averaged Value", ""}, + {DRIVER_TYPE_PYTHON, "SCRIPTED", 0, "Scripted Expression", ""}, + {DRIVER_TYPE_ROTDIFF, "ROTDIFF", 0, "Rotational Difference", ""}, + {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "Driver", NULL); RNA_def_struct_sdna(srna, "ChannelDriver"); @@ -569,20 +532,41 @@ void rna_def_channeldriver(BlenderRNA *brna) /* *********************** */ +static void rna_def_fpoint(BlenderRNA *brna) +{ + StructRNA *srna; + PropertyRNA *prop; + + srna= RNA_def_struct(brna, "FCurveSample", NULL); + RNA_def_struct_sdna(srna, "FPoint"); + RNA_def_struct_ui_text(srna, "F-Curve Sample", "Sample point for F-Curve."); + + /* Boolean values */ + prop= RNA_def_property(srna, "selected", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", 1); + RNA_def_property_ui_text(prop, "Selected", "Selection status"); + + /* Vector value */ + prop= RNA_def_property(srna, "point", PROP_FLOAT, PROP_VECTOR); + RNA_def_property_array(prop, 2); + RNA_def_property_float_sdna(prop, NULL, "vec"); + RNA_def_property_ui_text(prop, "Point", "Point coordinates"); +} + void rna_def_fcurve(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; static EnumPropertyItem prop_mode_extend_items[] = { - {FCURVE_EXTRAPOLATE_CONSTANT, "CONSTANT", "Constant", ""}, - {FCURVE_EXTRAPOLATE_LINEAR, "LINEAR", "Linear", ""}, - {0, NULL, NULL, NULL}}; + {FCURVE_EXTRAPOLATE_CONSTANT, "CONSTANT", 0, "Constant", ""}, + {FCURVE_EXTRAPOLATE_LINEAR, "LINEAR", 0, "Linear", ""}, + {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem prop_mode_color_items[] = { - {FCURVE_COLOR_AUTO_RAINBOW, "AUTO_RAINBOW", "Automatic Rainbow", ""}, - {FCURVE_COLOR_AUTO_RGB, "AUTO_RGB", "Automatic XYZ to RGB", ""}, - {FCURVE_COLOR_CUSTOM, "CUSTOM", "User Defined", ""}, - {0, NULL, NULL, NULL}}; + {FCURVE_COLOR_AUTO_RAINBOW, "AUTO_RAINBOW", 0, "Automatic Rainbow", ""}, + {FCURVE_COLOR_AUTO_RGB, "AUTO_RGB", 0, "Automatic XYZ to RGB", ""}, + {FCURVE_COLOR_CUSTOM, "CUSTOM", 0, "User Defined", ""}, + {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "FCurve", NULL); RNA_def_struct_ui_text(srna, "F-Curve", "F-Curve defining values of a period of time."); @@ -619,7 +603,7 @@ void rna_def_fcurve(BlenderRNA *brna) /* Collections */ prop= RNA_def_property(srna, "sampled_points", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "fpt", "totvert"); - RNA_def_property_struct_type(prop, "CurvePoint"); // XXX FPoints not BPoints here! FPoints are much smaller! + RNA_def_property_struct_type(prop, "FCurveSample"); RNA_def_property_ui_text(prop, "Sampled Points", "Sampled animation data"); prop= RNA_def_property(srna, "keyframe_points", PROP_COLLECTION, PROP_NONE); @@ -637,6 +621,7 @@ void rna_def_fcurve(BlenderRNA *brna) void RNA_def_fcurve(BlenderRNA *brna) { rna_def_fcurve(brna); + rna_def_fpoint(brna); rna_def_drivertarget(brna); rna_def_channeldriver(brna); @@ -644,9 +629,9 @@ void RNA_def_fcurve(BlenderRNA *brna) rna_def_fmodifier(brna); rna_def_fmodifier_generator(brna); - rna_def_fmodifier_generator_polyexpanded(brna); - rna_def_fmodifier_generator_function(brna); + rna_def_fmodifier_function_generator(brna); rna_def_fmodifier_envelope(brna); + rna_def_fmodifier_envelope_ctrl(brna); rna_def_fmodifier_cycles(brna); rna_def_fmodifier_python(brna); rna_def_fmodifier_limits(brna); |