Blender  V3.3
Classes | Typedefs | Enumerations
ED_keyframes_edit.h File Reference
#include "ED_anim_api.h"

Go to the source code of this file.

Classes

struct  KeyframeEdit_LassoData
 
struct  KeyframeEdit_CircleData
 
struct  KeyframeEditData
 
struct  KeyframeEditCD_Remap
 
struct  FCurveSegment
 

Typedefs

typedef enum eEditKeyframes_Select eEditKeyframes_Select
 
typedef enum eEditKeyframes_SelMap eEditKeyframes_SelMap
 
typedef enum eEditKeyframes_Snap eEditKeyframes_Snap
 
typedef enum eEditKeyframes_Equalize eEditKeyframes_Equalize
 
typedef enum eEditKeyframes_Mirror eEditKeyframes_Mirror
 
typedef struct KeyframeEdit_LassoData KeyframeEdit_LassoData
 
typedef struct KeyframeEdit_CircleData KeyframeEdit_CircleData
 
Generic Properties for Keyframe Edit Tools
typedef struct KeyframeEditData KeyframeEditData
 
Function Pointer Typedefs
typedef void(* FcuEditFunc) (struct FCurve *fcu)
 
typedef short(* KeyframeEditFunc) (KeyframeEditData *ked, struct BezTriple *bezt)
 

Enumerations

enum  eEditKeyframes_Select { SELECT_REPLACE = (1 << 0) , SELECT_ADD = (1 << 1) , SELECT_SUBTRACT = (1 << 2) , SELECT_INVERT = (1 << 3) }
 
enum  eEditKeyframes_SelMap { SELMAP_MORE = 0 , SELMAP_LESS }
 
enum  eEditKeyframes_Snap {
  SNAP_KEYS_CURFRAME = 1 , SNAP_KEYS_NEARFRAME , SNAP_KEYS_NEARSEC , SNAP_KEYS_NEARMARKER ,
  SNAP_KEYS_HORIZONTAL , SNAP_KEYS_VALUE , SNAP_KEYS_TIME
}
 
enum  eEditKeyframes_Equalize { EQUALIZE_HANDLES_LEFT = (1 << 0) , EQUALIZE_HANDLES_RIGHT = (1 << 1) , EQUALIZE_HANDLES_BOTH = (EQUALIZE_HANDLES_LEFT | EQUALIZE_HANDLES_RIGHT) }
 
enum  eEditKeyframes_Mirror {
  MIRROR_KEYS_CURFRAME = 1 , MIRROR_KEYS_YAXIS , MIRROR_KEYS_XAXIS , MIRROR_KEYS_MARKER ,
  MIRROR_KEYS_VALUE , MIRROR_KEYS_TIME
}
 

Functions

Looping API

Functions for looping over keyframes.

short ANIM_fcurve_keyframes_loop (KeyframeEditData *ked, struct FCurve *fcu, KeyframeEditFunc key_ok, KeyframeEditFunc key_cb, FcuEditFunc fcu_cb)
 
void ANIM_fcurve_equalize_keyframes_loop (struct FCurve *fcu, eEditKeyframes_Equalize mode, float handle_length, bool flatten)
 
short ANIM_animchannel_keyframes_loop (KeyframeEditData *ked, struct bDopeSheet *ads, struct bAnimListElem *ale, KeyframeEditFunc key_ok, KeyframeEditFunc key_cb, FcuEditFunc fcu_cb)
 
short ANIM_animchanneldata_keyframes_loop (KeyframeEditData *ked, struct bDopeSheet *ads, void *data, int keytype, KeyframeEditFunc key_ok, KeyframeEditFunc key_cb, FcuEditFunc fcu_cb)
 
void ANIM_animdata_keyframe_callback (struct bAnimContext *ac, eAnimFilter_Flags filter, KeyframeEditFunc callback_fn)
 
void ANIM_editkeyframes_refresh (struct bAnimContext *ac)
 
BezTriple Callback Getters
KeyframeEditFunc ANIM_editkeyframes_ok (short mode)
 
KeyframeEditFunc ANIM_editkeyframes_snap (short mode)
 
KeyframeEditFunc ANIM_editkeyframes_mirror (short mode)
 
KeyframeEditFunc ANIM_editkeyframes_select (short mode)
 
KeyframeEditFunc ANIM_editkeyframes_handles (short mode)
 
KeyframeEditFunc ANIM_editkeyframes_ipo (short mode)
 
KeyframeEditFunc ANIM_editkeyframes_keytype (short mode)
 
KeyframeEditFunc ANIM_editkeyframes_easing (short mode)
 
BezTriple Callbacks (Selection Map)
KeyframeEditFunc ANIM_editkeyframes_buildselmap (short mode)
 
short bezt_selmap_flush (KeyframeEditData *ked, struct BezTriple *bezt)
 
BezTriple Callback (Assorted Utilities)
short bezt_calc_average (KeyframeEditData *ked, struct BezTriple *bezt)
 
short bezt_to_cfraelem (KeyframeEditData *ked, struct BezTriple *bezt)
 
void bezt_remap_times (KeyframeEditData *ked, struct BezTriple *bezt)
 

Tool Flags

enum  eEditKeyframes_Validate {
  BEZT_OK_FRAME = 1 , BEZT_OK_FRAMERANGE , BEZT_OK_SELECTED , BEZT_OK_VALUE ,
  BEZT_OK_VALUERANGE , BEZT_OK_REGION , BEZT_OK_REGION_LASSO , BEZT_OK_REGION_CIRCLE ,
  BEZT_OK_CHANNEL_LASSO , BEZT_OK_CHANNEL_CIRCLE
}
 
typedef enum eEditKeyframes_Validate eEditKeyframes_Validate
 

Defines for 'OK' polls + KeyframeEditData Flags

enum  eKeyframeVertOk { KEYFRAME_OK_KEY = (1 << 0) , KEYFRAME_OK_H1 = (1 << 1) , KEYFRAME_OK_H2 = (1 << 2) , KEYFRAME_OK_ALL = (KEYFRAME_OK_KEY | KEYFRAME_OK_H1 | KEYFRAME_OK_H2) }
 
enum  eKeyframeIterFlags { KEYFRAME_ITER_INCL_HANDLES = (1 << 0) , KED_F1_NLA_UNMAP = (1 << 1) , KED_F2_NLA_UNMAP = (1 << 2) , KEYFRAME_ITER_HANDLES_DEFAULT_INVISIBLE = (1 << 3) }
 
typedef enum eKeyframeVertOk eKeyframeVertOk
 
typedef enum eKeyframeIterFlags eKeyframeIterFlags
 

Custom Data Type Defines

enum  eKeyPasteOffset { KEYFRAME_PASTE_OFFSET_CFRA_START , KEYFRAME_PASTE_OFFSET_CFRA_END , KEYFRAME_PASTE_OFFSET_CFRA_RELATIVE , KEYFRAME_PASTE_OFFSET_NONE }
 
enum  eKeyMergeMode { KEYFRAME_PASTE_MERGE_MIX , KEYFRAME_PASTE_MERGE_OVER , KEYFRAME_PASTE_MERGE_OVER_RANGE , KEYFRAME_PASTE_MERGE_OVER_RANGE_ALL }
 
enum  eKeyPasteError { KEYFRAME_PASTE_OK , KEYFRAME_PASTE_NOTHING_TO_PASTE , KEYFRAME_PASTE_NOWHERE_TO_PASTE }
 
typedef struct KeyframeEditCD_Remap KeyframeEditCD_Remap
 
typedef enum eKeyPasteOffset eKeyPasteOffset
 
typedef enum eKeyMergeMode eKeyMergeMode
 
typedef enum eKeyPasteError eKeyPasteError
 

1.5-D Region Testing Utilities (Lasso/Circle Select)

typedef struct FCurveSegment FCurveSegment
 
bool keyframe_region_lasso_test (const KeyframeEdit_LassoData *data_lasso, const float xy[2])
 
bool keyframe_region_circle_test (const KeyframeEdit_CircleData *data_circle, const float xy[2])
 
bool duplicate_fcurve_keys (struct FCurve *fcu)
 
float get_default_rna_value (struct FCurve *fcu, struct PropertyRNA *prop, struct PointerRNA *ptr)
 
ListBase find_fcurve_segments (struct FCurve *fcu)
 
void clean_fcurve (struct bAnimContext *ac, struct bAnimListElem *ale, float thresh, bool cleardefault)
 
void blend_to_neighbor_fcurve_segment (struct FCurve *fcu, struct FCurveSegment *segment, float factor)
 
void breakdown_fcurve_segment (struct FCurve *fcu, struct FCurveSegment *segment, float factor)
 
bool decimate_fcurve (struct bAnimListElem *ale, float remove_ratio, float error_sq_max)
 
void blend_to_default_fcurve (struct PointerRNA *id_ptr, struct FCurve *fcu, float factor)
 
void smooth_fcurve (struct FCurve *fcu)
 
void sample_fcurve (struct FCurve *fcu)
 
void ANIM_fcurves_copybuf_free (void)
 
short copy_animedit_keys (struct bAnimContext *ac, ListBase *anim_data)
 
eKeyPasteError paste_animedit_keys (struct bAnimContext *ac, ListBase *anim_data, eKeyPasteOffset offset_mode, eKeyMergeMode merge_mode, bool flip)
 

Typedef Documentation

◆ eEditKeyframes_Equalize

◆ eEditKeyframes_Mirror

◆ eEditKeyframes_Select

◆ eEditKeyframes_SelMap

◆ eEditKeyframes_Snap

◆ eEditKeyframes_Validate

◆ eKeyframeIterFlags

◆ eKeyframeVertOk

◆ eKeyMergeMode

◆ eKeyPasteError

◆ eKeyPasteOffset

◆ FcuEditFunc

typedef void(* FcuEditFunc) (struct FCurve *fcu)

Definition at line 193 of file ED_keyframes_edit.h.

◆ FCurveSegment

typedef struct FCurveSegment FCurveSegment

◆ KeyframeEdit_CircleData

◆ KeyframeEdit_LassoData

◆ KeyframeEditCD_Remap

◆ KeyframeEditData

◆ KeyframeEditFunc

typedef short(* KeyframeEditFunc) (KeyframeEditData *ked, struct BezTriple *bezt)

Definition at line 195 of file ED_keyframes_edit.h.

Enumeration Type Documentation

◆ eEditKeyframes_Equalize

Enumerator
EQUALIZE_HANDLES_LEFT 
EQUALIZE_HANDLES_RIGHT 
EQUALIZE_HANDLES_BOTH 

Definition at line 81 of file ED_keyframes_edit.h.

◆ eEditKeyframes_Mirror

Enumerator
MIRROR_KEYS_CURFRAME 
MIRROR_KEYS_YAXIS 
MIRROR_KEYS_XAXIS 
MIRROR_KEYS_MARKER 
MIRROR_KEYS_VALUE 
MIRROR_KEYS_TIME 

Definition at line 88 of file ED_keyframes_edit.h.

◆ eEditKeyframes_Select

Enumerator
SELECT_REPLACE 
SELECT_ADD 
SELECT_SUBTRACT 
SELECT_INVERT 

Definition at line 52 of file ED_keyframes_edit.h.

◆ eEditKeyframes_SelMap

Enumerator
SELMAP_MORE 
SELMAP_LESS 

Definition at line 64 of file ED_keyframes_edit.h.

◆ eEditKeyframes_Snap

Enumerator
SNAP_KEYS_CURFRAME 
SNAP_KEYS_NEARFRAME 
SNAP_KEYS_NEARSEC 
SNAP_KEYS_NEARMARKER 
SNAP_KEYS_HORIZONTAL 
SNAP_KEYS_VALUE 
SNAP_KEYS_TIME 

Definition at line 70 of file ED_keyframes_edit.h.

◆ eEditKeyframes_Validate

Enumerator
BEZT_OK_FRAME 
BEZT_OK_FRAMERANGE 
BEZT_OK_SELECTED 
BEZT_OK_VALUE 
BEZT_OK_VALUERANGE 
BEZT_OK_REGION 
BEZT_OK_REGION_LASSO 
BEZT_OK_REGION_CIRCLE 
BEZT_OK_CHANNEL_LASSO 
BEZT_OK_CHANNEL_CIRCLE 

Definition at line 31 of file ED_keyframes_edit.h.

◆ eKeyframeIterFlags

Enumerator
KEYFRAME_ITER_INCL_HANDLES 
KED_F1_NLA_UNMAP 
KED_F2_NLA_UNMAP 
KEYFRAME_ITER_HANDLES_DEFAULT_INVISIBLE 

Definition at line 133 of file ED_keyframes_edit.h.

◆ eKeyframeVertOk

Enumerator
KEYFRAME_OK_KEY 
KEYFRAME_OK_H1 
KEYFRAME_OK_H2 
KEYFRAME_OK_ALL 

Definition at line 121 of file ED_keyframes_edit.h.

◆ eKeyMergeMode

Enumerator
KEYFRAME_PASTE_MERGE_MIX 
KEYFRAME_PASTE_MERGE_OVER 
KEYFRAME_PASTE_MERGE_OVER_RANGE 
KEYFRAME_PASTE_MERGE_OVER_RANGE_ALL 

Definition at line 221 of file ED_keyframes_edit.h.

◆ eKeyPasteError

Enumerator
KEYFRAME_PASTE_OK 
KEYFRAME_PASTE_NOTHING_TO_PASTE 
KEYFRAME_PASTE_NOWHERE_TO_PASTE 

Definition at line 233 of file ED_keyframes_edit.h.

◆ eKeyPasteOffset

Enumerator
KEYFRAME_PASTE_OFFSET_CFRA_START 
KEYFRAME_PASTE_OFFSET_CFRA_END 
KEYFRAME_PASTE_OFFSET_CFRA_RELATIVE 
KEYFRAME_PASTE_OFFSET_NONE 

Definition at line 210 of file ED_keyframes_edit.h.

Function Documentation

◆ ANIM_animchannel_keyframes_loop()

short ANIM_animchannel_keyframes_loop ( KeyframeEditData ked,
struct bDopeSheet ads,
struct bAnimListElem ale,
KeyframeEditFunc  key_ok,
KeyframeEditFunc  key_cb,
FcuEditFunc  fcu_cb 
)

◆ ANIM_animchanneldata_keyframes_loop()

short ANIM_animchanneldata_keyframes_loop ( KeyframeEditData ked,
struct bDopeSheet ads,
void data,
int  keytype,
KeyframeEditFunc  key_ok,
KeyframeEditFunc  key_cb,
FcuEditFunc  fcu_cb 
)

◆ ANIM_animdata_keyframe_callback()

void ANIM_animdata_keyframe_callback ( struct bAnimContext ac,
eAnimFilter_Flags  filter,
KeyframeEditFunc  callback_fn 
)

◆ ANIM_editkeyframes_buildselmap()

KeyframeEditFunc ANIM_editkeyframes_buildselmap ( short  mode)

Get a callback to populate the selection settings map requires: ked->custom = char[] of length fcurve->totvert.

Definition at line 1662 of file keyframes_edit.c.

References selmap_build_bezier_less(), selmap_build_bezier_more(), SELMAP_LESS, and SELMAP_MORE.

Referenced by select_moreless_action_keys(), and select_moreless_graph_keys().

◆ ANIM_editkeyframes_easing()

KeyframeEditFunc ANIM_editkeyframes_easing ( short  mode)

◆ ANIM_editkeyframes_handles()

KeyframeEditFunc ANIM_editkeyframes_handles ( short  mode)

◆ ANIM_editkeyframes_ipo()

KeyframeEditFunc ANIM_editkeyframes_ipo ( short  mode)

◆ ANIM_editkeyframes_keytype()

KeyframeEditFunc ANIM_editkeyframes_keytype ( short  mode)

◆ ANIM_editkeyframes_mirror()

KeyframeEditFunc ANIM_editkeyframes_mirror ( short  mode)

◆ ANIM_editkeyframes_ok()

KeyframeEditFunc ANIM_editkeyframes_ok ( short  mode)

◆ ANIM_editkeyframes_refresh()

void ANIM_editkeyframes_refresh ( struct bAnimContext ac)

◆ ANIM_editkeyframes_select()

KeyframeEditFunc ANIM_editkeyframes_select ( short  mode)

◆ ANIM_editkeyframes_snap()

KeyframeEditFunc ANIM_editkeyframes_snap ( short  mode)

◆ ANIM_fcurve_equalize_keyframes_loop()

void ANIM_fcurve_equalize_keyframes_loop ( struct FCurve fcu,
eEditKeyframes_Equalize  mode,
float  handle_length,
bool  flatten 
)

Sets selected keyframes' bezier handles to an equal length and optionally makes the keyframes' handles horizontal.

Parameters
handle_lengthDesired handle length, must be positive.
flattenMakes the keyframes' handles the same value as the keyframe, flattening the curve at that point.

Definition at line 1288 of file keyframes_edit.c.

References FCurve::bezt, ELEM, EQUALIZE_HANDLES_LEFT, EQUALIZE_HANDLES_RIGHT, BezTriple::f2, BezTriple::h1, BezTriple::h2, handle_flatten(), handle_set_length(), HD_ALIGN, HD_AUTO, HD_AUTO_ANIM, HD_VECT, SELECT, and BezTriple::vec.

Referenced by equalize_graph_keys().

◆ ANIM_fcurve_keyframes_loop()

short ANIM_fcurve_keyframes_loop ( KeyframeEditData ked,
struct FCurve fcu,
KeyframeEditFunc  key_ok,
KeyframeEditFunc  key_cb,
FcuEditFunc  fcu_cb 
)

◆ ANIM_fcurves_copybuf_free()

void ANIM_fcurves_copybuf_free ( void  )

◆ bezt_calc_average()

short bezt_calc_average ( KeyframeEditData ked,
struct BezTriple bezt 
)

Used to calculate the average location of all relevant BezTriples by summing their locations.

Definition at line 760 of file keyframes_edit.c.

References KeyframeEditData::f1, KeyframeEditData::f2, BezTriple::f2, KeyframeEditData::i1, SELECT, and BezTriple::vec.

Referenced by actkeys_framejump_exec(), and sum_selected_keyframes().

◆ bezt_remap_times()

void bezt_remap_times ( KeyframeEditData ked,
struct BezTriple bezt 
)

Used to remap times from one range to another. requires: ked->custom = KeyframeEditCD_Remap.

Definition at line 792 of file keyframes_edit.c.

References KeyframeEditData::data, KeyframeEditCD_Remap::newMax, KeyframeEditCD_Remap::newMin, KeyframeEditCD_Remap::oldMax, KeyframeEditCD_Remap::oldMin, and BezTriple::vec.

◆ bezt_selmap_flush()

short bezt_selmap_flush ( KeyframeEditData ked,
struct BezTriple bezt 
)

Change the selection status of the keyframe based on the map entry for this vert requires: ked->custom = char[] of length fcurve->totvert.

Definition at line 1676 of file keyframes_edit.c.

References BEZT_DESEL_ALL, BEZT_SEL_ALL, KeyframeEditData::curIndex, KeyframeEditData::data, and map.

Referenced by select_moreless_action_keys(), and select_moreless_graph_keys().

◆ bezt_to_cfraelem()

short bezt_to_cfraelem ( KeyframeEditData ked,
struct BezTriple bezt 
)

Used to extract a set of cfra-elems from the keyframes.

Definition at line 779 of file keyframes_edit.c.

References BLI_addtail(), CfraElem::cfra, BezTriple::f2, KeyframeEditData::list, MEM_callocN, SELECT, and BezTriple::vec.

Referenced by columnselect_action_keys(), and columnselect_graph_keys().

◆ blend_to_default_fcurve()

void blend_to_default_fcurve ( struct PointerRNA id_ptr,
struct FCurve fcu,
float  factor 
)

◆ blend_to_neighbor_fcurve_segment()

void blend_to_neighbor_fcurve_segment ( struct FCurve fcu,
struct FCurveSegment segment,
float  factor 
)

◆ breakdown_fcurve_segment()

void breakdown_fcurve_segment ( struct FCurve fcu,
struct FCurveSegment segment,
float  factor 
)

◆ clean_fcurve()

void clean_fcurve ( struct bAnimContext ac,
struct bAnimListElem ale,
float  thresh,
bool  cleardefault 
)

◆ copy_animedit_keys()

short copy_animedit_keys ( struct bAnimContext ac,
ListBase anim_data 
)

◆ decimate_fcurve()

bool decimate_fcurve ( struct bAnimListElem ale,
float  remove_ratio,
float  error_sq_max 
)

◆ duplicate_fcurve_keys()

bool duplicate_fcurve_keys ( struct FCurve fcu)

◆ find_fcurve_segments()

ListBase find_fcurve_segments ( struct FCurve fcu)

Return a list of FCurveSegment with a start index and a length. A segment is a continuous selection of keyframes. Keys that have BEZT_FLAG_IGNORE_TAG set are treated as unselected. The caller is responsible for freeing the memory.

Definition at line 267 of file keyframes_general.c.

References BLI_addtail(), find_fcurve_segment(), MEM_callocN, and NULL.

Referenced by blend_to_neighbor_graph_keys(), breakdown_graph_keys(), and decimate_fcurve().

◆ get_default_rna_value()

float get_default_rna_value ( struct FCurve fcu,
struct PropertyRNA prop,
struct PointerRNA ptr 
)

◆ keyframe_region_circle_test()

bool keyframe_region_circle_test ( const KeyframeEdit_CircleData data_circle,
const float  xy[2] 
)

◆ keyframe_region_lasso_test()

bool keyframe_region_lasso_test ( const KeyframeEdit_LassoData data_lasso,
const float  xy[2] 
)

◆ paste_animedit_keys()

eKeyPasteError paste_animedit_keys ( struct bAnimContext ac,
ListBase anim_data,
eKeyPasteOffset  offset_mode,
eKeyMergeMode  merge_mode,
bool  flip 
)

◆ sample_fcurve()

void sample_fcurve ( struct FCurve fcu)

◆ smooth_fcurve()

void smooth_fcurve ( struct FCurve fcu)