|
Blender V4.3
|
#include <algorithm>#include <cfloat>#include <cmath>#include <cstddef>#include <cstdio>#include <cstring>#include "MEM_guardedalloc.h"#include "CLG_log.h"#include "DNA_anim_types.h"#include "DNA_screen_types.h"#include "BLT_translation.hh"#include "BLI_blenlib.h"#include "BLI_ghash.h"#include "BLI_math_base.h"#include "BLI_noise.h"#include "BLI_utildefines.h"#include "BKE_fcurve.hh"#include "BKE_idprop.hh"Go to the source code of this file.
Classes | |
| struct | tFCMED_Cycles |
Variables | |
| static CLG_LogRef | LOG = {"bke.fmodifier"} |
F-Curve Modifier Type API | |
all of the f-curve modifier api functions use #fmodifiertypeinfo structs to carry out and operations that involve f-curve modifier specific code. | |
| static FModifierTypeInfo * | fmodifiersTypeInfo [FMODIFIER_NUM_TYPES] |
| static short | FMI_INIT = 1 |
| static void | fmods_init_typeinfo () |
| const FModifierTypeInfo * | get_fmodifier_typeinfo (const int type) |
| const FModifierTypeInfo * | fmodifier_get_typeinfo (const FModifier *fcm) |
| #define BINARYSEARCH_FRAMEEQ_THRESH 0.0001f |
Definition at line 506 of file fmodifier.cc.
Referenced by BKE_fcm_envelope_find_index().
Add a new F-Curve Modifier to the given F-Curve of a certain type.
Definition at line 1052 of file fmodifier.cc.
References BKE_fcurve_handles_recalc(), BKE_fmodifier_name_set(), BLI_addtail(), BLI_listbase_is_single(), CLOG_STR_ERROR, FModifier::curve, FModifier::data, ELEM, ListBase::first, FModifier::flag, FMODIFIER_FLAG_ACTIVE, FMODIFIER_TYPE_CYCLES, get_fmodifier_typeinfo(), FModifier::influence, LOG, MEM_callocN, FModifierTypeInfo::new_data, FModifierTypeInfo::size, FModifierTypeInfo::struct_name, FModifier::type, FModifier::ui_expand_flag, and UI_PANEL_DATA_EXPAND_ROOT.
Referenced by alloc_driver_fcurve(), blender::ed::object::followpath_path_animate_exec(), graph_fmodifier_add_exec(), icu_to_fcurves(), blender::animrig::make_new_fcurve_cyclic(), nla_fmodifier_add_exec(), blender::ed::object::parent_set(), setexpo_action_keys(), setexpo_graph_keys(), and blender::animrig::tests::TEST_F().
| int BKE_fcm_envelope_find_index | ( | FCM_EnvelopeData | array[], |
| float | frame, | ||
| int | arraylen, | ||
| bool * | r_exists ) |
Definition at line 508 of file fmodifier.cc.
References BINARYSEARCH_FRAMEEQ_THRESH, CLOG_ERROR, CLOG_WARN, IS_EQT, and LOG.
Make a copy of the specified F-Modifier.
Definition at line 1105 of file fmodifier.cc.
References FModifierTypeInfo::copy_data, FModifier::curve, FModifier::data, fmodifier_get_typeinfo(), MEM_dupallocN, FModifier::next, and FModifier::prev.
Referenced by ANIM_fmodifiers_copy_to_buf(), and ANIM_fmodifiers_paste_from_buf().
Duplicate all of the F-Modifiers in the Modifier stacks.
Definition at line 1132 of file fmodifier.cc.
References BLI_duplicatelist(), BLI_listbase_clear(), FModifierTypeInfo::copy_data, FModifier::curve, FModifier::data, ELEM, ListBase::first, fmodifier_get_typeinfo(), MEM_dupallocN, and FModifier::next.
Referenced by ANIM_fmodifiers_copy_to_buf(), ANIM_paste_driver(), BKE_fcurve_copy(), and BKE_nlastrip_copy().
Helper function - calculate influence of FModifier.
Definition at line 1314 of file fmodifier.cc.
References b, FModifier::blendin, FModifier::blendout, FModifier::efra, evaltime, FModifier::flag, FMODIFIER_FLAG_RANGERESTRICT, FMODIFIER_FLAG_USEINFLUENCE, FModifier::influence, and FModifier::sfra.
Referenced by evaluate_time_fmodifiers(), and evaluate_value_fmodifiers().
Definition at line 1289 of file fmodifier.cc.
References ELEM, ListBase::first, fmodifier_get_typeinfo(), LISTBASE_FOREACH, and FModifierTypeInfo::storage_size.
Referenced by evaluate_fcurve_ex(), and nlasnapshot_from_action().
| float evaluate_time_fmodifiers | ( | FModifiersStackStorage * | storage, |
| const ListBase * | modifiers, | ||
| const FCurve * | fcu, | ||
| float | cvalue, | ||
| float | evaltime ) |
Evaluate time modifications imposed by some F-Curve Modifiers.
| fcu | Can be NULL. |
Definition at line 1361 of file fmodifier.cc.
References FModifiersStackStorage::buffer, ELEM, eval_fmodifier_influence(), evaltime, FModifierTypeInfo::evaluate_modifier_time, FCURVE_MOD_OFF, FCurve::flag, FMODIFIER_FLAG_DISABLED, FMODIFIER_FLAG_MUTED, FMODIFIER_FLAG_RANGERESTRICT, fmodifier_get_typeinfo(), interpf(), ListBase::last, FModifiersStackStorage::modifier_count, POINTER_OFFSET, and FModifiersStackStorage::size_per_modifier.
Referenced by evaluate_fcurve_ex(), and nlasnapshot_from_action().
| void evaluate_value_fmodifiers | ( | FModifiersStackStorage * | storage, |
| const ListBase * | modifiers, | ||
| const FCurve * | fcu, | ||
| float * | cvalue, | ||
| float | evaltime ) |
Evaluates the given set of F-Curve Modifiers using the given data Should only be called after evaluate_time_fmodifiers() has been called.
Definition at line 1421 of file fmodifier.cc.
References FModifiersStackStorage::buffer, FModifier::efra, ELEM, eval_fmodifier_influence(), evaltime, FModifierTypeInfo::evaluate_modifier, FCURVE_MOD_OFF, ListBase::first, FCurve::flag, FModifier::flag, FMODIFIER_FLAG_DISABLED, FMODIFIER_FLAG_MUTED, FMODIFIER_FLAG_RANGERESTRICT, fmodifier_get_typeinfo(), interpf(), FModifier::next, POINTER_OFFSET, FModifier::sfra, and FModifiersStackStorage::size_per_modifier.
Referenced by evaluate_fcurve_ex(), and nlasnapshot_from_action().
|
static |
Definition at line 772 of file fmodifier.cc.
References tFCMED_Cycles::cycyofs.
|
static |
Definition at line 614 of file fmodifier.cc.
References FMod_Cycles::before_mode, and FCM_EXTRAPOLATE_CYCLIC.
|
static |
Definition at line 622 of file fmodifier.cc.
References FCurve::bezt, BLI_assert, ceil(), tFCMED_Cycles::cycyofs, FModifier::data, double(), ELEM, evaltime, FCM_EXTRAPOLATE_CYCLIC_OFFSET, FCM_EXTRAPOLATE_MIRROR, float, floor(), fmod(), FCurve::fpt, int, FModifier::prev, FCurve::totvert, BezTriple::vec, and FPoint::vec.
Definition at line 397 of file fmodifier.cc.
References FMod_Envelope::data, FModifier::data, and MEM_dupallocN.
|
static |
Definition at line 427 of file fmodifier.cc.
References FMod_Envelope::data, FModifier::data, diff(), evaltime, FCM_EnvelopeData::max, FMod_Envelope::max, FMod_Envelope::midval, FCM_EnvelopeData::min, FMod_Envelope::min, min, FCM_EnvelopeData::time, and FMod_Envelope::totvert.
|
static |
Definition at line 387 of file fmodifier.cc.
References FMod_Envelope::data, FModifier::data, and MEM_freeN().
|
static |
Definition at line 408 of file fmodifier.cc.
References FMod_Envelope::max, and FMod_Envelope::min.
|
static |
Definition at line 417 of file fmodifier.cc.
References FMod_Envelope::data, and FModifier::data.
|
static |
Definition at line 286 of file fmodifier.cc.
References CLOG_ERROR, cos(), FModifier::data, double(), evaltime, 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, float, fmod(), IS_EQ, LOG, log(), M_PI, M_PI_2, sinc(), sqrt(), CLG_LogRef::type, and v.
|
static |
Definition at line 264 of file fmodifier.cc.
References FMod_FunctionGenerator::amplitude.
Definition at line 102 of file fmodifier.cc.
References FMod_Generator::coefficients, FModifier::data, and MEM_dupallocN.
|
static |
Definition at line 158 of file fmodifier.cc.
References FModifier::data, evaltime, FCM_GENERATOR_ADDITIVE, FCM_GENERATOR_POLYNOMIAL, FCM_GENERATOR_POLYNOMIAL_FACTORISED, MEM_callocN, and MEM_freeN().
|
static |
Definition at line 92 of file fmodifier.cc.
References FModifier::data, and MEM_freeN().
|
static |
Definition at line 113 of file fmodifier.cc.
References MEM_callocN, and FMod_Generator::poly_order.
|
static |
Definition at line 127 of file fmodifier.cc.
References FModifier::data, FCM_GENERATOR_POLYNOMIAL, FCM_GENERATOR_POLYNOMIAL_FACTORISED, and MEM_recallocN.
|
static |
Definition at line 885 of file fmodifier.cc.
References FModifier::data, FCM_LIMIT_YMAX, and FCM_LIMIT_YMIN.
|
static |
Definition at line 865 of file fmodifier.cc.
References FModifier::data, evaltime, FCM_LIMIT_XMAX, and FCM_LIMIT_XMIN.
|
static |
Definition at line 813 of file fmodifier.cc.
References BLI_noise_turbulence(), FModifier::data, evaltime, FCM_NOISE_MODIF_ADD, FCM_NOISE_MODIF_MULTIPLY, FCM_NOISE_MODIF_REPLACE, FCM_NOISE_MODIF_SUBTRACT, and noise.
|
static |
Definition at line 800 of file fmodifier.cc.
References FCM_NOISE_MODIF_REPLACE, and FMod_Noise::size.
|
static |
Definition at line 920 of file fmodifier.cc.
References FMod_Stepped::step_size.
|
static |
Definition at line 929 of file fmodifier.cc.
References FModifier::data, evaltime, FCM_STEPPED_NO_AFTER, FCM_STEPPED_NO_BEFORE, and int.
Bake modifiers for given F-Curve to curve sample data, in the frame range defined by start and end (inclusive).
Definition at line 1470 of file fmodifier.cc.
References CLOG_ERROR, FCurve::driver, ELEM, fcurve_samplingcb_evalcurve(), fcurve_store_samples(), ListBase::first, free_fmodifiers(), LOG, and FCurve::modifiers.
Find the active F-Modifier.
Definition at line 1216 of file fmodifier.cc.
References ELEM, ListBase::first, FMODIFIER_FLAG_ACTIVE, and LISTBASE_FOREACH.
Referenced by ANIM_fmodifiers_copy_to_buf(), and draw_fcurve().
| const FModifierTypeInfo * fmodifier_get_typeinfo | ( | const FModifier * | fcm | ) |
This function should always be used to get the appropriate type-info, as it has checks which prevent segfaults in some weird cases.
Definition at line 1036 of file fmodifier.cc.
References get_fmodifier_typeinfo(), and FModifier::type.
Referenced by BKE_fmodifiers_blend_read_data(), BKE_fmodifiers_blend_write(), copy_fmodifier(), copy_fmodifiers(), evaluate_fmodifiers_storage_size_per_modifier(), evaluate_time_fmodifiers(), evaluate_value_fmodifiers(), fmodifier_panel_header(), list_has_suitable_fmodifier(), and remove_fmodifier().
|
static |
This function only gets called when FMI_INIT is non-zero.
Definition at line 992 of file fmodifier.cc.
References BLI_assert_msg, FMI_CYCLES, FMI_ENVELOPE, FMI_FN_GENERATOR, FMI_GENERATOR, FMI_LIMITS, FMI_NOISE, FMI_STEPPED, FMODIFIER_NUM_TYPES, FMODIFIER_TYPE_CYCLES, FMODIFIER_TYPE_ENVELOPE, FMODIFIER_TYPE_FILTER, FMODIFIER_TYPE_FN_GENERATOR, FMODIFIER_TYPE_GENERATOR, FMODIFIER_TYPE_LIMITS, FMODIFIER_TYPE_NOISE, FMODIFIER_TYPE_NULL, FMODIFIER_TYPE_PYTHON, FMODIFIER_TYPE_STEPPED, and fmodifiersTypeInfo.
Referenced by get_fmodifier_typeinfo().
| void free_fmodifiers | ( | ListBase * | modifiers | ) |
Remove all of a given F-Curve's modifiers.
Definition at line 1200 of file fmodifier.cc.
References ListBase::first, FModifier::next, and remove_fmodifier().
Referenced by ANIM_fmodifiers_copybuf_free(), ANIM_fmodifiers_paste_from_buf(), BKE_fcurve_free(), BKE_nlastrip_free(), channels_bake_exec(), and fcurve_bake_modifiers().
| const FModifierTypeInfo * get_fmodifier_typeinfo | ( | int | type | ) |
This function should be used for getting the appropriate type-info when only a F-Curve modifier type is known.
Definition at line 1017 of file fmodifier.cc.
References CLOG_ERROR, FMI_INIT, FMODIFIER_NUM_TYPES, FMODIFIER_TYPE_NULL, fmodifiersTypeInfo, fmods_init_typeinfo(), and LOG.
Referenced by add_fmodifier(), BKE_fmodifier_name_set(), fmodifier_get_typeinfo(), fmodifier_panel_register(), fmodifier_reorder(), graph_fmodifier_itemf(), graph_fmodifier_panel_id(), nla_fmodifier_itemf(), and nla_fmodifier_panel_id().
Do we have any modifiers which match certain criteria.
| mtype | Type of modifier (if 0, doesn't matter). |
| acttype | Type of action to perform (if -1, doesn't matter). |
Definition at line 1252 of file fmodifier.cc.
References FModifierTypeInfo::acttype, ELEM, ListBase::first, fmodifier_get_typeinfo(), and LISTBASE_FOREACH.
Referenced by BKE_fcurve_is_empty(), setexpo_action_keys(), and setexpo_graph_keys().
Remove and free the given F-Modifier from the given stack.
Definition at line 1160 of file fmodifier.cc.
References BKE_fcurve_handles_recalc(), BLI_freelinkN(), CLOG_STR_ERROR, FModifier::curve, FModifier::data, fmodifier_get_typeinfo(), FMODIFIER_TYPE_CYCLES, FModifierTypeInfo::free_data, LOG, MEM_freeN(), and FModifier::type.
Referenced by delete_fmodifier_cb(), free_fmodifiers(), setexpo_action_keys(), and setexpo_graph_keys().
Set the active F-Modifier.
Definition at line 1234 of file fmodifier.cc.
References ELEM, ListBase::first, FModifier::flag, FMODIFIER_FLAG_ACTIVE, and LISTBASE_FOREACH.
Referenced by graph_fmodifier_add_exec(), and nla_fmodifier_add_exec().
Definition at line 277 of file fmodifier.cc.
References fabs(), M_PI, and x.
Referenced by fcm_fn_generator_evaluate().
|
static |
Definition at line 782 of file fmodifier.cc.
Referenced by fmods_init_typeinfo().
|
static |
Definition at line 485 of file fmodifier.cc.
Referenced by fmods_init_typeinfo().
|
static |
Definition at line 369 of file fmodifier.cc.
Referenced by fmods_init_typeinfo().
|
static |
Definition at line 236 of file fmodifier.cc.
Referenced by fmods_init_typeinfo().
|
static |
Definition at line 989 of file fmodifier.cc.
Referenced by get_fmodifier_typeinfo().
|
static |
Definition at line 902 of file fmodifier.cc.
Referenced by fmods_init_typeinfo().
|
static |
Definition at line 847 of file fmodifier.cc.
Referenced by fmods_init_typeinfo().
|
static |
Definition at line 962 of file fmodifier.cc.
Referenced by fmods_init_typeinfo().
|
static |
Definition at line 988 of file fmodifier.cc.
Referenced by fmods_init_typeinfo(), and get_fmodifier_typeinfo().
|
static |
Definition at line 34 of file fmodifier.cc.
Referenced by add_fmodifier(), BKE_fcm_envelope_find_index(), fcm_fn_generator_evaluate(), fcurve_bake_modifiers(), get_fmodifier_typeinfo(), and remove_fmodifier().