Blender V4.3
BKE_fcurve.hh File Reference

Go to the source code of this file.

Classes

struct  FModifierTypeInfo
 
struct  FModifiersStackStorage
 

Macros

#define BEZT_BINARYSEARCH_THRESH   0.01f /* was 0.00001, but giving errors */
 

Typedefs

typedef enum eFCU_Cycle_Type eFCU_Cycle_Type
 
typedef float(* FcuSampleFunc) (FCurve *fcu, void *data, float evaltime)
 

Enumerations

enum  eFMI_Action_Types { FMI_TYPE_EXTRAPOLATION = 0 , FMI_TYPE_INTERPOLATION , FMI_TYPE_REPLACE_VALUES , FMI_TYPE_GENERATE_CURVE }
 
enum  eFMI_Requirement_Flags { FMI_REQUIRES_ORIGINAL_DATA = (1 << 0) , FMI_REQUIRES_NOTHING = (1 << 1) , FMI_REQUIRES_RUNTIME_CHECK = (1 << 2) }
 
enum  eFCU_Cycle_Type { FCU_CYCLE_NONE = 0 , FCU_CYCLE_PERFECT , FCU_CYCLE_OFFSET }
 

Functions

const FModifierTypeInfofmodifier_get_typeinfo (const FModifier *fcm)
 
const FModifierTypeInfoget_fmodifier_typeinfo (int type)
 
FModifieradd_fmodifier (ListBase *modifiers, int type, FCurve *owner_fcu)
 
FModifiercopy_fmodifier (const FModifier *src)
 
void copy_fmodifiers (ListBase *dst, const ListBase *src)
 
bool remove_fmodifier (ListBase *modifiers, FModifier *fcm)
 
void free_fmodifiers (ListBase *modifiers)
 
FModifierfind_active_fmodifier (ListBase *modifiers)
 
void set_active_fmodifier (ListBase *modifiers, FModifier *fcm)
 
bool list_has_suitable_fmodifier (const ListBase *modifiers, int mtype, short acttype)
 
uint evaluate_fmodifiers_storage_size_per_modifier (const ListBase *modifiers)
 
float evaluate_time_fmodifiers (FModifiersStackStorage *storage, const ListBase *modifiers, const FCurve *fcu, float cvalue, float evaltime)
 
void evaluate_value_fmodifiers (FModifiersStackStorage *storage, const ListBase *modifiers, const FCurve *fcu, float *cvalue, float evaltime)
 
void fcurve_bake_modifiers (FCurve *fcu, int start, int end)
 
int BKE_fcm_envelope_find_index (FCM_EnvelopeData *array, float frame, int arraylen, bool *r_exists)
 
FCurveBKE_fcurve_create (void)
 
void BKE_fcurve_free (FCurve *fcu)
 
FCurveBKE_fcurve_copy (const FCurve *fcu)
 
void BKE_fcurves_free (ListBase *list)
 
void BKE_fcurves_copy (ListBase *dst, ListBase *src)
 
void BKE_fcurve_rnapath_set (FCurve &fcu, blender::StringRef rna_path)
 
void BKE_fmodifier_name_set (FModifier *fcm, const char *name)
 
void BKE_fcurve_foreach_id (FCurve *fcu, LibraryForeachIDData *data)
 
FCurveBKE_fcurve_find (ListBase *list, const char rna_path[], int array_index)
 
FCurveBKE_fcurve_iter_step (FCurve *fcu_iter, const char rna_path[])
 
FCurveid_data_find_fcurve (ID *id, void *data, StructRNA *type, const char *prop_name, int index, bool *r_driven)
 
FCurveBKE_animadata_fcurve_find_by_rna_path (AnimData *animdata, const char *rna_path, const int rna_index, bAction **r_action, bool *r_driven)
 
FCurveBKE_fcurve_find_by_rna (PointerRNA *ptr, PropertyRNA *prop, int rnaindex, AnimData **r_adt, bAction **r_action, bool *r_driven, bool *r_special)
 
FCurveBKE_fcurve_find_by_rna_context_ui (bContext *C, const PointerRNA *ptr, PropertyRNA *prop, int rnaindex, AnimData **r_animdata, bAction **r_action, bool *r_driven, bool *r_special)
 
int BKE_fcurve_bezt_binarysearch_index (const BezTriple array[], float frame, int arraylen, bool *r_replace)
 
FCurvePathCacheBKE_fcurve_pathcache_create (ListBase *list)
 
void BKE_fcurve_pathcache_destroy (FCurvePathCache *fcache)
 
FCurveBKE_fcurve_pathcache_find (FCurvePathCache *fcache, const char rna_path[], int array_index)
 
int BKE_fcurve_pathcache_find_array (FCurvePathCache *fcache, const char *rna_path, FCurve **fcurve_result, int fcurve_result_len)
 
bool BKE_fcurve_calc_range (const FCurve *fcu, float *r_min, float *r_max, bool selected_keys_only)
 
bool BKE_fcurve_calc_bounds (const FCurve *fcu, bool selected_keys_only, bool include_handles, const float frame_range[2], rctf *r_bounds)
 
floatBKE_fcurves_calc_keyed_frames_ex (FCurve **fcurve_array, int fcurve_array_len, float interval, int *r_frames_len)
 
floatBKE_fcurves_calc_keyed_frames (FCurve **fcurve_array, int fcurve_array_len, int *r_frames_len)
 
void BKE_fcurve_active_keyframe_set (FCurve *fcu, const BezTriple *active_bezt)
 
int BKE_fcurve_active_keyframe_index (const FCurve *fcu)
 
void BKE_fcurve_keyframe_move_time_with_handles (BezTriple *keyframe, const float new_time)
 
void BKE_fcurve_keyframe_move_value_with_handles (BezTriple *keyframe, float new_value)
 
bool BKE_fcurve_are_keyframes_usable (const FCurve *fcu)
 
bool BKE_fcurve_is_keyframable (const FCurve *fcu)
 
bool BKE_fcurve_is_protected (const FCurve *fcu)
 
bool BKE_fcurve_has_selected_control_points (const FCurve *fcu)
 
void BKE_fcurve_deselect_all_keys (FCurve &fcu)
 
bool BKE_fcurve_is_cyclic (const FCurve *fcu)
 
eFCU_Cycle_Type BKE_fcurve_get_cycle_type (const FCurve *fcu)
 
bool BKE_fcurve_bezt_subdivide_handles (BezTriple *bezt, BezTriple *prev, BezTriple *next, float *r_pdelta)
 
void BKE_fcurve_bezt_shrink (FCurve *fcu, int new_totvert)
 
BezTripleBKE_bezier_array_merge (const BezTriple *a, int size_a, const BezTriple *b, int size_b, int *r_merged_size)
 
void BKE_fcurve_delete_key (FCurve *fcu, int index)
 
void BKE_fcurve_delete_keys (FCurve *fcu, blender::uint2 index_range)
 
bool BKE_fcurve_delete_keys_selected (FCurve *fcu)
 
void BKE_fcurve_delete_keys_all (FCurve *fcu)
 
void BKE_fcurve_merge_duplicate_keys (FCurve *fcu, const int sel_flag, const bool use_handle)
 
void BKE_fcurve_deduplicate_keys (FCurve *fcu)
 
void BKE_fcurve_handles_recalc (FCurve *fcu)
 
void BKE_fcurve_handles_recalc_ex (FCurve *fcu, eBezTriple_Flag handle_sel_flag)
 
void testhandles_fcurve (FCurve *fcu, eBezTriple_Flag sel_flag, bool use_handle)
 
void sort_time_fcurve (FCurve *fcu)
 
bool test_time_fcurve (FCurve *fcu)
 
void BKE_fcurve_correct_bezpart (const float v1[2], float v2[2], float v3[2], const float v4[2])
 
float evaluate_fcurve (const FCurve *fcu, float evaltime)
 
float evaluate_fcurve_only_curve (const FCurve *fcu, float evaltime)
 
float evaluate_fcurve_driver (PathResolvedRNA *anim_rna, FCurve *fcu, ChannelDriver *driver_orig, const AnimationEvalContext *anim_eval_context)
 
bool BKE_fcurve_is_empty (const FCurve *fcu)
 
float calculate_fcurve (PathResolvedRNA *anim_rna, FCurve *fcu, const AnimationEvalContext *anim_eval_context)
 
float fcurve_samplingcb_evalcurve (FCurve *fcu, void *data, float evaltime)
 
void fcurve_store_samples (FCurve *fcu, void *data, int start, int end, FcuSampleFunc sample_cb)
 
void fcurve_samples_to_keyframes (FCurve *fcu, int start, int end)
 
void BKE_fmodifiers_blend_write (BlendWriter *writer, ListBase *fmodifiers)
 
void BKE_fmodifiers_blend_read_data (BlendDataReader *reader, ListBase *fmodifiers, FCurve *curve)
 
void BKE_fcurve_blend_write_data (BlendWriter *writer, FCurve *fcu)
 
void BKE_fcurve_blend_write_listbase (BlendWriter *writer, ListBase *fcurves)
 
void BKE_fcurve_blend_read_data (BlendDataReader *reader, FCurve *fcu)
 
void BKE_fcurve_blend_read_data_listbase (BlendDataReader *reader, ListBase *fcurves)
 

Macro Definition Documentation

◆ BEZT_BINARYSEARCH_THRESH

Typedef Documentation

◆ eFCU_Cycle_Type

◆ FcuSampleFunc

typedef float(* FcuSampleFunc) (FCurve *fcu, void *data, float evaltime)

Basic signature for F-Curve sample-creation function.

Parameters
fcuthe F-Curve being operated on.
datapointer to some specific data that may be used by one of the callbacks.

Definition at line 622 of file BKE_fcurve.hh.

Enumeration Type Documentation

◆ eFCU_Cycle_Type

Enumerator
FCU_CYCLE_NONE 
FCU_CYCLE_PERFECT 
FCU_CYCLE_OFFSET 

Definition at line 448 of file BKE_fcurve.hh.

◆ eFMI_Action_Types

Enumerator
FMI_TYPE_EXTRAPOLATION 
FMI_TYPE_INTERPOLATION 
FMI_TYPE_REPLACE_VALUES 
FMI_TYPE_GENERATE_CURVE 

Definition at line 86 of file BKE_fcurve.hh.

◆ eFMI_Requirement_Flags

Enumerator
FMI_REQUIRES_ORIGINAL_DATA 
FMI_REQUIRES_NOTHING 
FMI_REQUIRES_RUNTIME_CHECK 

Definition at line 98 of file BKE_fcurve.hh.

Function Documentation

◆ add_fmodifier()

◆ BKE_animadata_fcurve_find_by_rna_path()

FCurve * BKE_animadata_fcurve_find_by_rna_path ( AnimData * animdata,
const char * rna_path,
const int rna_index,
bAction ** r_action,
bool * r_driven )

Find an F-Curve from its rna path and index.

The search order is as follows. The first match will be returned:

  • Animation
  • Action
  • Drivers
Note
Typically, indices in RNA arrays are stored separately in F-curves, so the rna_path should not include them (e.g. ‘rna_path='location[0]’will not match any F-Curve on an Object, butrna_path='location', rna_index=0` will if it exists).
Return pointer parameters (r_action, r_driven and r_special) are all optional and may be NULL.
since Actions may have multiple layers all containing an F-Curve for this property, what is returned is a best-effort guess. The topmost layer has priority, and it is assumed that when it has a strip, it's infinite.

Definition at line 300 of file blenkernel/intern/fcurve.cc.

References AnimData::action, BKE_fcurve_find(), BLI_listbase_is_empty(), AnimData::drivers, blender::animrig::fcurve_find_in_action_slot(), and AnimData::slot_handle.

Referenced by BKE_fcurve_find_by_rna_context_ui(), BKE_lib_override_library_property_is_animated(), get_fcurves_of_property(), and id_data_find_fcurve().

◆ BKE_bezier_array_merge()

BezTriple * BKE_bezier_array_merge ( const BezTriple * a,
int size_a,
const BezTriple * b,
int size_b,
int * r_merged_size )

Merge the two given BezTriple arrays a and b into a newly allocated BezTriple array of size r_merged_size. In case of keys on identical frames, a takes precedence. Does not free a or b. Assumes that both arrays are sorted for the x-position. Has a complexity of O(N) with respect to the length of size_a + size_b.

Returns
The merged BezTriple array of length r_merged_size.

Definition at line 1681 of file blenkernel/intern/fcurve.cc.

References b, BEZT_BINARYSEARCH_THRESH, compare_ff_relative(), MEM_callocN, and MEM_reallocN.

Referenced by blender::animrig::bake_fcurve().

◆ BKE_fcm_envelope_find_index()

int BKE_fcm_envelope_find_index ( FCM_EnvelopeData * array,
float frame,
int arraylen,
bool * r_exists )

◆ BKE_fcurve_active_keyframe_index()

int BKE_fcurve_active_keyframe_index ( const FCurve * fcu)

◆ BKE_fcurve_active_keyframe_set()

void BKE_fcurve_active_keyframe_set ( FCurve * fcu,
const BezTriple * active_bezt )

Set the index that stores the FCurve's active keyframe, assuming that active_bezt is already part of fcu->bezt. If NULL, set active keyframe index to "none."

Definition at line 814 of file blenkernel/intern/fcurve.cc.

References FCurve::active_keyframe_index, FCurve::bezt, BEZT_ISSEL_ANY, BLI_assert_msg, FCURVE_ACTIVE_KEYFRAME_NONE, int, and FCurve::totvert.

Referenced by BKE_fcurve_delete_keys_selected(), blender::animrig::insert_vert_fcurve(), mouse_graph_keys(), and blender::bke::tests::TEST().

◆ BKE_fcurve_are_keyframes_usable()

bool BKE_fcurve_are_keyframes_usable ( const FCurve * fcu)

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 875 of file blenkernel/intern/fcurve.cc.

References FCM_GENERATOR_ADDITIVE, ListBase::first, FMODIFIER_FLAG_DISABLED, FMODIFIER_FLAG_MUTED, FMODIFIER_TYPE_CYCLES, FMODIFIER_TYPE_FN_GENERATOR, FMODIFIER_TYPE_GENERATOR, FMODIFIER_TYPE_NOISE, FMODIFIER_TYPE_STEPPED, FCurve::fpt, LISTBASE_FOREACH_BACKWARD, and FCurve::modifiers.

Referenced by BKE_fcurve_is_keyframable(), draw_fcurve(), and graphop_visible_keyframes_poll().

◆ BKE_fcurve_bezt_binarysearch_index()

◆ BKE_fcurve_bezt_shrink()

void BKE_fcurve_bezt_shrink ( FCurve * fcu,
int new_totvert )

Resize the FCurve 'bezt' array to fit the given length.

Parameters
new_totvertnew number of elements in the FCurve's bezt array. Constraint: 0 <= new_totvert <= fcu->totvert

Definition at line 1615 of file blenkernel/intern/fcurve.cc.

References FCurve::bezt, BLI_assert, fcurve_bezt_free(), MEM_reallocN, and FCurve::totvert.

Referenced by BKE_fcurve_deduplicate_keys().

◆ BKE_fcurve_bezt_subdivide_handles()

bool BKE_fcurve_bezt_subdivide_handles ( BezTriple * bezt,
BezTriple * prev,
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.

Parameters
r_pdeltareturn Y difference between bezt and the original curve value at its X position.
Returns
Whether the split was successful.

Definition at line 1553 of file blenkernel/intern/fcurve.cc.

References add_v2_v2v2(), BKE_fcurve_correct_bezpart(), copy_v2_v2(), findzero(), interp_v2_v2v2(), next, sub_v2_v2v2(), and BezTriple::vec.

Referenced by blender::animrig::subdivide_nonauto_handles(), and blender::bke::tests::TEST().

◆ BKE_fcurve_blend_read_data()

◆ BKE_fcurve_blend_read_data_listbase()

void BKE_fcurve_blend_read_data_listbase ( BlendDataReader * reader,
ListBase * fcurves )

◆ BKE_fcurve_blend_write_data()

◆ BKE_fcurve_blend_write_listbase()

void BKE_fcurve_blend_write_listbase ( BlendWriter * writer,
ListBase * fcurves )

◆ BKE_fcurve_calc_bounds()

bool BKE_fcurve_calc_bounds ( const FCurve * fcu,
bool selected_keys_only,
bool include_handles,
const float frame_range[2],
rctf * r_bounds )

Calculate the x and y extents of F-Curve's data.

Parameters
frame_rangeOnly calculate the bounds of the FCurve in the given range. Does the full range if NULL.
Returns
true if the bounds have been found.

Definition at line 706 of file blenkernel/intern/fcurve.cc.

References FCurve::bezt, calculate_bezt_bounds(), calculate_fpt_bounds(), FCurve::fpt, and FCurve::totvert.

Referenced by get_graph_keyframe_extents(), get_normalized_fcurve_bounds(), and blender::bke::tests::TEST().

◆ BKE_fcurve_calc_range()

bool BKE_fcurve_calc_range ( const FCurve * fcu,
float * r_min,
float * r_max,
bool selected_keys_only )

Calculate the x range of the given F-Curve's data.

Returns
true if a range has been found.

Definition at line 730 of file blenkernel/intern/fcurve.cc.

References FCurve::bezt, calculate_bezt_bounds_x(), FCurve::fpt, get_bounding_bezt_indices(), max, min, FCurve::totvert, and FPoint::vec.

Referenced by draw_fcurve_curve(), blender::animrig::get_frame_range_of_fcurves(), get_keyframe_extents(), and blender::bke::tests::TEST().

◆ BKE_fcurve_copy()

◆ BKE_fcurve_correct_bezpart()

void BKE_fcurve_correct_bezpart ( const float v1[2],
float v2[2],
float v3[2],
const float v4[2] )

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 1363 of file blenkernel/intern/fcurve.cc.

References fabsf, len, and v2.

Referenced by add_bezt_vertices(), BKE_fcurve_bezt_subdivide_handles(), fcurve_eval_keyframes_interpolate(), and fcurve_scene_coord_range_get().

◆ BKE_fcurve_create()

◆ BKE_fcurve_deduplicate_keys()

void BKE_fcurve_deduplicate_keys ( FCurve * fcu)

Ensure the FCurve is a proper function, such that every X-coordinate of the timeline has only one value of the FCurve. In other words, removes duplicate keyframes.

Contrary to BKE_fcurve_merge_duplicate_keys, which is intended for interactive use, and where selection matters, this is a simpler deduplication where the last duplicate "wins".

Assumes the keys are sorted (see sort_time_fcurve).

After deduplication, call BKE_fcurve_handles_recalc(fcu);

Definition at line 1900 of file blenkernel/intern/fcurve.cc.

References FCurve::bezt, BEZT_BINARYSEARCH_THRESH, BKE_fcurve_bezt_shrink(), BKE_fcurve_keyframe_move_time_with_handles(), BLI_assert_msg, floor(), FCurve::totvert, and BezTriple::vec.

Referenced by blender::bke::tests::TEST(), blender::bke::tests::TEST(), and blender::bke::tests::TEST().

◆ BKE_fcurve_delete_key()

void BKE_fcurve_delete_key ( FCurve * fcu,
int index )

◆ BKE_fcurve_delete_keys()

void BKE_fcurve_delete_keys ( FCurve * fcu,
blender::uint2 index_range )

Delete an index range of keyframes from an F-curve. This is more performant than individually removing keys. Has a complexity of O(N) with respect to number of keys in fcu.

Parameters
index_rangeis right exclusive.

Definition at line 1663 of file blenkernel/intern/fcurve.cc.

References FCurve::bezt, BLI_assert, fcurve_bezt_free(), and FCurve::totvert.

Referenced by blender::animrig::remove_fcurve_key_range().

◆ BKE_fcurve_delete_keys_all()

void BKE_fcurve_delete_keys_all ( FCurve * fcu)

Delete all keyframes from an F-curve.

Definition at line 1767 of file blenkernel/intern/fcurve.cc.

References fcurve_bezt_free().

Referenced by clean_fcurve(), paste_animedit_keys_fcurve(), and blender::animrig::remove_fcurve_key_range().

◆ BKE_fcurve_delete_keys_selected()

bool BKE_fcurve_delete_keys_selected ( FCurve * fcu)

◆ BKE_fcurve_deselect_all_keys()

void BKE_fcurve_deselect_all_keys ( FCurve & fcu)

Deselect all keyframes within that FCurve.

Definition at line 950 of file blenkernel/intern/fcurve.cc.

References FCurve::bezt, BEZT_DESEL_ALL, and FCurve::totvert.

Referenced by blender::animrig::action_deselect_keys().

◆ BKE_fcurve_find()

FCurve * BKE_fcurve_find ( ListBase * list,
const char rna_path[],
int array_index )

◆ BKE_fcurve_find_by_rna()

FCurve * BKE_fcurve_find_by_rna ( PointerRNA * ptr,
PropertyRNA * prop,
int rnaindex,
AnimData ** r_adt,
bAction ** r_action,
bool * r_driven,
bool * r_special )

Find an f-curve based on an rna property.

Definition at line 336 of file blenkernel/intern/fcurve.cc.

References BKE_fcurve_find_by_rna_context_ui(), and ptr.

Referenced by blender::interface::internal::paste_property_drivers(), and RNA_property_animated().

◆ BKE_fcurve_find_by_rna_context_ui()

FCurve * BKE_fcurve_find_by_rna_context_ui ( bContext * C,
const PointerRNA * ptr,
PropertyRNA * prop,
int rnaindex,
AnimData ** r_animdata,
bAction ** r_action,
bool * r_driven,
bool * r_special )

Same as BKE_fcurve_find_by_rna, but takes a context data, temp hack needed for complex paths like texture ones.

Parameters
r_specialOptional, ignored when NULL. Set to true if the given RNA ptr is a NLA strip, and the returned F-curve comes from this NLA strip.

Definition at line 348 of file blenkernel/intern/fcurve.cc.

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, PointerRNA::owner_id, ptr, RNA_path_from_ID_to_property(), RNA_property_animateable(), and RNA_property_identifier().

Referenced by add_driver_button_poll(), blender::animrig::autokeyframe_property(), BKE_fcurve_find_by_rna(), drivers_editor_show_exec(), graph_panel_drivers_popover(), insert_key_button_exec(), and ui_but_get_fcurve().

◆ BKE_fcurve_foreach_id()

void BKE_fcurve_foreach_id ( FCurve * fcu,
LibraryForeachIDData * data )

Callback used by lib_query to walk over all ID usages (mimics foreach_id callback of IDTypeInfo structure).

Note that this is only relevant when the F-Curve is a driver. Otherwise it won't refer to any other ID.

Definition at line 194 of file blenkernel/intern/fcurve.cc.

References BKE_LIB_FOREACHID_PROCESS_ID, FCurve::driver, DRIVER_TARGETS_LOOPER_END, DRIVER_TARGETS_USED_LOOPER_BEGIN, IDWALK_CB_NOP, LISTBASE_FOREACH, and ChannelDriver::variables.

Referenced by BKE_animdata_foreach_id(), and BKE_nla_strip_foreach_id().

◆ BKE_fcurve_free()

void BKE_fcurve_free ( FCurve * fcu)

Frees the F-Curve itself too, so make sure BLI_remlink is called before calling this.

Definition at line 76 of file blenkernel/intern/fcurve.cc.

References FCurve::bezt, fcurve_free_driver(), FCurve::fpt, free_fmodifiers(), MEM_freeN(), MEM_SAFE_FREE, FCurve::modifiers, and FCurve::rna_path.

Referenced by blender::animrig::legacy::action_fcurves_remove(), ANIM_drivers_copybuf_free(), ANIM_remove_driver(), animchannels_delete_exec(), blender::animrig::animdata_fcurve_delete(), BKE_action_fcurves_clear(), BKE_fcurves_free(), blender::editor::animation::tests::create_test_keylist(), ED_curve_updateAnimPaths(), blender::animrig::fcurve_ptr_destructor(), blender::animrig::ChannelBag::fcurve_remove(), blender::animrig::ChannelBag::fcurve_remove_by_index(), fcurves_path_remove_from_listbase(), blender::interface::internal::paste_property_drivers(), remove_sequencer_fcurves(), seq_convert_transform_animation(), SEQ_free_animdata(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), AnimationImporter::~AnimationImporter(), and blender::animrig::ChannelBag::~ChannelBag().

◆ BKE_fcurve_get_cycle_type()

◆ BKE_fcurve_handles_recalc()

◆ BKE_fcurve_handles_recalc_ex()

void BKE_fcurve_handles_recalc_ex ( FCurve * fcu,
eBezTriple_Flag handle_sel_flag )

Variant of BKE_fcurve_handles_recalc() that allows calculating based on a different select flag.

Parameters
handle_sel_flagThe 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 1176 of file blenkernel/intern/fcurve.cc.

References FCurve::bezt, BEZT_IS_AUTOH, BKE_fcurve_is_cyclic(), ELEM, and FCurve::totvert.

Referenced by action_flip_pchan(), BKE_fcurve_handles_recalc(), recalcData_graphedit(), and testhandles_fcurve().

◆ BKE_fcurve_has_selected_control_points()

bool BKE_fcurve_has_selected_control_points ( const FCurve * fcu)

Are any of the keyframe control points selected on the F-Curve?

Definition at line 938 of file blenkernel/intern/fcurve.cc.

References FCurve::bezt, BezTriple::f2, SELECT, and FCurve::totvert.

Referenced by graph_has_selected_control_points().

◆ BKE_fcurve_is_cyclic()

bool BKE_fcurve_is_cyclic ( const FCurve * fcu)

Checks if the F-Curve has a Cycles modifier with simple settings that warrant transition smoothing.

Definition at line 1148 of file blenkernel/intern/fcurve.cc.

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().

◆ BKE_fcurve_is_empty()

◆ BKE_fcurve_is_keyframable()

bool BKE_fcurve_is_keyframable ( const FCurve * fcu)

Can keyframes be added to F-Curve? Keyframes can only be added if they are already visible.

Definition at line 960 of file blenkernel/intern/fcurve.cc.

References BKE_fcurve_are_keyframes_usable(), and BKE_fcurve_is_protected().

Referenced by graphkeys_click_insert_exec(), graphop_editable_keyframes_poll(), blender::animrig::insert_keyframe_value(), and blender::animrig::StripKeyframeData::keyframe_insert().

◆ BKE_fcurve_is_protected()

◆ BKE_fcurve_iter_step()

FCurve * BKE_fcurve_iter_step ( FCurve * fcu_iter,
const char rna_path[] )

Quick way to loop over all f-curves of a given 'path'.

Definition at line 282 of file blenkernel/intern/fcurve.cc.

References ELEM, FCurve::next, and STREQ.

Referenced by ANIM_remove_driver().

◆ BKE_fcurve_keyframe_move_time_with_handles()

void BKE_fcurve_keyframe_move_time_with_handles ( BezTriple * keyframe,
const float new_time )

Move the indexed keyframe to the given value, and move the handles with it to ensure the slope remains the same.

Definition at line 855 of file blenkernel/intern/fcurve.cc.

References BezTriple::vec.

Referenced by BKE_fcurve_deduplicate_keys(), snap_bezier_cframe(), snap_bezier_nearest(), snap_bezier_nearestsec(), snap_bezier_nearmarker(), snap_bezier_time(), and blender::bke::tests::TEST().

◆ BKE_fcurve_keyframe_move_value_with_handles()

◆ BKE_fcurve_merge_duplicate_keys()

void BKE_fcurve_merge_duplicate_keys ( FCurve * fcu,
const int sel_flag,
const bool use_handle )

Called during transform/snapping to make sure selected keyframes replace any other keyframes which may reside on that frame (that is not selected).

Parameters
sel_flagThe 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 1782 of file blenkernel/intern/fcurve.cc.

References FCurve::bezt, BEZT_BINARYSEARCH_THRESH, BEZT_ISSEL_ANY, BKE_fcurve_delete_key(), BLI_addtail(), BLI_freelistN(), BLI_listbase_is_empty(), FCURVE_DISCRETE_VALUES, FCURVE_INT_VALUES, FCurve::flag, float, tRetainedKeyframe::frame, G, G_DEBUG, IS_EQT, LISTBASE_FOREACH, LISTBASE_FOREACH_BACKWARD, MEM_callocN, printf, FCurve::rna_path, testhandles_fcurve(), tRetainedKeyframe::tot_count, FCurve::totvert, tRetainedKeyframe::val, and BezTriple::vec.

Referenced by posttrans_action_clean(), snap_action_keys(), snap_graph_keys(), special_aftertrans_update__actedit(), and special_aftertrans_update__graph().

◆ BKE_fcurve_pathcache_create()

◆ BKE_fcurve_pathcache_destroy()

void BKE_fcurve_pathcache_destroy ( FCurvePathCache * fcache)

◆ BKE_fcurve_pathcache_find()

FCurve * BKE_fcurve_pathcache_find ( FCurvePathCache * fcache,
const char rna_path[],
int array_index )

◆ BKE_fcurve_pathcache_find_array()

int BKE_fcurve_pathcache_find_array ( FCurvePathCache * fcache,
const char * rna_path,
FCurve ** fcurve_result,
int fcurve_result_len )

Fill in an array of F-Curve, leave NULL when not found.

Returns
The number of F-Curves found.

Definition at line 149 of file fcurve_cache.cc.

References FCurve::array_index, BLI_ghash_lookup(), FCurvePathCache::fcurve_array, FCurvePathCache_Span::index, FCurvePathCache_Span::len, len, and FCurvePathCache::span_from_rna_path.

Referenced by action_flip_pchan_cache_fcurve_assign_array().

◆ BKE_fcurve_rnapath_set()

◆ BKE_fcurves_calc_keyed_frames()

float * BKE_fcurves_calc_keyed_frames ( FCurve ** fcurve_array,
int fcurve_array_len,
int * r_frames_len )

Definition at line 801 of file blenkernel/intern/fcurve.cc.

References BKE_fcurves_calc_keyed_frames_ex().

Referenced by action_flip_pchan().

◆ BKE_fcurves_calc_keyed_frames_ex()

float * BKE_fcurves_calc_keyed_frames_ex ( FCurve ** fcurve_array,
int fcurve_array_len,
float interval,
int * r_frames_len )

Return an array of keyed frames, rounded to interval.

Parameters
intervalSet to 1.0 to round to whole keyframes, 0.5 for in-between key-frames, etc.
Note
An interval of zero could be supported (this implies no rounding at all), however this risks very small differences in float values being treated as separate keyframes.

Definition at line 766 of file blenkernel/intern/fcurve.cc.

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, POINTER_AS_INT, POINTER_FROM_INT, FCurve::totvert, and BezTriple::vec.

Referenced by BKE_fcurves_calc_keyed_frames().

◆ BKE_fcurves_copy()

◆ BKE_fcurves_free()

◆ BKE_fmodifier_name_set()

◆ BKE_fmodifiers_blend_read_data()

◆ BKE_fmodifiers_blend_write()

◆ calculate_fcurve()

◆ copy_fmodifier()

FModifier * copy_fmodifier ( const FModifier * src)

◆ copy_fmodifiers()

void copy_fmodifiers ( ListBase * dst,
const ListBase * src )

◆ evaluate_fcurve()

◆ evaluate_fcurve_driver()

◆ evaluate_fcurve_only_curve()

float evaluate_fcurve_only_curve ( const FCurve * fcu,
float evaltime )

◆ evaluate_fmodifiers_storage_size_per_modifier()

uint evaluate_fmodifiers_storage_size_per_modifier ( const ListBase * modifiers)

◆ evaluate_time_fmodifiers()

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.

  • This step acts as an optimization to prevent the F-Curve stack being evaluated several times by modifiers requesting the time be modified, as the final result would have required using the modified time
  • Modifiers only ever receive the unmodified time, as subsequent modifiers should be working on the 'global' result of the modified curve, not some localized segment, so evaltime gets set to whatever the last time-modifying modifier likes.
  • We start from the end of the stack, as only the last one matters for now.
Parameters
fcuCan 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().

◆ evaluate_value_fmodifiers()

◆ fcurve_bake_modifiers()

void fcurve_bake_modifiers ( FCurve * fcu,
int start,
int end )

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.

◆ fcurve_samples_to_keyframes()

void fcurve_samples_to_keyframes ( FCurve * fcu,
int start,
int end )

◆ fcurve_samplingcb_evalcurve()

float fcurve_samplingcb_evalcurve ( FCurve * fcu,
void * data,
float evaltime )

Basic sampling callback which acts as a wrapper for evaluate_fcurve() 'data' arg here is unneeded here.

Definition at line 986 of file blenkernel/intern/fcurve.cc.

References evaltime, and evaluate_fcurve().

Referenced by convert_keys_to_samples(), create_ghost_curves(), fcurve_bake_modifiers(), blender::bke::tests::TEST(), and blender::bke::tests::TEST().

◆ fcurve_store_samples()

void fcurve_store_samples ( 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 992 of file blenkernel/intern/fcurve.cc.

References FCurve::bezt, CLOG_ERROR, ELEM, float, FCurve::fpt, LOG, MEM_callocN, MEM_freeN(), FCurve::totvert, and FPoint::vec.

Referenced by convert_keys_to_samples(), fcurve_bake_modifiers(), blender::bke::tests::TEST(), and blender::bke::tests::TEST().

◆ find_active_fmodifier()

FModifier * find_active_fmodifier ( ListBase * 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().

◆ fmodifier_get_typeinfo()

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().

◆ free_fmodifiers()

void free_fmodifiers ( ListBase * modifiers)

◆ get_fmodifier_typeinfo()

const FModifierTypeInfo * get_fmodifier_typeinfo ( int type)

◆ id_data_find_fcurve()

FCurve * id_data_find_fcurve ( ID * id,
void * data,
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.

Note
Return pointer parameter (r_driven) is optional and may be NULL.
Warning
In case no animation (from an Action) F-curve is found, returned value is always NULL. This means that this function will set r_driven to True in case a valid driver F-curve is found, but will not return said F-curve. In other words:
  • Animated with FCurve: returns the FCurve* and *r_driven = false.
  • Animated with driver: returns NULL and *r_driven = true.
  • Not animated: returns NULL and *r_driven = false.

Definition at line 211 of file blenkernel/intern/fcurve.cc.

References AnimData::action, BKE_animadata_fcurve_find_by_rna_path(), BKE_animdata_from_id(), ELEM, ptr, RNA_path_from_ID_to_property(), RNA_pointer_create(), and RNA_struct_find_property().

Referenced by BKE_tracking_track_get_weight_for_marker(), do_versions_sequencer_speed_effect_recursive(), 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(), sound_update_animation_flags_fn(), and strip_draw_context_curve_get().

◆ list_has_suitable_fmodifier()

bool list_has_suitable_fmodifier ( const ListBase * modifiers,
int mtype,
short acttype )

Do we have any modifiers which match certain criteria.

Parameters
mtypeType of modifier (if 0, doesn't matter).
acttypeType 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_fmodifier()

bool remove_fmodifier ( ListBase * modifiers,
FModifier * fcm )

◆ set_active_fmodifier()

void set_active_fmodifier ( ListBase * modifiers,
FModifier * fcm )

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().

◆ sort_time_fcurve()

void sort_time_fcurve ( FCurve * fcu)

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 1280 of file blenkernel/intern/fcurve.cc.

References FCurve::bezt, CLAMP_MAX, CLAMP_MIN, swap_v2_v2(), FCurve::totvert, and BezTriple::vec.

Referenced by ANIM_animdata_update(), graphedit_activekey_update_cb(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), and blender::bke::tests::TEST().

◆ test_time_fcurve()

bool test_time_fcurve ( FCurve * fcu)

This function tests if any BezTriples are out of order, thus requiring a sort.

Definition at line 1322 of file blenkernel/intern/fcurve.cc.

References FCurve::bezt, FCurve::fpt, FCurve::totvert, BezTriple::vec, and FPoint::vec.

Referenced by recalcData_graphedit().

◆ testhandles_fcurve()

void testhandles_fcurve ( 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.

Parameters
sel_flagThe 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_handleCheck selection state of individual handles, otherwise always update both handles if the key is selected.

Definition at line 1261 of file blenkernel/intern/fcurve.cc.

References FCurve::bezt, BKE_fcurve_handles_recalc_ex(), BKE_nurb_bezt_handle_test(), ELEM, NURB_HANDLE_TEST_EACH, NURB_HANDLE_TEST_KNOT_ONLY, and FCurve::totvert.

Referenced by BKE_fcurve_merge_duplicate_keys(), and createTransGraphEditData().