Blender V2.61 - r43446
|
#include <math.h>
#include <stdio.h>
#include <stddef.h>
#include <string.h>
#include <float.h>
#include "MEM_guardedalloc.h"
#include "DNA_anim_types.h"
#include "BLI_blenlib.h"
#include "BLI_math.h"
#include "BLI_utildefines.h"
#include "BKE_fcurve.h"
#include "BKE_idprop.h"
Go to the source code of this file.
Classes | |
struct | tFCMED_Cycles |
Defines | |
#define | SMALL -1.0e-10 |
#define | SELECT 1 |
Typedefs | |
typedef struct tFCMED_Cycles | tFCMED_Cycles |
Functions | |
static void | fcm_generator_free (FModifier *fcm) |
static void | fcm_generator_copy (FModifier *fcm, FModifier *src) |
static void | fcm_generator_new_data (void *mdata) |
static void | fcm_generator_verify (FModifier *fcm) |
static void | fcm_generator_evaluate (FCurve *UNUSED(fcu), FModifier *fcm, float *cvalue, float evaltime) |
static void | fcm_fn_generator_new_data (void *mdata) |
static double | sinc (double x) |
static void | fcm_fn_generator_evaluate (FCurve *UNUSED(fcu), FModifier *fcm, float *cvalue, float evaltime) |
static void | fcm_envelope_free (FModifier *fcm) |
static void | fcm_envelope_copy (FModifier *fcm, FModifier *src) |
static void | fcm_envelope_new_data (void *mdata) |
static void | fcm_envelope_verify (FModifier *fcm) |
static void | fcm_envelope_evaluate (FCurve *UNUSED(fcu), FModifier *fcm, float *cvalue, float evaltime) |
static void | fcm_cycles_new_data (void *mdata) |
static float | fcm_cycles_time (FCurve *fcu, FModifier *fcm, float UNUSED(cvalue), float evaltime) |
static void | fcm_cycles_evaluate (FCurve *UNUSED(fcu), FModifier *fcm, float *cvalue, float UNUSED(evaltime)) |
static void | fcm_noise_new_data (void *mdata) |
static void | fcm_noise_evaluate (FCurve *UNUSED(fcu), FModifier *fcm, float *cvalue, float evaltime) |
static void | fcm_python_free (FModifier *fcm) |
static void | fcm_python_new_data (void *mdata) |
static void | fcm_python_copy (FModifier *fcm, FModifier *src) |
static void | fcm_python_evaluate (FCurve *UNUSED(fcu), FModifier *UNUSED(fcm), float *UNUSED(cvalue), float UNUSED(evaltime)) |
static float | fcm_limits_time (FCurve *UNUSED(fcu), FModifier *fcm, float UNUSED(cvalue), float evaltime) |
static void | fcm_limits_evaluate (FCurve *UNUSED(fcu), FModifier *fcm, float *cvalue, float UNUSED(evaltime)) |
static void | fcm_stepped_new_data (void *mdata) |
static float | fcm_stepped_time (FCurve *UNUSED(fcu), FModifier *fcm, float UNUSED(cvalue), float evaltime) |
static void | fmods_init_typeinfo (void) |
FModifierTypeInfo * | get_fmodifier_typeinfo (int type) |
FModifierTypeInfo * | fmodifier_get_typeinfo (FModifier *fcm) |
FModifier * | add_fmodifier (ListBase *modifiers, int type) |
FModifier * | copy_fmodifier (FModifier *src) |
void | copy_fmodifiers (ListBase *dst, ListBase *src) |
int | remove_fmodifier (ListBase *modifiers, FModifier *fcm) |
void | free_fmodifiers (ListBase *modifiers) |
FModifier * | find_active_fmodifier (ListBase *modifiers) |
void | set_active_fmodifier (ListBase *modifiers, FModifier *fcm) |
short | list_has_suitable_fmodifier (ListBase *modifiers, int mtype, short acttype) |
static float | eval_fmodifier_influence (FModifier *fcm, float evaltime) |
float | evaluate_time_fmodifiers (ListBase *modifiers, FCurve *fcu, float cvalue, float evaltime) |
void | evaluate_value_fmodifiers (ListBase *modifiers, FCurve *fcu, float *cvalue, float evaltime) |
void | fcurve_bake_modifiers (FCurve *fcu, int start, int end) |
Variables | |
static FModifierTypeInfo | FMI_GENERATOR |
static FModifierTypeInfo | FMI_FN_GENERATOR |
static FModifierTypeInfo | FMI_ENVELOPE |
static FModifierTypeInfo | FMI_CYCLES |
static FModifierTypeInfo | FMI_NOISE |
static FModifierTypeInfo | FMI_PYTHON |
static FModifierTypeInfo | FMI_LIMITS |
static FModifierTypeInfo | FMI_STEPPED |
static FModifierTypeInfo * | fmodifiersTypeInfo [FMODIFIER_NUM_TYPES] |
static short | FMI_INIT = 1 |
Definition in file fmodifier.c.
#define SELECT 1 |
Definition at line 51 of file fmodifier.c.
#define SMALL -1.0e-10 |
Definition at line 50 of file fmodifier.c.
typedef struct tFCMED_Cycles tFCMED_Cycles |
Definition at line 993 of file fmodifier.c.
References BLI_addtail(), FModifier::data, ELEM, ListBase::first, FModifier::flag, FMODIFIER_FLAG_ACTIVE, FMODIFIER_FLAG_EXPANDED, FMODIFIER_TYPE_CYCLES, get_fmodifier_typeinfo(), FModifier::influence, ListBase::last, MEM_callocN(), FModifierTypeInfo::new_data, NULL, FModifierTypeInfo::size, FModifierTypeInfo::structName, and FModifier::type.
Referenced by graph_fmodifier_add_exec(), icu_to_fcurves(), nla_fmodifier_add_exec(), parent_set_exec(), setexpo_action_keys(), setexpo_graph_keys(), and verify_driver_fcurve().
Definition at line 1033 of file fmodifier.c.
References FModifierTypeInfo::copy_data, FModifier::data, fmodifier_get_typeinfo(), MEM_dupallocN(), NULL, and FModifier::prev.
Referenced by ANIM_fmodifiers_copy_to_buf(), and ANIM_fmodifiers_paste_from_buf().
Definition at line 1058 of file fmodifier.c.
References BLI_duplicatelist(), FModifierTypeInfo::copy_data, FModifier::data, ELEM, ListBase::first, fmodifier_get_typeinfo(), ListBase::last, MEM_dupallocN(), and NULL.
Referenced by ANIM_fmodifiers_copy_to_buf(), ANIM_paste_driver(), copy_fcurve(), and copy_nlastrip().
static float eval_fmodifier_influence | ( | FModifier * | fcm, |
float | evaltime | ||
) | [static] |
Definition at line 1203 of file fmodifier.c.
References FModifier::blendin, FModifier::blendout, FModifier::efra, FModifier::flag, FMODIFIER_FLAG_RANGERESTRICT, FMODIFIER_FLAG_USEINFLUENCE, FModifier::influence, NULL, and FModifier::sfra.
Referenced by evaluate_time_fmodifiers(), and evaluate_value_fmodifiers().
Definition at line 1252 of file fmodifier.c.
References FModifier::efra, ELEM, eval_fmodifier_influence(), FModifierTypeInfo::evaluate_modifier_time, FModifier::flag, FMODIFIER_FLAG_DISABLED, FMODIFIER_FLAG_MUTED, FMODIFIER_FLAG_RANGERESTRICT, fmodifier_get_typeinfo(), interpf(), ListBase::last, NULL, FModifier::prev, and FModifier::sfra.
Referenced by evaluate_fcurve(), and nlastrip_evaluate_actionclip().
void evaluate_value_fmodifiers | ( | ListBase * | modifiers, |
FCurve * | fcu, | ||
float * | cvalue, | ||
float | evaltime | ||
) |
Definition at line 1301 of file fmodifier.c.
References FModifier::efra, ELEM, eval_fmodifier_influence(), FModifierTypeInfo::evaluate_modifier, ListBase::first, FModifier::flag, FMODIFIER_FLAG_DISABLED, FMODIFIER_FLAG_MUTED, FMODIFIER_FLAG_RANGERESTRICT, fmodifier_get_typeinfo(), interpf(), NULL, and FModifier::sfra.
Referenced by evaluate_fcurve(), and nlastrip_evaluate_actionclip().
static void fcm_cycles_evaluate | ( | FCurve * | UNUSEDfcu, |
FModifier * | fcm, | ||
float * | cvalue, | ||
float | UNUSEDevaltime | ||
) | [static] |
Definition at line 671 of file fmodifier.c.
References tFCMED_Cycles::cycyofs, FModifier::edata, if(), MEM_freeN(), and NULL.
static void fcm_cycles_new_data | ( | void * | mdata | ) | [static] |
Definition at line 523 of file fmodifier.c.
References FMod_Cycles::after_mode, FMod_Cycles::before_mode, data, and FCM_EXTRAPOLATE_CYCLIC.
static float fcm_cycles_time | ( | FCurve * | fcu, |
FModifier * | fcm, | ||
float | UNUSEDcvalue, | ||
float | evaltime | ||
) | [static] |
Definition at line 531 of file fmodifier.c.
References FMod_Cycles::after_cycles, FMod_Cycles::after_mode, FMod_Cycles::before_cycles, FMod_Cycles::before_mode, FCurve::bezt, tFCMED_Cycles::cycyofs, FModifier::data, data, FModifier::edata, ELEM, FCM_EXTRAPOLATE_CYCLIC_OFFSET, FCM_EXTRAPOLATE_MIRROR, FModifier::flag, FMODIFIER_FLAG_DISABLED, FCurve::fpt, if(), MEM_callocN(), FModifier::prev, FCurve::totvert, BezTriple::vec, and FPoint::vec.
Definition at line 410 of file fmodifier.c.
References FModifier::data, FMod_Envelope::data, and MEM_dupallocN().
static void fcm_envelope_evaluate | ( | FCurve * | UNUSEDfcu, |
FModifier * | fcm, | ||
float * | cvalue, | ||
float | evaltime | ||
) | [static] |
Definition at line 439 of file fmodifier.c.
References FModifier::data, FMod_Envelope::data, KDL::diff(), if(), FMod_Envelope::max, max, FCM_EnvelopeData::max, FMod_Envelope::midval, FCM_EnvelopeData::min, min, FMod_Envelope::min, NULL, FCM_EnvelopeData::time, and FMod_Envelope::totvert.
static void fcm_envelope_free | ( | FModifier * | fcm | ) | [static] |
Definition at line 401 of file fmodifier.c.
References FModifier::data, FMod_Envelope::data, if(), and MEM_freeN().
static void fcm_envelope_new_data | ( | void * | mdata | ) | [static] |
Definition at line 420 of file fmodifier.c.
References FMod_Envelope::max, and FMod_Envelope::min.
static void fcm_envelope_verify | ( | FModifier * | fcm | ) | [static] |
Definition at line 429 of file fmodifier.c.
References FModifier::data, FMod_Envelope::data, and if().
static void fcm_fn_generator_evaluate | ( | FCurve * | UNUSEDfcu, |
FModifier * | fcm, | ||
float * | cvalue, | ||
float | evaltime | ||
) | [static] |
Definition at line 310 of file fmodifier.c.
References FMod_FunctionGenerator::amplitude, cos(), FModifier::data, data, FCM_GENERATOR_ADDITIVE, FCM_GENERATOR_FN_COS, FCM_GENERATOR_FN_LN, FCM_GENERATOR_FN_SIN, FCM_GENERATOR_FN_SINC, FCM_GENERATOR_FN_SQRT, FCM_GENERATOR_FN_TAN, FMod_FunctionGenerator::flag, IS_EQ, log(), M_PI, M_PI_2, NULL, FMod_FunctionGenerator::phase_multiplier, FMod_FunctionGenerator::phase_offset, sin(), sinc(), sqrt(), KDL::tan(), FMod_FunctionGenerator::type, and FMod_FunctionGenerator::value_offset.
static void fcm_fn_generator_new_data | ( | void * | mdata | ) | [static] |
Definition at line 289 of file fmodifier.c.
References FMod_FunctionGenerator::amplitude, data, and FMod_FunctionGenerator::phase_multiplier.
Definition at line 114 of file fmodifier.c.
References FMod_Generator::coefficients, FModifier::data, and MEM_dupallocN().
static void fcm_generator_evaluate | ( | FCurve * | UNUSEDfcu, |
FModifier * | fcm, | ||
float * | cvalue, | ||
float | evaltime | ||
) | [static] |
Definition at line 197 of file fmodifier.c.
References FMod_Generator::arraysize, FMod_Generator::coefficients, FModifier::data, data, FCM_GENERATOR_ADDITIVE, FCM_GENERATOR_POLYNOMIAL, FCM_GENERATOR_POLYNOMIAL_FACTORISED, FMod_Generator::flag, i, if(), MEM_callocN(), MEM_freeN(), FMod_Generator::mode, NULL, and FMod_Generator::poly_order.
static void fcm_generator_free | ( | FModifier * | fcm | ) | [static] |
Definition at line 105 of file fmodifier.c.
References FMod_Generator::coefficients, FModifier::data, data, if(), and MEM_freeN().
static void fcm_generator_new_data | ( | void * | mdata | ) | [static] |
Definition at line 124 of file fmodifier.c.
References FMod_Generator::arraysize, FMod_Generator::coefficients, data, MEM_callocN(), and FMod_Generator::poly_order.
static void fcm_generator_verify | ( | FModifier * | fcm | ) | [static] |
Definition at line 137 of file fmodifier.c.
References FMod_Generator::arraysize, FMod_Generator::coefficients, FModifier::data, data, FCM_GENERATOR_POLYNOMIAL, FCM_GENERATOR_POLYNOMIAL_FACTORISED, MEM_callocN(), MEM_freeN(), FMod_Generator::mode, and FMod_Generator::poly_order.
static void fcm_limits_evaluate | ( | FCurve * | UNUSEDfcu, |
FModifier * | fcm, | ||
float * | cvalue, | ||
float | UNUSEDevaltime | ||
) | [static] |
Definition at line 850 of file fmodifier.c.
References FModifier::data, data, FCM_LIMIT_YMAX, FCM_LIMIT_YMIN, FMod_Limits::flag, if(), FMod_Limits::rect, rctf::ymax, and rctf::ymin.
static float fcm_limits_time | ( | FCurve * | UNUSEDfcu, |
FModifier * | fcm, | ||
float | UNUSEDcvalue, | ||
float | evaltime | ||
) | [static] |
Definition at line 836 of file fmodifier.c.
References FModifier::data, data, FCM_LIMIT_XMAX, FCM_LIMIT_XMIN, FMod_Limits::flag, if(), FMod_Limits::rect, rctf::xmax, and rctf::xmin.
static void fcm_noise_evaluate | ( | FCurve * | UNUSEDfcu, |
FModifier * | fcm, | ||
float * | cvalue, | ||
float | evaltime | ||
) | [static] |
Definition at line 715 of file fmodifier.c.
References BLI_turbulence(), FModifier::data, data, FMod_Noise::depth, FCM_NOISE_MODIF_ADD, FCM_NOISE_MODIF_MULTIPLY, FCM_NOISE_MODIF_REPLACE, FCM_NOISE_MODIF_SUBTRACT, FMod_Noise::modification, noise(), FMod_Noise::phase, FMod_Noise::size, and FMod_Noise::strength.
static void fcm_noise_new_data | ( | void * | mdata | ) | [static] |
Definition at line 703 of file fmodifier.c.
References data, FMod_Noise::depth, FCM_NOISE_MODIF_REPLACE, FMod_Noise::modification, FMod_Noise::phase, FMod_Noise::size, and FMod_Noise::strength.
Definition at line 799 of file fmodifier.c.
References FModifier::data, IDP_CopyProperty(), and FMod_Python::prop.
static void fcm_python_evaluate | ( | FCurve * | UNUSEDfcu, |
FModifier * | UNUSEDfcm, | ||
float * | UNUSEDcvalue, | ||
float | UNUSEDevaltime | ||
) | [static] |
Definition at line 807 of file fmodifier.c.
static void fcm_python_free | ( | FModifier * | fcm | ) | [static] |
Definition at line 781 of file fmodifier.c.
References FModifier::data, data, IDP_FreeProperty(), MEM_freeN(), and FMod_Python::prop.
static void fcm_python_new_data | ( | void * | mdata | ) | [static] |
Definition at line 790 of file fmodifier.c.
References data, IDP_GROUP, MEM_callocN(), FMod_Python::prop, and IDProperty::type.
static void fcm_stepped_new_data | ( | void * | mdata | ) | [static] |
Definition at line 878 of file fmodifier.c.
References data, and FMod_Stepped::step_size.
static float fcm_stepped_time | ( | FCurve * | UNUSEDfcu, |
FModifier * | fcm, | ||
float | UNUSEDcvalue, | ||
float | evaltime | ||
) | [static] |
Definition at line 887 of file fmodifier.c.
References FModifier::data, data, FMod_Stepped::end_frame, FCM_STEPPED_NO_AFTER, FCM_STEPPED_NO_BEFORE, FMod_Stepped::flag, if(), FMod_Stepped::offset, and FMod_Stepped::step_size.
void fcurve_bake_modifiers | ( | FCurve * | fcu, |
int | start, | ||
int | end | ||
) |
Definition at line 1338 of file fmodifier.c.
References FCurve::driver, ELEM, fcurve_samplingcb_evalcurve(), fcurve_store_samples(), ListBase::first, free_fmodifiers(), FCurve::modifiers, and NULL.
Definition at line 1128 of file fmodifier.c.
References ELEM, ListBase::first, FModifier::flag, FMODIFIER_FLAG_ACTIVE, and NULL.
Referenced by ANIM_fmodifiers_copy_to_buf(), and graph_draw_curves().
FModifierTypeInfo* fmodifier_get_typeinfo | ( | FModifier * | fcm | ) |
Definition at line 981 of file fmodifier.c.
References get_fmodifier_typeinfo(), NULL, and FModifier::type.
Referenced by ANIM_uiTemplate_fmodifier_draw(), copy_fmodifier(), copy_fmodifiers(), evaluate_time_fmodifiers(), evaluate_value_fmodifiers(), list_has_suitable_fmodifier(), remove_fmodifier(), validate_fmodifier_cb(), and write_fmodifiers().
static void fmods_init_typeinfo | ( | void | ) | [static] |
Definition at line 939 of file fmodifier.c.
References FMI_CYCLES, FMI_ENVELOPE, FMI_FN_GENERATOR, FMI_GENERATOR, FMI_LIMITS, FMI_NOISE, FMI_PYTHON, FMI_STEPPED, and NULL.
Referenced by get_fmodifier_typeinfo().
void free_fmodifiers | ( | ListBase * | modifiers | ) |
Definition at line 1112 of file fmodifier.c.
References ListBase::first, NULL, and remove_fmodifier().
Referenced by ANIM_fmodifiers_paste_from_buf(), fcurve_bake_modifiers(), free_fcurve(), free_fmodifiers_copybuf(), and free_nlastrip().
FModifierTypeInfo* get_fmodifier_typeinfo | ( | int | type | ) |
Definition at line 956 of file fmodifier.c.
References FMODIFIER_NUM_TYPES, FMODIFIER_TYPE_NULL, fmods_init_typeinfo(), and NULL.
Referenced by add_fmodifier(), fmodifier_get_typeinfo(), graph_fmodifier_add_invoke(), and nla_fmodifier_add_invoke().
short list_has_suitable_fmodifier | ( | ListBase * | modifiers, |
int | mtype, | ||
short | acttype | ||
) |
Definition at line 1168 of file fmodifier.c.
References FModifierTypeInfo::acttype, ELEM, ListBase::first, fmodifier_get_typeinfo(), NULL, and FModifier::type.
Referenced by calculate_fcurve(), delete_action_keys(), delete_graph_keys(), delete_keyframe(), setexpo_action_keys(), and setexpo_graph_keys().
Definition at line 1081 of file fmodifier.c.
References BLI_freelinkN(), FModifier::data, fmodifier_get_typeinfo(), FModifierTypeInfo::free_data, MEM_freeN(), and NULL.
Referenced by delete_fmodifier_cb(), free_fmodifiers(), setexpo_action_keys(), and setexpo_graph_keys().
Definition at line 1147 of file fmodifier.c.
References ELEM, ListBase::first, FModifier::flag, FMODIFIER_FLAG_ACTIVE, and NULL.
Referenced by graph_fmodifier_add_exec(), and nla_fmodifier_add_exec().
static double sinc | ( | double | x | ) | [static] |
Definition at line 302 of file fmodifier.c.
References fabs(), M_PI, and sin().
Referenced by fcm_fn_generator_evaluate().
FModifierTypeInfo FMI_CYCLES [static] |
{ FMODIFIER_TYPE_CYCLES, sizeof(FMod_Cycles), FMI_TYPE_EXTRAPOLATION, FMI_REQUIRES_ORIGINAL_DATA, "Cycles", "FMod_Cycles", NULL, NULL, fcm_cycles_new_data, NULL , fcm_cycles_time, fcm_cycles_evaluate }
Definition at line 686 of file fmodifier.c.
Referenced by fmods_init_typeinfo().
FModifierTypeInfo FMI_ENVELOPE [static] |
{ FMODIFIER_TYPE_ENVELOPE, sizeof(FMod_Envelope), FMI_TYPE_REPLACE_VALUES, 0, "Envelope", "FMod_Envelope", fcm_envelope_free, fcm_envelope_copy, fcm_envelope_new_data, fcm_envelope_verify, NULL, fcm_envelope_evaluate }
Definition at line 491 of file fmodifier.c.
Referenced by fmods_init_typeinfo().
FModifierTypeInfo FMI_FN_GENERATOR [static] |
{ FMODIFIER_TYPE_FN_GENERATOR, sizeof(FMod_FunctionGenerator), FMI_TYPE_GENERATE_CURVE, FMI_REQUIRES_NOTHING, "Built-In Function", "FMod_FunctionGenerator", NULL, NULL, fcm_fn_generator_new_data, NULL, NULL, fcm_fn_generator_evaluate }
Definition at line 384 of file fmodifier.c.
Referenced by fmods_init_typeinfo().
FModifierTypeInfo FMI_GENERATOR [static] |
{ FMODIFIER_TYPE_GENERATOR, sizeof(FMod_Generator), FMI_TYPE_GENERATE_CURVE, FMI_REQUIRES_NOTHING, "Generator", "FMod_Generator", fcm_generator_free, fcm_generator_copy, fcm_generator_new_data, fcm_generator_verify, NULL, fcm_generator_evaluate }
Definition at line 262 of file fmodifier.c.
Referenced by fmods_init_typeinfo().
short FMI_INIT = 1 [static] |
Definition at line 936 of file fmodifier.c.
FModifierTypeInfo FMI_LIMITS [static] |
{ FMODIFIER_TYPE_LIMITS, sizeof(FMod_Limits), FMI_TYPE_GENERATE_CURVE, FMI_REQUIRES_RUNTIME_CHECK, "Limits", "FMod_Limits", NULL, NULL, NULL, NULL, fcm_limits_time, fcm_limits_evaluate }
Definition at line 861 of file fmodifier.c.
Referenced by fmods_init_typeinfo().
FModifierTypeInfo FMI_NOISE [static] |
{ FMODIFIER_TYPE_NOISE, sizeof(FMod_Noise), FMI_TYPE_REPLACE_VALUES, 0, "Noise", "FMod_Noise", NULL, NULL, fcm_noise_new_data, NULL , NULL, fcm_noise_evaluate }
Definition at line 744 of file fmodifier.c.
Referenced by fmods_init_typeinfo().
FModifierTypeInfo FMI_PYTHON [static] |
{ FMODIFIER_TYPE_PYTHON, sizeof(FMod_Python), FMI_TYPE_GENERATE_CURVE, FMI_REQUIRES_RUNTIME_CHECK, "Python", "FMod_Python", fcm_python_free, fcm_python_copy, fcm_python_new_data, NULL , NULL , fcm_python_evaluate }
Definition at line 818 of file fmodifier.c.
Referenced by fmods_init_typeinfo().
FModifierTypeInfo FMI_STEPPED [static] |
{ FMODIFIER_TYPE_STEPPED, sizeof(FMod_Limits), FMI_TYPE_GENERATE_CURVE, FMI_REQUIRES_RUNTIME_CHECK, "Stepped", "FMod_Stepped", NULL, NULL, fcm_stepped_new_data, NULL, fcm_stepped_time, NULL }
Definition at line 914 of file fmodifier.c.
Referenced by fmods_init_typeinfo().
FModifierTypeInfo* fmodifiersTypeInfo[FMODIFIER_NUM_TYPES] [static] |
Definition at line 935 of file fmodifier.c.