Blender
V3.3
|
#include <float.h>
#include <math.h>
#include <stddef.h>
#include <stdio.h>
#include <string.h>
#include "MEM_guardedalloc.h"
#include "DNA_anim_types.h"
#include "DNA_object_types.h"
#include "DNA_text_types.h"
#include "BLI_blenlib.h"
#include "BLI_easing.h"
#include "BLI_ghash.h"
#include "BLI_math.h"
#include "BLI_sort_utils.h"
#include "BKE_anim_data.h"
#include "BKE_animsys.h"
#include "BKE_context.h"
#include "BKE_curve.h"
#include "BKE_fcurve.h"
#include "BKE_fcurve_driver.h"
#include "BKE_global.h"
#include "BKE_idprop.h"
#include "BKE_lib_query.h"
#include "BKE_nla.h"
#include "BLO_read_write.h"
#include "RNA_access.h"
#include "RNA_path.h"
#include "CLG_log.h"
Go to the source code of this file.
Macros | |
#define | SMALL -1.0e-10 |
#define | SELECT 1 |
Variables | |
static CLG_LogRef | LOG = {"bke.fcurve"} |
Definition at line 1578 of file fcurve.c.
References Freestyle::a, usdtokens::b(), and t.
Referenced by fcurve_eval_keyframes_interpolate().
|
static |
Definition at line 990 of file fcurve.c.
References BEZT_BINARYSEARCH_THRESH, BLI_addtail(), BLI_insertlinkbefore(), CfraElem::cfra, IS_EQT, MEM_callocN, CfraElem::next, CfraElem::sel, and SELECT.
FCurve* BKE_animadata_fcurve_find_by_rna_path | ( | struct AnimData * | animdata, |
const char * | rna_path, | ||
const int | rna_index, | ||
struct bAction ** | r_action, | ||
bool * | r_driven | ||
) |
Find an F-Curve from its rna path and index.
If there is an action assigned to the animdata
, it will be searched for a matching F-curve first. Drivers are searched only if no valid action F-curve could be found.
will not match any F-Curve on an Object, but
rna_path='location', rna_index=0` will if it exists).r_action
, r_driven
and r_special
) are all optional and may be NULL. Definition at line 339 of file fcurve.c.
References AnimData::action, BKE_fcurve_find(), BLI_listbase_is_empty(), bAction::curves, AnimData::drivers, and NULL.
Referenced by BKE_fcurve_find_by_rna_context_ui(), BKE_lib_override_library_property_is_animated(), and id_data_find_fcurve().
int BKE_fcurve_active_keyframe_index | ( | const FCurve * | fcu | ) |
Definition at line 870 of file fcurve.c.
References FCurve::active_keyframe_index, FCurve::bezt, BezTriple::f1, BezTriple::f2, BezTriple::f3, FCURVE_ACTIVE_KEYFRAME_NONE, NULL, SELECT, and FCurve::totvert.
Definition at line 849 of file fcurve.c.
References FCurve::active_keyframe_index, FCurve::bezt, BEZT_ISSEL_ANY, BLI_assert_msg, FCURVE_ACTIVE_KEYFRAME_NONE, NULL, offset, and FCurve::totvert.
Referenced by BKE_fcurve_delete_keys_selected().
Are keyframes on F-Curve of any use (to final result, and to show in editors)? Usability of keyframes refers to whether they should be displayed, and also whether they will have any influence on the final result.
Definition at line 903 of file fcurve.c.
References data, FModifier::data, FCM_GENERATOR_ADDITIVE, ListBase::first, FModifier::flag, FMODIFIER_FLAG_DISABLED, FMODIFIER_FLAG_MUTED, FMODIFIER_TYPE_CYCLES, FMODIFIER_TYPE_FN_GENERATOR, FMODIFIER_TYPE_GENERATOR, FMODIFIER_TYPE_NOISE, FMODIFIER_TYPE_STEPPED, FCurve::fpt, if(), ListBase::last, FCurve::modifiers, NULL, FModifier::prev, and FModifier::type.
Referenced by BKE_fcurve_is_keyframable(), draw_fcurve(), and graphop_visible_keyframes_poll().
int BKE_fcurve_bezt_binarysearch_index | ( | const struct BezTriple | array[], |
float | frame, | ||
int | arraylen, | ||
bool * | r_replace | ||
) |
Binary search algorithm for finding where to 'insert' BezTriple with given frame number. Returns the index to insert at (data already at that index will be offset if replace is 0)
Definition at line 561 of file fcurve.c.
References BEZT_BINARYSEARCH_THRESH, and BKE_fcurve_bezt_binarysearch_index_ex().
Referenced by delete_key_button_exec(), delete_keyframe_fcurve(), fcurve_frame_has_keyframe(), gather_frames_to_render_for_adt(), insert_bezt_fcurve(), pose_propagate_fcurve(), and pyrna_struct_keyframe_delete().
|
static |
Definition at line 474 of file fcurve.c.
References CLOG_ERROR, CLOG_WARN, IS_EQT, LOG, NULL, and threshold.
Referenced by BKE_fcurve_bezt_binarysearch_index(), and fcurve_eval_keyframes_interpolate().
bool BKE_fcurve_bezt_subdivide_handles | ( | struct BezTriple * | bezt, |
struct BezTriple * | prev, | ||
struct BezTriple * | next, | ||
float * | r_pdelta | ||
) |
Recompute bezier handles of all three given BezTriples, so that bezt
can be inserted between prev
and next
without changing the resulting curve shape.
r_pdelta | return Y difference between bezt and the original curve value at its X position. |
Definition at line 1600 of file fcurve.c.
References add_v2_v2v2(), BKE_fcurve_correct_bezpart(), copy_v2_v2(), findzero(), interp_v2_v2v2(), next, blender::meshintersect::prev(), sub_v2_v2v2(), t, and BezTriple::vec.
Referenced by subdivide_nonauto_handles(), and blender::bke::tests::TEST().
void BKE_fcurve_blend_read_data | ( | BlendDataReader * | reader, |
ListBase * | fcurves | ||
) |
Definition at line 2383 of file fcurve.c.
References FCurve::bezt, BKE_fmodifiers_blend_read_data(), BLO_read_data_address, BLO_read_list(), FCurve::driver, DRIVER_FLAG_INVALID, DRIVER_TARGETS_LOOPER_BEGIN, DRIVER_TARGETS_LOOPER_END, ChannelDriver::expr_comp, ChannelDriver::expr_simple, FCURVE_DISABLED, ChannelDriver::flag, FCurve::flag, FCurve::fpt, FCurve::grp, LISTBASE_FOREACH, FCurve::modifiers, NULL, FCurve::rna_path, and ChannelDriver::variables.
Referenced by action_blend_read_data(), BKE_animdata_blend_read_data(), and blend_data_read_nla_strips().
void BKE_fcurve_blend_read_expand | ( | BlendExpander * | expander, |
ListBase * | fcurves | ||
) |
Definition at line 2468 of file fcurve.c.
References BKE_fmodifiers_blend_read_expand(), BLO_expand, FCurve::driver, DRIVER_TARGETS_LOOPER_BEGIN, DRIVER_TARGETS_LOOPER_END, LISTBASE_FOREACH, FCurve::modifiers, and ChannelDriver::variables.
Referenced by action_blend_read_expand(), BKE_animdata_blend_read_expand(), and blend_read_expand_nla_strips().
void BKE_fcurve_blend_read_lib | ( | BlendLibReader * | reader, |
ID * | id, | ||
ListBase * | fcurves | ||
) |
Definition at line 2438 of file fcurve.c.
References BKE_fmodifiers_blend_read_lib(), BLO_read_id_address, FCurve::driver, DRIVER_TARGETS_LOOPER_BEGIN, DRIVER_TARGETS_LOOPER_END, id, Library::id, ID::lib, LISTBASE_FOREACH, FCurve::modifiers, NULL, and ChannelDriver::variables.
Referenced by action_blend_read_lib(), BKE_animdata_blend_read_lib(), and blend_lib_read_nla_strips().
void BKE_fcurve_blend_write | ( | BlendWriter * | writer, |
ListBase * | fcurves | ||
) |
Definition at line 2344 of file fcurve.c.
References FCurve::bezt, BKE_fmodifiers_blend_write(), BLO_write_string(), BLO_write_struct, BLO_write_struct_array, BLO_write_struct_list, FCurve::driver, DRIVER_TARGETS_LOOPER_END, DRIVER_TARGETS_USED_LOOPER_BEGIN, FCurve::fpt, LISTBASE_FOREACH, FCurve::modifiers, FCurve::rna_path, FCurve::totvert, and ChannelDriver::variables.
Referenced by action_blend_write(), BKE_animdata_blend_write(), and blend_write_nla_strips().
bool BKE_fcurve_calc_bounds | ( | struct FCurve * | fcu, |
float * | xmin, | ||
float * | xmax, | ||
float * | ymin, | ||
float * | ymax, | ||
bool | do_sel_only, | ||
bool | include_handles | ||
) |
Calculate the extents of F-Curve's data.
Definition at line 624 of file fcurve.c.
References FCurve::bezt, BEZT_IPO_BEZ, BEZT_ISSEL_ANY, BLI_assert, FCurve::fpt, G, G_DEBUG, get_fcurve_end_keyframes(), BezTriple::ipo, max_ff(), max_fff(), min_ff(), min_fff(), NULL, FCurve::totvert, FPoint::vec, and BezTriple::vec.
bool BKE_fcurve_calc_range | ( | struct FCurve * | fcu, |
float * | min, | ||
float * | max, | ||
bool | do_sel_only, | ||
bool | do_min_length | ||
) |
Calculate the extents of F-Curve's keyframes.
Definition at line 754 of file fcurve.c.
References FCurve::bezt, BLI_assert, FCurve::fpt, get_fcurve_end_keyframes(), max, max_ff(), min, min_ff(), NULL, FCurve::totvert, FPoint::vec, and BezTriple::vec.
Referenced by calc_action_range(), draw_fcurve_curve(), and get_keyframe_extents().
Definition at line 114 of file fcurve.c.
References FCurve::bezt, copy_fmodifiers(), FCurve::driver, fcurve_copy_driver(), FCurve::fpt, FCurve::grp, MEM_dupallocN, FCurve::modifiers, FCurve::next, NULL, FCurve::prev, and FCurve::rna_path.
Referenced by BKE_fcurves_copy().
The length of each handle is not allowed to be more than the horizontal distance between (v1-v4). This is to prevent curve loops.
This function is very similar to BKE_curve_correct_bezpart(), but allows a steeper tangent for more snappy animations. This is not desired for other areas in which curves are used, though.
Definition at line 1410 of file fcurve.c.
References fabsf, len, v1, and v2.
Referenced by BKE_fcurve_bezt_subdivide_handles(), draw_fcurve_curve_bezts(), fcurve_eval_keyframes_interpolate(), and normalization_factor_get().
Definition at line 53 of file fcurve.c.
References MEM_callocN.
Referenced by alloc_driver_fcurve(), BKE_nlastrip_validate_fcurves(), blender::editor::animation::tests::create_test_keylist(), ED_action_fcurve_ensure(), icu_to_fcurves(), and blender::bke::tests::TEST().
Delete a keyframe from an F-curve at a specific index.
Definition at line 1661 of file fcurve.c.
References blender::math::abs(), FCurve::bezt, fcurve_bezt_free(), NULL, and FCurve::totvert.
Referenced by delete_key_button_exec(), delete_keyframe_fcurve(), insert_keyframe_value(), poselib_remove_exec(), posttrans_fcurve_clean(), and pyrna_struct_keyframe_delete().
Delete all keyframes from an F-curve.
Definition at line 1719 of file fcurve.c.
References fcurve_bezt_free().
Referenced by clean_fcurve(), and paste_animedit_keys_fcurve().
Delete selected keyframes from an F-curve.
Definition at line 1690 of file fcurve.c.
References FCurve::active_keyframe_index, FCurve::bezt, BKE_fcurve_active_keyframe_set(), BezTriple::f2, fcurve_bezt_free(), NULL, SELECT, and FCurve::totvert.
Referenced by delete_action_keys(), delete_graph_keys(), and paste_animedit_keys_fcurve().
Find the F-Curve affecting the given RNA-access path + index, in the list of F-Curves provided.
Definition at line 249 of file fcurve.c.
References FCurve::array_index, ELEM, ListBase::first, FCurve::next, NULL, FCurve::rna_path, STREQ, and UNLIKELY.
Referenced by BKE_animadata_fcurve_find_by_rna_path(), BKE_fcurve_find_by_rna_context_ui(), BKE_nlastrip_validate_fcurves(), delete_key_button_exec(), ED_action_fcurve_ensure(), ED_action_fcurve_find(), followpath_path_animate_exec(), insert_key_button_exec(), make_new_animlistelem(), nla_draw_strip_curves(), pyrna_struct_driver_add(), pyrna_struct_keyframe_delete(), pyrna_struct_keyframe_insert(), seq_convert_transform_animation(), seq_convert_transform_animation_2(), seq_speed_factor_fix_rna_path(), and verify_driver_fcurve().
FCurve* BKE_fcurve_find_by_rna | ( | struct PointerRNA * | ptr, |
struct PropertyRNA * | prop, | ||
int | rnaindex, | ||
struct AnimData ** | r_adt, | ||
struct bAction ** | r_action, | ||
bool * | r_driven, | ||
bool * | r_special | ||
) |
Find an f-curve based on an rna property.
Definition at line 380 of file fcurve.c.
References BKE_fcurve_find_by_rna_context_ui(), NULL, and ptr.
Referenced by RNA_property_animated().
FCurve* BKE_fcurve_find_by_rna_context_ui | ( | bContext * | UNUSEDC, |
const PointerRNA * | ptr, | ||
PropertyRNA * | prop, | ||
int | rnaindex, | ||
AnimData ** | r_animdata, | ||
bAction ** | r_action, | ||
bool * | r_driven, | ||
bool * | r_special | ||
) |
Definition at line 392 of file fcurve.c.
References BKE_animadata_fcurve_find_by_rna_path(), BKE_animdata_from_id(), BKE_fcurve_find(), BKE_nlastrip_has_curves_for_property(), PointerRNA::data, NlaStrip::fcurves, MEM_freeN, NULL, PointerRNA::owner_id, ptr, RNA_path_from_ID_to_property(), RNA_property_animateable(), and RNA_property_identifier().
Referenced by BKE_fcurve_find_by_rna().
void BKE_fcurve_foreach_id | ( | struct FCurve * | fcu, |
struct LibraryForeachIDData * | data | ||
) |
Callback used by lib_query to walk over all ID usages (mimics foreach_id
callback of IDTypeInfo structure).
Definition at line 165 of file fcurve.c.
References BKE_LIB_FOREACHID_PROCESS_FUNCTION_CALL, BKE_LIB_FOREACHID_PROCESS_ID, BKE_LIB_FOREACHID_PROCESS_IDSUPER, BKE_lib_query_idpropertiesForeachIDLink_callback(), data, FCurve::driver, DRIVER_TARGETS_LOOPER_END, DRIVER_TARGETS_USED_LOOPER_BEGIN, FMODIFIER_TYPE_PYTHON, IDP_foreach_property(), IDP_TYPE_FILTER_ID, IDWALK_CB_NOP, LISTBASE_FOREACH, FCurve::modifiers, NULL, FMod_Python::prop, FMod_Python::script, and ChannelDriver::variables.
Referenced by action_foreach_id(), BKE_animdata_foreach_id(), and BKE_nla_strip_foreach_id().
Frees the F-Curve itself too, so make sure BLI_remlink is called before calling this.
Definition at line 65 of file fcurve.c.
References FCurve::bezt, fcurve_free_driver(), FCurve::fpt, free_fmodifiers(), MEM_freeN, MEM_SAFE_FREE, FCurve::modifiers, NULL, and FCurve::rna_path.
Referenced by ANIM_drivers_copybuf_free(), ANIM_fcurve_delete_from_animdata(), ANIM_remove_driver(), animchannels_delete_exec(), BKE_action_fcurves_clear(), BKE_fcurves_free(), blender::editor::animation::tests::create_test_keylist(), fcurve_path_rename(), fcurve_remove(), fcurves_path_remove_fix(), remove_sequencer_fcurves(), SEQ_clipboard_free(), seq_convert_transform_animation(), SEQ_free_animdata(), blender::bke::tests::TEST(), and AnimationImporter::~AnimationImporter().
eFCU_Cycle_Type BKE_fcurve_get_cycle_type | ( | struct FCurve * | fcu | ) |
Checks if the F-Curve has a Cycles modifier, and returns the type of the cycle behavior.
Definition at line 1159 of file fcurve.c.
References data, FModifier::data, ELEM, FCM_EXTRAPOLATE_CYCLIC, FCM_EXTRAPOLATE_CYCLIC_OFFSET, FCU_CYCLE_NONE, FCU_CYCLE_OFFSET, FCU_CYCLE_PERFECT, ListBase::first, FModifier::flag, FMODIFIER_FLAG_DISABLED, FMODIFIER_FLAG_MUTED, FMODIFIER_FLAG_RANGERESTRICT, FMODIFIER_FLAG_USEINFLUENCE, FMODIFIER_TYPE_CYCLES, if(), FCurve::modifiers, and FModifier::type.
Referenced by BKE_fcurve_is_cyclic(), insert_bezt_fcurve(), and remap_cyclic_keyframe_location().
This function recalculates the handles of an F-Curve. Acts based on selection with SELECT
flag. To use a different flag, use BKE_fcurve_handles_recalc_ex().
If the BezTriples have been rearranged, sort them first before using this.
Definition at line 1303 of file fcurve.c.
References BKE_fcurve_handles_recalc_ex(), and SELECT.
Referenced by add_fmodifier(), alloc_driver_fcurve(), ANIM_animdata_keyframe_callback(), ANIM_animdata_update(), ANIM_fmodifiers_paste_from_buf(), delete_key_button_exec(), delete_keyframe_fcurve(), fcurve_samples_to_keyframes(), gpencil_stroke_path_animation(), graphedit_activekey_update_cb(), insert_keyframe_value(), insert_vert_fcurve(), mirror_action_keys(), mirror_graph_keys(), nlaedit_apply_scale_exec(), paste_animedit_keys_fcurve(), poselib_remove_exec(), pyrna_struct_keyframe_delete(), remove_fmodifier(), sample_fcurve(), seteasing_graph_keys(), sethandles_action_keys(), sethandles_graph_keys(), setipo_graph_keys(), smooth_fcurve(), snap_action_keys(), and snap_graph_keys().
void BKE_fcurve_handles_recalc_ex | ( | struct FCurve * | fcu, |
eBezTriple_Flag | handle_sel_flag | ||
) |
Variant of BKE_fcurve_handles_recalc() that allows calculating based on a different select flag.
handle_sel_flag | The flag (bezt.f1/2/3) value to use to determine selection. Usually SELECT , but may want to use a different one at times (if caller does not operate on selection). |
Definition at line 1220 of file fcurve.c.
References Freestyle::a, BezTriple::auto_handle_type, FCurve::auto_smoothing, FCurve::bezt, BEZT_IS_AUTOH, BKE_fcurve_is_cyclic(), BKE_nurb_handle_calc_ex(), BKE_nurb_handle_smooth_fcurve(), cycle_offset_triple(), ELEM, FCurve::extend, FCURVE_EXTRAPOLATE_CONSTANT, FCURVE_SMOOTH_NONE, HD_AUTOTYPE_LOCKED_FINAL, HD_AUTOTYPE_NORMAL, next, NULL, blender::meshintersect::prev(), FCurve::totvert, and BezTriple::vec.
Referenced by action_flip_pchan(), BKE_fcurve_handles_recalc(), and testhandles_fcurve().
Checks if the F-Curve has a Cycles modifier with simple settings that warrant transition smoothing.
Definition at line 1192 of file fcurve.c.
References BKE_fcurve_get_cycle_type(), and FCU_CYCLE_NONE.
Referenced by ANIM_fmodifiers_paste_from_buf(), BKE_fcurve_handles_recalc_ex(), and fcurve_to_keylist().
Checks if the curve has valid keys, drivers or modifiers that produce an actual curve.
Definition at line 2198 of file fcurve.c.
References FCurve::driver, FMI_TYPE_GENERATE_CURVE, list_has_suitable_fmodifier(), FCurve::modifiers, NULL, and FCurve::totvert.
Referenced by animsys_evaluate_action_group(), calculate_fcurve(), clean_fcurve(), delete_action_keys(), delete_graph_keys(), delete_keyframe_fcurve(), draw_seq_fcurve_overlay(), draw_seq_waveform_overlay(), is_fcurve_evaluatable(), seq_convert_transform_animation(), seq_convert_transform_animation_2(), and ui_but_anim_flag().
Can keyframes be added to F-Curve? Keyframes can only be added if they are already visible.
Definition at line 968 of file fcurve.c.
References BKE_fcurve_are_keyframes_usable(), and BKE_fcurve_is_protected().
Referenced by graphkeys_click_insert_exec(), graphop_editable_keyframes_poll(), and insert_keyframe_value().
Definition at line 963 of file fcurve.c.
References AGRP_PROTECTED, FCURVE_PROTECTED, bActionGroup::flag, FCurve::flag, and FCurve::grp.
Referenced by BKE_fcurve_is_keyframable(), clear_keyframe(), delete_key_button_exec(), delete_key_v3d_without_keying_set(), delete_keyframe(), draw_fcurve(), and pyrna_struct_keyframe_delete().
Quick way to loop over all f-curves of a given 'path'.
Definition at line 277 of file fcurve.c.
References ELEM, FCurve::next, NULL, FCurve::rna_path, and STREQ.
Referenced by ANIM_remove_driver().
Move the indexed keyframe to the given value, and move the handles with it to ensure the slope remains the same.
Definition at line 891 of file fcurve.c.
References BezTriple::vec.
Referenced by euler_filter_multi_channel(), and blender::bke::tests::TEST().
float* BKE_fcurves_calc_keyed_frames | ( | FCurve ** | fcurve_array, |
int | fcurve_array_len, | ||
int * | r_frames_len | ||
) |
Definition at line 836 of file fcurve.c.
References BKE_fcurves_calc_keyed_frames_ex().
Referenced by action_flip_pchan().
float* BKE_fcurves_calc_keyed_frames_ex | ( | struct FCurve ** | fcurve_array, |
int | fcurve_array_len, | ||
float | interval, | ||
int * | r_frames_len | ||
) |
Return an array of keyed frames, rounded to interval
.
interval | Set to 1.0 to round to whole keyframes, 0.5 for in-between key-frames, etc. |
Definition at line 801 of file fcurve.c.
References FCurve::bezt, BLI_assert, BLI_gset_add(), BLI_gset_free(), BLI_gset_int_new(), BLI_gset_len(), BLI_gsetIterator_getKey(), BLI_sortutil_cmp_float(), double(), GSET_ITER_INDEX, max_ff(), MEM_mallocN, NULL, POINTER_AS_INT, POINTER_FROM_INT, FCurve::totvert, and BezTriple::vec.
Referenced by BKE_fcurves_calc_keyed_frames().
Duplicate a list of F-Curves.
Definition at line 146 of file fcurve.c.
References BKE_fcurve_copy(), BLI_addtail(), BLI_listbase_clear(), ELEM, FCurve::next, NULL, and src.
Referenced by BKE_animdata_copy(), BKE_animdata_merge_copy(), BKE_nlastrip_copy(), undocurve_from_editcurve(), and undocurve_to_editcurve().
int BKE_fcurves_filter | ( | ListBase * | dst, |
ListBase * | src, | ||
const char * | dataPrefix, | ||
const char * | dataName | ||
) |
Get list of LinkData's containing pointers to the F-Curves which control the types of data indicated. e.g. numMatches = BKE_fcurves_filter(matches, &act->curves, "pose.bones[", "MyFancyBone");
Lists:
dst | list of LinkData's matching the criteria returned. List must be freed after use, and is assumed to be empty when passed. |
src | list of F-Curves to search through Filters: |
dataPrefix | i.e. pose.bones[ or nodes[ . |
dataName | name of entity within "" immediately following the prefix. |
Definition at line 297 of file fcurve.c.
References BLI_addtail(), BLI_str_quoted_substr(), LinkData::data, ELEM, MEM_callocN, FCurve::next, NULL, FCurve::rna_path, src, and STREQ.
Referenced by updateDuplicateActionConstraintSettings().
Frees a list of F-Curves.
Definition at line 86 of file fcurve.c.
References BKE_fcurve_free(), BLI_listbase_clear(), ListBase::first, FCurve::next, and NULL.
Referenced by action_free_data(), BKE_animdata_free(), BKE_nlastrip_free(), cleardrivers_animdata_fn(), do_versions_ipos_to_animato(), graph_free(), graphkeys_clear_ghostcurves_exec(), undocurve_free_data(), and undocurve_to_editcurve().
void BKE_fmodifiers_blend_read_data | ( | BlendDataReader * | reader, |
ListBase * | fmodifiers, | ||
FCurve * | curve | ||
) |
Definition at line 2283 of file fcurve.c.
References BLO_read_data_address, BLO_read_float_array(), curve, data, FMODIFIER_TYPE_ENVELOPE, FMODIFIER_TYPE_GENERATOR, FMODIFIER_TYPE_PYTHON, IDP_BlendDataRead, and LISTBASE_FOREACH.
Referenced by BKE_fcurve_blend_read_data(), and blend_data_read_nla_strips().
void BKE_fmodifiers_blend_read_expand | ( | BlendExpander * | expander, |
ListBase * | fmodifiers | ||
) |
Definition at line 2330 of file fcurve.c.
References BLO_expand, data, FMODIFIER_TYPE_PYTHON, and LISTBASE_FOREACH.
Referenced by BKE_fcurve_blend_read_expand(), and blend_read_expand_nla_strips().
void BKE_fmodifiers_blend_read_lib | ( | BlendLibReader * | reader, |
ID * | id, | ||
ListBase * | fmodifiers | ||
) |
Definition at line 2316 of file fcurve.c.
References BLO_read_id_address, data, FMODIFIER_TYPE_PYTHON, id, ID::lib, and LISTBASE_FOREACH.
Referenced by BKE_fcurve_blend_read_lib().
void BKE_fmodifiers_blend_write | ( | BlendWriter * | writer, |
ListBase * | fmodifiers | ||
) |
Definition at line 2233 of file fcurve.c.
References BLO_write_float_array(), BLO_write_struct_array, BLO_write_struct_by_name(), BLO_write_struct_list, data, fmodifier_get_typeinfo(), FMODIFIER_TYPE_ENVELOPE, FMODIFIER_TYPE_GENERATOR, FMODIFIER_TYPE_PYTHON, IDP_BlendWrite(), LISTBASE_FOREACH, and FModifierTypeInfo::structName.
Referenced by BKE_fcurve_blend_write(), and blend_write_nla_strips().
float calculate_fcurve | ( | PathResolvedRNA * | anim_rna, |
FCurve * | fcu, | ||
const AnimationEvalContext * | anim_eval_context | ||
) |
Definition at line 2204 of file fcurve.c.
References BKE_fcurve_is_empty(), FCurve::curval, FCurve::driver, AnimationEvalContext::eval_time, evaluate_fcurve(), and evaluate_fcurve_driver().
|
static |
Definition at line 1201 of file fcurve.c.
References add_v3_v3(), from, NULL, usdtokens::out(), sub_v3_v3v3(), and BezTriple::vec.
Referenced by BKE_fcurve_handles_recalc_ex().
Definition at line 2135 of file fcurve.c.
References BLI_assert, FCurve::driver, evaltime, evaluate_fcurve_ex(), and NULL.
Referenced by BCAnimationCurve::adjust_range(), BKE_tracking_track_get_weight_for_marker(), calculate_fcurve(), draw_fcurve_curve(), draw_seq_fcurve_overlay(), draw_seq_waveform_overlay(), AnimationImporter::evaluate_animation(), fcurve_samplingcb_evalcurve(), fetch_from_fcurve(), get_animated_weight(), BCAnimationCurve::get_value(), insert_fcurve_key(), libmv_tracks_new(), new_key_needed(), nla_draw_strip_curves(), nlasnapshot_from_action(), pose_slide_apply_quat(), pose_slide_apply_val(), rectf_curve_zone_y(), sample_fcurve(), seq_effect_speed_rebuild_map(), seq_render_effect_strip_impl(), and blender::bke::tests::TEST().
float evaluate_fcurve_driver | ( | PathResolvedRNA * | anim_rna, |
FCurve * | fcu, | ||
ChannelDriver * | driver_orig, | ||
const AnimationEvalContext * | anim_eval_context | ||
) |
Definition at line 2150 of file fcurve.c.
References BLI_assert, FCurve::driver, FModifier::efra, AnimationEvalContext::eval_time, evaltime, evaluate_driver(), evaluate_fcurve_ex(), ListBase::first, FModifier::flag, FMODIFIER_FLAG_RANGERESTRICT, FCurve::modifiers, FModifier::next, NULL, FModifier::sfra, and FCurve::totvert.
Referenced by calculate_fcurve().
Definition at line 2099 of file fcurve.c.
References FCurve::bezt, BLI_listbase_count(), FModifiersStackStorage::buffer, evaltime, evaluate_fmodifiers_storage_size_per_modifier(), evaluate_time_fmodifiers(), evaluate_value_fmodifiers(), fcurve_eval_keyframes(), fcurve_eval_samples(), FCURVE_INT_VALUES, FCurve::flag, floorf, FCurve::fpt, FModifiersStackStorage::modifier_count, FCurve::modifiers, and FModifiersStackStorage::size_per_modifier.
Referenced by evaluate_fcurve(), evaluate_fcurve_driver(), and evaluate_fcurve_only_curve().
Definition at line 2142 of file fcurve.c.
References evaltime, and evaluate_fcurve_ex().
Referenced by action_flip_pchan_cache_init(), insert_graph_keys(), and normalization_factor_get().
Definition at line 1594 of file fcurve.c.
References FCurve::bezt, MEM_SAFE_FREE, and FCurve::totvert.
Referenced by BKE_fcurve_delete_key(), BKE_fcurve_delete_keys_all(), and BKE_fcurve_delete_keys_selected().
Definition at line 2039 of file fcurve.c.
References evaltime, fcurve_eval_keyframes_extrapolate(), fcurve_eval_keyframes_interpolate(), FCurve::totvert, and BezTriple::vec.
Referenced by evaluate_fcurve_ex().
|
static |
Definition at line 1730 of file fcurve.c.
References BEZT_IPO_CONST, BEZT_IPO_LIN, evaltime, FCurve::extend, FCURVE_DISCRETE_VALUES, FCURVE_EXTRAPOLATE_CONSTANT, FCurve::flag, BezTriple::ipo, FCurve::totvert, and BezTriple::vec.
Referenced by fcurve_eval_keyframes().
|
static |
Definition at line 1777 of file fcurve.c.
References Freestyle::a, BezTriple::amplitude, BezTriple::back, berekeny(), BEZT_IPO_BACK, BEZT_IPO_BEZ, BEZT_IPO_BOUNCE, BEZT_IPO_CIRC, BEZT_IPO_CONST, BEZT_IPO_CUBIC, BEZT_IPO_EASE_IN, BEZT_IPO_EASE_IN_OUT, BEZT_IPO_EASE_OUT, BEZT_IPO_ELASTIC, BEZT_IPO_EXPO, BEZT_IPO_LIN, BEZT_IPO_QUAD, BEZT_IPO_QUART, BEZT_IPO_QUINT, BEZT_IPO_SINE, BKE_fcurve_bezt_binarysearch_index_ex(), BKE_fcurve_correct_bezpart(), BLI_easing_back_ease_in(), BLI_easing_back_ease_in_out(), BLI_easing_back_ease_out(), BLI_easing_bounce_ease_in(), BLI_easing_bounce_ease_in_out(), BLI_easing_bounce_ease_out(), BLI_easing_circ_ease_in(), BLI_easing_circ_ease_in_out(), BLI_easing_circ_ease_out(), BLI_easing_cubic_ease_in(), BLI_easing_cubic_ease_in_out(), BLI_easing_cubic_ease_out(), BLI_easing_elastic_ease_in(), BLI_easing_elastic_ease_in_out(), BLI_easing_elastic_ease_out(), BLI_easing_expo_ease_in(), BLI_easing_expo_ease_in_out(), BLI_easing_expo_ease_out(), BLI_easing_linear_ease(), BLI_easing_quad_ease_in(), BLI_easing_quad_ease_in_out(), BLI_easing_quad_ease_out(), BLI_easing_quart_ease_in(), BLI_easing_quart_ease_in_out(), BLI_easing_quart_ease_out(), BLI_easing_quint_ease_in(), BLI_easing_quint_ease_in_out(), BLI_easing_quint_ease_out(), BLI_easing_sine_ease_in(), BLI_easing_sine_ease_in_out(), BLI_easing_sine_ease_out(), BezTriple::easing, eps, evaltime, fabsf, FCURVE_DISCRETE_VALUES, findzero(), FCurve::flag, G, G_DEBUG, BezTriple::ipo, BezTriple::period, time, FCurve::totvert, v1, v2, and BezTriple::vec.
Referenced by fcurve_eval_keyframes().
Definition at line 2054 of file fcurve.c.
References evaltime, fabsf, floorf, interpf(), t, FCurve::totvert, and FPoint::vec.
Referenced by evaluate_fcurve_ex().
Convert baked/sampled f-curves into bezt/regular f-curves.
Definition at line 1084 of file fcurve.c.
References FCurve::bezt, BKE_fcurve_handles_recalc(), CLOG_ERROR, copy_v2_v2(), float(), FCurve::fpt, init_unbaked_bezt_data(), LOG, MEM_callocN, MEM_freeN, MEM_SAFE_FREE, NULL, FCurve::totvert, FPoint::vec, and BezTriple::vec.
Referenced by unbake_graph_curves().
Definition at line 1031 of file fcurve.c.
References evaltime, and evaluate_fcurve().
void fcurve_store_samples | ( | struct FCurve * | fcu, |
void * | data, | ||
int | start, | ||
int | end, | ||
FcuSampleFunc | sample_cb | ||
) |
Main API function for creating a set of sampled curve data, given some callback function used to retrieve the values to store.
Definition at line 1037 of file fcurve.c.
References FCurve::bezt, CLOG_ERROR, data, ELEM, float(), FCurve::fpt, LOG, MEM_callocN, MEM_freeN, NULL, FCurve::totvert, and FPoint::vec.
Referenced by bake_graph_curves(), and fcurve_bake_modifiers().
Definition at line 1568 of file fcurve.c.
References q1, solve_cubic(), and x.
Referenced by BKE_fcurve_bezt_subdivide_handles(), and fcurve_eval_keyframes_interpolate().
|
static |
Definition at line 574 of file fcurve.c.
References ARRAY_LAST_ITEM, FCurve::bezt, BEZT_ISSEL_ANY, NULL, and FCurve::totvert.
Referenced by BKE_fcurve_calc_bounds(), and BKE_fcurve_calc_range().
FCurve* id_data_find_fcurve | ( | ID * | id, |
void * | data, | ||
struct StructRNA * | type, | ||
const char * | prop_name, | ||
int | index, | ||
bool * | r_driven | ||
) |
High level function to get an f-curve from C without having the RNA.
If there is an action assigned to the id
's AnimData, it will be searched for a matching F-curve first. Drivers are searched only if no valid action F-curve could be found.
r_driven
) is optional and may be NULL.r_driven
to True in case a valid driver F-curve is found, but will not return said F-curve. In other words:FCurve*
and *r_driven = false
.NULL
and *r_driven = true
.NULL
and *r_driven = false
. Definition at line 201 of file fcurve.c.
References AnimData::action, BKE_animadata_fcurve_find_by_rna_path(), BKE_animdata_from_id(), data, ELEM, MEM_freeN, NULL, ptr, RNA_path_from_ID_to_property(), RNA_pointer_create(), RNA_struct_find_property(), and type.
Referenced by BKE_tracking_track_get_weight_for_marker(), do_versions_sequencer_speed_effect_recursive(), draw_seq_fcurve_overlay(), draw_seq_waveform_overlay(), libmv_tracks_new(), retrieve_stab_animation(), retrieve_track_weight_animation(), seq_effect_speed_speed_factor_curve_get(), seq_render_effect_strip_impl(), sound_update_animation_flags(), and sound_update_animation_flags_fn().
Definition at line 1076 of file fcurve.c.
References BEZT_IPO_LIN, BezTriple::f1, BezTriple::f2, BezTriple::f3, BezTriple::h1, BezTriple::h2, HD_AUTO_ANIM, BezTriple::ipo, and SELECT.
Referenced by fcurve_samples_to_keyframes().
Find roots of cubic equation (c0 x^3 + c1 x^2 + c2 x + c3)
o
.o
. Definition at line 1456 of file fcurve.c.
References Freestyle::a, KDL::acos(), usdtokens::b(), Freestyle::c, KDL::cos(), float(), SMALL, sqrt(), sqrt3d(), and t.
Referenced by findzero().
This function sorts BezTriples so that they are arranged in chronological order, as tools working on F-Curves expect that the BezTriples are in order.
Definition at line 1327 of file fcurve.c.
References Freestyle::a, FCurve::bezt, CLAMP_MAX, CLAMP_MIN, NULL, SWAP, swap_v2_v2(), FCurve::totvert, and BezTriple::vec.
Referenced by ANIM_animdata_update(), graphedit_activekey_update_cb(), and remake_graph_transdata().
This function tests if any BezTriples are out of order, thus requiring a sort.
Definition at line 1369 of file fcurve.c.
References Freestyle::a, FCurve::bezt, FCurve::fpt, NULL, FCurve::totvert, FPoint::vec, and BezTriple::vec.
void testhandles_fcurve | ( | struct FCurve * | fcu, |
eBezTriple_Flag | sel_flag, | ||
bool | use_handle | ||
) |
Update handles, making sure the handle-types are valid (e.g. correctly deduced from an "Auto" type), and recalculating their position vectors. Use when something has changed handle positions.
sel_flag | The flag (bezt.f1/2/3) value to use to determine selection. Usually SELECT , but may want to use a different one at times (if caller does not operate on selection). |
use_handle | Check selection state of individual handles, otherwise always update both handles if the key is selected. |
Definition at line 1308 of file fcurve.c.
References Freestyle::a, FCurve::bezt, BKE_fcurve_handles_recalc_ex(), BKE_nurb_bezt_handle_test(), ELEM, and NULL.
Referenced by posttrans_fcurve_clean(), and remake_graph_transdata().
|
static |
Definition at line 47 of file fcurve.c.
Referenced by BKE_fcurve_bezt_binarysearch_index_ex(), fcurve_samples_to_keyframes(), and fcurve_store_samples().