Blender  V2.93
Macros | Functions | Variables
fcurve.c File Reference
#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 "CLG_log.h"

Go to the source code of this file.

Macros

#define SMALL   -1.0e-10
 
#define SELECT   1
 

Functions

void BKE_fcurve_keyframe_move_value_with_handles (struct BezTriple *keyframe, const float new_value)
 
F-Curve Data Create
FCurveBKE_fcurve_create (void)
 
F-Curve Data Free
void BKE_fcurve_free (FCurve *fcu)
 
void BKE_fcurves_free (ListBase *list)
 
F-Curve Data Copy
FCurveBKE_fcurve_copy (const FCurve *fcu)
 
void BKE_fcurves_copy (ListBase *dst, ListBase *src)
 
void BKE_fcurve_foreach_id (FCurve *fcu, LibraryForeachIDData *data)
 
FCurveid_data_find_fcurve (ID *id, void *data, StructRNA *type, const char *prop_name, int index, bool *r_driven)
 
FCurveBKE_fcurve_find (ListBase *list, const char rna_path[], const int array_index)
 
FCurve Iteration
FCurveBKE_fcurve_iter_step (FCurve *fcu_iter, const char rna_path[])
 
int BKE_fcurves_filter (ListBase *dst, ListBase *src, const char *dataPrefix, const char *dataName)
 
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, PointerRNA *ptr, PropertyRNA *prop, int rnaindex, AnimData **r_animdata, bAction **r_action, bool *r_driven, bool *r_special)
 
Finding Keyframes/Extents
static int BKE_fcurve_bezt_binarysearch_index_ex (BezTriple array[], float frame, int arraylen, float threshold, bool *r_replace)
 
int BKE_fcurve_bezt_binarysearch_index (BezTriple array[], float frame, int arraylen, bool *r_replace)
 
static short get_fcurve_end_keyframes (FCurve *fcu, BezTriple **first, BezTriple **last, const bool do_sel_only)
 
bool BKE_fcurve_calc_bounds (FCurve *fcu, float *xmin, float *xmax, float *ymin, float *ymax, const bool do_sel_only, const bool include_handles)
 
bool BKE_fcurve_calc_range (FCurve *fcu, float *start, float *end, const bool do_sel_only, const bool do_min_length)
 
floatBKE_fcurves_calc_keyed_frames_ex (FCurve **fcurve_array, int fcurve_array_len, const float interval, int *r_frames_len)
 
floatBKE_fcurves_calc_keyed_frames (FCurve **fcurve_array, int fcurve_array_len, int *r_frames_len)
 
Active Keyframe
void BKE_fcurve_active_keyframe_set (FCurve *fcu, const BezTriple *active_bezt)
 
int BKE_fcurve_active_keyframe_index (const FCurve *fcu)
 
Status Checks
bool BKE_fcurve_are_keyframes_usable (FCurve *fcu)
 
bool BKE_fcurve_is_protected (FCurve *fcu)
 
bool BKE_fcurve_is_keyframable (FCurve *fcu)
 
Keyframe Column Tools
static void UNUSED_FUNCTION() bezt_add_to_cfra_elem (ListBase *lb, BezTriple *bezt)
 
Samples Utilities
float fcurve_samplingcb_evalcurve (FCurve *fcu, void *UNUSED(data), float evaltime)
 
void fcurve_store_samples (FCurve *fcu, void *data, int start, int end, FcuSampleFunc sample_cb)
 
static void init_unbaked_bezt_data (BezTriple *bezt)
 
void fcurve_samples_to_keyframes (FCurve *fcu, const int start, const int end)
 
eFCU_Cycle_Type BKE_fcurve_get_cycle_type (FCurve *fcu)
 
bool BKE_fcurve_is_cyclic (FCurve *fcu)
 
static BezTriplecycle_offset_triple (bool cycle, BezTriple *out, const BezTriple *in, const BezTriple *from, const BezTriple *to)
 
void calchandles_fcurve_ex (FCurve *fcu, eBezTriple_Flag handle_sel_flag)
 
void calchandles_fcurve (FCurve *fcu)
 
void testhandles_fcurve (FCurve *fcu, eBezTriple_Flag sel_flag, const bool use_handle)
 
void sort_time_fcurve (FCurve *fcu)
 
bool test_time_fcurve (FCurve *fcu)
 
F-Curve Calculations
void BKE_fcurve_correct_bezpart (const float v1[2], float v2[2], float v3[2], const float v4[2])
 
static int solve_cubic (double c0, double c1, double c2, double c3, float *o)
 
static int findzero (float x, float q0, float q1, float q2, float q3, float *o)
 
static void berekeny (float f1, float f2, float f3, float f4, float *o, int b)
 
bool BKE_fcurve_bezt_subdivide_handles (struct BezTriple *bezt, struct BezTriple *prev, struct BezTriple *next, float *r_pdelta)
 
F-Curve Evaluation
static float fcurve_eval_keyframes_extrapolate (FCurve *fcu, BezTriple *bezts, float evaltime, int endpoint_offset, int direction_to_neighbor)
 
static float fcurve_eval_keyframes_interpolate (FCurve *fcu, BezTriple *bezts, float evaltime)
 
static float fcurve_eval_keyframes (FCurve *fcu, BezTriple *bezts, float evaltime)
 
static float fcurve_eval_samples (FCurve *fcu, FPoint *fpts, float evaltime)
 
F-Curve - Evaluation
static float evaluate_fcurve_ex (FCurve *fcu, float evaltime, float cvalue)
 
float evaluate_fcurve (FCurve *fcu, float evaltime)
 
float evaluate_fcurve_only_curve (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 (FCurve *fcu)
 
float calculate_fcurve (PathResolvedRNA *anim_rna, FCurve *fcu, const AnimationEvalContext *anim_eval_context)
 
F-Curve - .blend file API
void BKE_fmodifiers_blend_write (BlendWriter *writer, ListBase *fmodifiers)
 
void BKE_fmodifiers_blend_read_data (BlendDataReader *reader, ListBase *fmodifiers, FCurve *curve)
 
void BKE_fmodifiers_blend_read_lib (BlendLibReader *reader, ID *id, ListBase *fmodifiers)
 
void BKE_fmodifiers_blend_read_expand (BlendExpander *expander, ListBase *fmodifiers)
 
void BKE_fcurve_blend_write (BlendWriter *writer, ListBase *fcurves)
 
void BKE_fcurve_blend_read_data (BlendDataReader *reader, ListBase *fcurves)
 
void BKE_fcurve_blend_read_lib (BlendLibReader *reader, ID *id, ListBase *fcurves)
 
void BKE_fcurve_blend_read_expand (BlendExpander *expander, ListBase *fcurves)
 

Variables

static CLG_LogRef LOG = {"bke.fcurve"}
 

Macro Definition Documentation

◆ SELECT

#define SELECT   1

Definition at line 60 of file fcurve.c.

◆ SMALL

#define SMALL   -1.0e-10

Definition at line 59 of file fcurve.c.

Function Documentation

◆ berekeny()

static void berekeny ( float  f1,
float  f2,
float  f3,
float  f4,
float o,
int  b 
)
static

Definition at line 1690 of file fcurve.c.

References Freestyle::a, and t.

Referenced by fcurve_eval_keyframes_interpolate().

◆ bezt_add_to_cfra_elem()

static void UNUSED_FUNCTION() bezt_add_to_cfra_elem ( ListBase lb,
BezTriple bezt 
)
static

◆ BKE_fcurve_active_keyframe_index()

int BKE_fcurve_active_keyframe_index ( const FCurve fcu)

Get the active keyframe index, with sanity checks for point bounds.

Definition at line 926 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.

◆ 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 902 of file fcurve.c.

References FCurve::active_keyframe_index, FCurve::bezt, BEZT_ISSEL_ANY, BLI_assert, FCURVE_ACTIVE_KEYFRAME_NONE, NULL, and FCurve::totvert.

◆ BKE_fcurve_are_keyframes_usable()

bool BKE_fcurve_are_keyframes_usable ( FCurve fcu)

◆ BKE_fcurve_bezt_binarysearch_index()

int BKE_fcurve_bezt_binarysearch_index ( BezTriple  array[],
float  frame,
int  arraylen,
bool *  r_replace 
)

◆ BKE_fcurve_bezt_binarysearch_index_ex()

static int BKE_fcurve_bezt_binarysearch_index_ex ( BezTriple  array[],
float  frame,
int  arraylen,
float  threshold,
bool *  r_replace 
)
static

Definition at line 513 of file fcurve.c.

References CLOG_ERROR, CLOG_WARN, IS_EQT, LOG, and NULL.

Referenced by BKE_fcurve_bezt_binarysearch_index(), and fcurve_eval_keyframes_interpolate().

◆ BKE_fcurve_bezt_subdivide_handles()

bool BKE_fcurve_bezt_subdivide_handles ( struct BezTriple bezt,
struct BezTriple prev,
struct BezTriple next,
float r_pdelta 
)

Adjust 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 1714 of file fcurve.c.

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

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

◆ BKE_fcurve_blend_read_data()

void BKE_fcurve_blend_read_data ( BlendDataReader reader,
ListBase fcurves 
)

◆ BKE_fcurve_blend_read_expand()

void BKE_fcurve_blend_read_expand ( BlendExpander expander,
ListBase fcurves 
)

◆ BKE_fcurve_blend_read_lib()

void BKE_fcurve_blend_read_lib ( BlendLibReader reader,
ID id,
ListBase fcurves 
)

◆ BKE_fcurve_blend_write()

void BKE_fcurve_blend_write ( BlendWriter writer,
ListBase fcurves 
)

◆ BKE_fcurve_calc_bounds()

bool BKE_fcurve_calc_bounds ( FCurve fcu,
float xmin,
float xmax,
float ymin,
float ymax,
const bool  do_sel_only,
const bool  include_handles 
)

◆ BKE_fcurve_calc_range()

bool BKE_fcurve_calc_range ( FCurve fcu,
float start,
float end,
const bool  do_sel_only,
const bool  do_min_length 
)

◆ BKE_fcurve_copy()

FCurve* BKE_fcurve_copy ( const FCurve fcu)

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

◆ BKE_fcurve_create()

FCurve* BKE_fcurve_create ( void  )

◆ BKE_fcurve_find()

FCurve* BKE_fcurve_find ( ListBase list,
const char  rna_path[],
const 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 
)

Definition at line 378 of file fcurve.c.

References BKE_fcurve_find_by_rna_context_ui(), NULL, and ptr.

Referenced by RNA_property_animated().

◆ BKE_fcurve_find_by_rna_context_ui()

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

◆ BKE_fcurve_foreach_id()

void BKE_fcurve_foreach_id ( FCurve fcu,
LibraryForeachIDData data 
)

◆ BKE_fcurve_free()

void BKE_fcurve_free ( FCurve fcu)

◆ BKE_fcurve_get_cycle_type()

eFCU_Cycle_Type BKE_fcurve_get_cycle_type ( FCurve fcu)

◆ BKE_fcurve_is_cyclic()

bool BKE_fcurve_is_cyclic ( FCurve fcu)

◆ BKE_fcurve_is_empty()

bool BKE_fcurve_is_empty ( FCurve fcu)

◆ BKE_fcurve_is_keyframable()

bool BKE_fcurve_is_keyframable ( FCurve fcu)

◆ BKE_fcurve_is_protected()

bool BKE_fcurve_is_protected ( FCurve fcu)

◆ BKE_fcurve_iter_step()

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

Definition at line 304 of file fcurve.c.

References ELEM, FCurve::next, NULL, FCurve::rna_path, and STREQ.

Referenced by ANIM_remove_driver().

◆ BKE_fcurve_keyframe_move_value_with_handles()

void BKE_fcurve_keyframe_move_value_with_handles ( struct BezTriple keyframe,
const float  new_value 
)

Definition at line 947 of file fcurve.c.

References BezTriple::vec.

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

◆ 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 885 of file fcurve.c.

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,
const 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 850 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().

◆ BKE_fcurves_copy()

void BKE_fcurves_copy ( ListBase dst,
ListBase src 
)

◆ BKE_fcurves_filter()

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.

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 336 of file fcurve.c.

References BLI_addtail(), BLI_str_quoted_substrN(), LinkData::data, ELEM, ListBase::first, MEM_callocN, MEM_freeN, FCurve::next, NULL, FCurve::rna_path, and STREQ.

Referenced by updateDuplicateActionConstraintSettings().

◆ BKE_fcurves_free()

void BKE_fcurves_free ( ListBase list)

◆ BKE_fmodifiers_blend_read_data()

void BKE_fmodifiers_blend_read_data ( BlendDataReader reader,
ListBase fmodifiers,
FCurve curve 
)

◆ BKE_fmodifiers_blend_read_expand()

void BKE_fmodifiers_blend_read_expand ( BlendExpander expander,
ListBase fmodifiers 
)

◆ BKE_fmodifiers_blend_read_lib()

void BKE_fmodifiers_blend_read_lib ( BlendLibReader reader,
ID id,
ListBase fmodifiers 
)

Definition at line 2369 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().

◆ BKE_fmodifiers_blend_write()

void BKE_fmodifiers_blend_write ( BlendWriter writer,
ListBase fmodifiers 
)

◆ calchandles_fcurve()

void calchandles_fcurve ( FCurve fcu)

◆ calchandles_fcurve_ex()

void calchandles_fcurve_ex ( FCurve fcu,
eBezTriple_Flag  handle_sel_flag 
)

Variant of calchandles_fcurve() 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 1302 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, FCurve::totvert, and BezTriple::vec.

Referenced by action_flip_pchan(), calchandles_fcurve(), and testhandles_fcurve().

◆ calculate_fcurve()

float calculate_fcurve ( PathResolvedRNA anim_rna,
FCurve fcu,
const AnimationEvalContext anim_eval_context 
)

◆ cycle_offset_triple()

static BezTriple* cycle_offset_triple ( bool  cycle,
BezTriple out,
const BezTriple in,
const BezTriple from,
const BezTriple to 
)
static

Definition at line 1276 of file fcurve.c.

References add_v3_v3(), from, NULL, sub_v3_v3v3(), and BezTriple::vec.

Referenced by calchandles_fcurve_ex().

◆ evaluate_fcurve()

float evaluate_fcurve ( FCurve fcu,
float  evaltime 
)

◆ evaluate_fcurve_driver()

float evaluate_fcurve_driver ( PathResolvedRNA anim_rna,
FCurve fcu,
ChannelDriver driver_orig,
const AnimationEvalContext anim_eval_context 
)

◆ evaluate_fcurve_ex()

static float evaluate_fcurve_ex ( FCurve fcu,
float  evaltime,
float  cvalue 
)
static

◆ evaluate_fcurve_only_curve()

float evaluate_fcurve_only_curve ( FCurve fcu,
float  evaltime 
)

◆ fcurve_eval_keyframes()

static float fcurve_eval_keyframes ( FCurve fcu,
BezTriple bezts,
float  evaltime 
)
static

◆ fcurve_eval_keyframes_extrapolate()

static float fcurve_eval_keyframes_extrapolate ( FCurve fcu,
BezTriple bezts,
float  evaltime,
int  endpoint_offset,
int  direction_to_neighbor 
)
static

◆ fcurve_eval_keyframes_interpolate()

static float fcurve_eval_keyframes_interpolate ( FCurve fcu,
BezTriple bezts,
float  evaltime 
)
static

Definition at line 1828 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().

◆ fcurve_eval_samples()

static float fcurve_eval_samples ( FCurve fcu,
FPoint fpts,
float  evaltime 
)
static

Definition at line 2105 of file fcurve.c.

References evaltime, fabsf, floorf, interpf(), t, FCurve::totvert, and FPoint::vec.

Referenced by evaluate_fcurve_ex().

◆ fcurve_samples_to_keyframes()

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

◆ fcurve_samplingcb_evalcurve()

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

Definition at line 1099 of file fcurve.c.

References evaltime, and evaluate_fcurve().

◆ fcurve_store_samples()

void fcurve_store_samples ( FCurve fcu,
void *  data,
int  start,
int  end,
FcuSampleFunc  sample_cb 
)

◆ findzero()

static int findzero ( float  x,
float  q0,
float  q1,
float  q2,
float  q3,
float o 
)
static

Definition at line 1680 of file fcurve.c.

References q1, solve_cubic(), and x.

Referenced by BKE_fcurve_bezt_subdivide_handles(), and fcurve_eval_keyframes_interpolate().

◆ get_fcurve_end_keyframes()

static short get_fcurve_end_keyframes ( FCurve fcu,
BezTriple **  first,
BezTriple **  last,
const bool  do_sel_only 
)
static

◆ id_data_find_fcurve()

FCurve* id_data_find_fcurve ( ID id,
void *  data,
StructRNA type,
const char *  prop_name,
int  index,
bool *  r_driven 
)

◆ init_unbaked_bezt_data()

static void init_unbaked_bezt_data ( BezTriple bezt)
static

◆ solve_cubic()

static int solve_cubic ( double  c0,
double  c1,
double  c2,
double  c3,
float o 
)
static

Find roots of cubic equation (c0 x³ + c1 x² + c2 x + c3)

Returns
number of roots in o.
Note
it is up to the caller to allocate enough memory for o.

Definition at line 1568 of file fcurve.c.

References Freestyle::a, KDL::acos(), Freestyle::c, KDL::cos(), float(), SMALL, sqrt(), sqrt3d(), and t.

Referenced by findzero().

◆ sort_time_fcurve()

void sort_time_fcurve ( FCurve fcu)

◆ test_time_fcurve()

bool test_time_fcurve ( FCurve fcu)

◆ testhandles_fcurve()

void testhandles_fcurve ( FCurve fcu,
eBezTriple_Flag  sel_flag,
const 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 1407 of file fcurve.c.

References Freestyle::a, FCurve::bezt, BKE_nurb_bezt_handle_test(), calchandles_fcurve_ex(), ELEM, and NULL.

Referenced by posttrans_fcurve_clean(), and remake_graph_transdata().

Variable Documentation

◆ LOG

CLG_LogRef LOG = {"bke.fcurve"}
static