Blender  V3.3
Classes
ED_keyframing.h File Reference
#include "DNA_anim_types.h"
#include "RNA_types.h"

Go to the source code of this file.

Classes

struct  KeyingSetInfo
 

Functions

Key-Framing Management
eInsertKeyFlags ANIM_get_keyframing_flags (struct Scene *scene, bool use_autokey_mode)
 
struct bActionED_id_action_ensure (struct Main *bmain, struct ID *id)
 
struct FCurveED_action_fcurve_ensure (struct Main *bmain, struct bAction *act, const char group[], struct PointerRNA *ptr, const char rna_path[], int array_index)
 
struct FCurveED_action_fcurve_find (struct bAction *act, const char rna_path[], int array_index)
 
void update_autoflags_fcurve (struct FCurve *fcu, struct bContext *C, struct ReportList *reports, struct PointerRNA *ptr)
 Lesser Key-framing API call. More...
 
int insert_bezt_fcurve (struct FCurve *fcu, const struct BezTriple *bezt, eInsertKeyFlags flag)
 Lesser Key-framing API call. More...
 
int insert_vert_fcurve (struct FCurve *fcu, float x, float y, eBezTriple_KeyframeType keyframe_type, eInsertKeyFlags flag)
 Main Key-framing API call. More...
 
bool insert_keyframe_direct (struct ReportList *reports, struct PointerRNA ptr, struct PropertyRNA *prop, struct FCurve *fcu, const struct AnimationEvalContext *anim_eval_context, eBezTriple_KeyframeType keytype, struct NlaKeyframingContext *nla, eInsertKeyFlags flag)
 Secondary Insert Key-framing API call. More...
 
int insert_keyframe (struct Main *bmain, struct ReportList *reports, struct ID *id, struct bAction *act, const char group[], const char rna_path[], int array_index, const struct AnimationEvalContext *anim_eval_context, eBezTriple_KeyframeType keytype, struct ListBase *nla_cache, eInsertKeyFlags flag)
 Main Insert Key-framing API call. More...
 
int delete_keyframe (struct Main *bmain, struct ReportList *reports, struct ID *id, struct bAction *act, const char rna_path[], int array_index, float cfra)
 Main Delete Key-Framing API call. More...
 

Auto-Key-Framing

Notes:

  • All the defines for this (User-Pref settings and Per-Scene settings) are defined in DNA_userdef_types.h
  • Scene settings take precedence over those for user-preferences, with old files inheriting user-preferences settings for the scene settings
  • "On/Off + Mode" are stored per Scene, but "settings" are currently stored as user-preferences.
#define IS_AUTOKEY_ON(scene)    ((scene) ? ((scene)->toolsettings->autokey_mode & AUTOKEY_ON) : (U.autokey_mode & AUTOKEY_ON))
 
#define IS_AUTOKEY_MODE(scene, mode)
 
#define IS_AUTOKEY_FLAG(scene, flag)
 
bool autokeyframe_cfra_can_key (const struct Scene *scene, struct ID *id)
 

Keyframe Checking

#define ANIM_KS_LOCATION_ID   "Location"
 
#define ANIM_KS_ROTATION_ID   "Rotation"
 
#define ANIM_KS_SCALING_ID   "Scaling"
 
#define ANIM_KS_LOC_ROT_SCALE_ID   "LocRotScale"
 
#define ANIM_KS_LOC_ROT_SCALE_CPROP_ID   "LocRotScaleCProp"
 
#define ANIM_KS_AVAILABLE_ID   "Available"
 
#define ANIM_KS_WHOLE_CHARACTER_ID   "WholeCharacter"
 
#define ANIM_KS_WHOLE_CHARACTER_SELECTED_ID   "WholeCharacterSelected"
 
enum  eAnimFilterFlags {
  ANIMFILTER_KEYS_LOCAL = (1 << 0) , ANIMFILTER_KEYS_MUTED = (1 << 1) , ANIMFILTER_KEYS_ACTIVE = (1 << 2) , ANIMFILTER_KEYS_NOMAT = (1 << 9) ,
  ANIMFILTER_KEYS_NOSKEY = (1 << 10)
}
 
typedef enum eAnimFilterFlags eAnimFilterFlags
 
bool fcurve_frame_has_keyframe (const struct FCurve *fcu, float frame, short filter)
 Lesser Keyframe Checking API call. More...
 
bool fcurve_is_changed (struct PointerRNA ptr, struct PropertyRNA *prop, struct FCurve *fcu, const struct AnimationEvalContext *anim_eval_context)
 Lesser Keyframe Checking API call. More...
 
bool id_frame_has_keyframe (struct ID *id, float frame, short filter)
 Main Keyframe Checking API call. More...
 
bool ED_autokeyframe_object (struct bContext *C, struct Scene *scene, struct Object *ob, struct KeyingSet *ks)
 
bool ED_autokeyframe_pchan (struct bContext *C, struct Scene *scene, struct Object *ob, struct bPoseChannel *pchan, struct KeyingSet *ks)
 
bool ED_autokeyframe_property (struct bContext *C, struct Scene *scene, PointerRNA *ptr, PropertyRNA *prop, int rnaindex, float cfra, bool only_if_property_keyed)
 

Keying Sets

enum  eModifyKey_Modes { MODIFYKEY_MODE_INSERT = 0 , MODIFYKEY_MODE_DELETE }
 
enum  eModifyKey_Returns { MODIFYKEY_INVALID_CONTEXT = -1 , MODIFYKEY_MISSING_TYPEINFO = -2 }
 
typedef bool(* cbKeyingSet_Poll) (struct KeyingSetInfo *ksi, struct bContext *C)
 
typedef void(* cbKeyingSet_Iterator) (struct KeyingSetInfo *ksi, struct bContext *C, struct KeyingSet *ks)
 
typedef void(* cbKeyingSet_Generate) (struct KeyingSetInfo *ksi, struct bContext *C, struct KeyingSet *ks, struct PointerRNA *ptr)
 
typedef struct KeyingSetInfo KeyingSetInfo
 
typedef enum eModifyKey_Modes eModifyKey_Modes
 
typedef enum eModifyKey_Returns eModifyKey_Returns
 
void ANIM_relative_keyingset_add_source (ListBase *dsources, struct ID *id, struct StructRNA *srna, void *data)
 
eModifyKey_Returns ANIM_validate_keyingset (struct bContext *C, ListBase *dsources, struct KeyingSet *ks)
 
int ANIM_apply_keyingset (struct bContext *C, ListBase *dsources, struct bAction *act, struct KeyingSet *ks, short mode, float cfra)
 
struct KeyingSetANIM_builtin_keyingset_get_named (struct KeyingSet *prevKS, const char name[])
 
KeyingSetInfoANIM_keyingset_info_find_name (const char name[])
 
bool ANIM_keyingset_find_id (struct KeyingSet *ks, ID *id)
 
void ANIM_keyingset_info_register (KeyingSetInfo *ksi)
 
void ANIM_keyingset_info_unregister (struct Main *bmain, KeyingSetInfo *ksi)
 
void ANIM_keyingset_infos_exit (void)
 
struct KeyingSetANIM_scene_get_active_keyingset (const struct Scene *scene)
 
int ANIM_scene_get_keyingset_index (struct Scene *scene, struct KeyingSet *ks)
 
struct KeyingSetANIM_get_keyingset_for_autokeying (const struct Scene *scene, const char *transformKSName)
 
void ANIM_keyingset_visit_for_search (const struct bContext *C, struct PointerRNA *ptr, struct PropertyRNA *prop, const char *edit_text, StringPropertySearchVisitFunc visit_fn, void *visit_user_data)
 
void ANIM_keyingset_visit_for_search_no_poll (const struct bContext *C, struct PointerRNA *ptr, struct PropertyRNA *prop, const char *edit_text, StringPropertySearchVisitFunc visit_fn, void *visit_user_data)
 
const struct EnumPropertyItemANIM_keying_sets_enum_itemf (struct bContext *C, struct PointerRNA *ptr, struct PropertyRNA *prop, bool *r_free)
 
KeyingSetANIM_keyingset_get_from_enum_type (struct Scene *scene, int type)
 
KeyingSetANIM_keyingset_get_from_idname (struct Scene *scene, const char *idname)
 
bool ANIM_keyingset_context_ok_poll (struct bContext *C, struct KeyingSet *ks)
 

Drivers

enum  eCreateDriverFlags { CREATEDRIVER_WITH_DEFAULT_DVAR = (1 << 0) , CREATEDRIVER_WITH_FMODIFIER = (1 << 1) }
 
enum  eCreateDriver_MappingTypes {
  CREATEDRIVER_MAPPING_1_N = 0 , CREATEDRIVER_MAPPING_1_1 = 1 , CREATEDRIVER_MAPPING_N_N = 2 , CREATEDRIVER_MAPPING_NONE = 3 ,
  CREATEDRIVER_MAPPING_NONE_ALL = 4
}
 
enum  eDriverFCurveCreationMode { DRIVER_FCURVE_LOOKUP_ONLY = 0 , DRIVER_FCURVE_KEYFRAMES = 1 , DRIVER_FCURVE_GENERATOR = 2 , DRIVER_FCURVE_EMPTY = 3 }
 
typedef enum eCreateDriverFlags eCreateDriverFlags
 
typedef enum eCreateDriver_MappingTypes eCreateDriver_MappingTypes
 
typedef enum eDriverFCurveCreationMode eDriverFCurveCreationMode
 
EnumPropertyItem prop_driver_create_mapping_types []
 
struct FCurveverify_driver_fcurve (struct ID *id, const char rna_path[], int array_index, eDriverFCurveCreationMode creation_mode)
 
struct FCurvealloc_driver_fcurve (const char rna_path[], int array_index, eDriverFCurveCreationMode creation_mode)
 
int ANIM_add_driver_with_target (struct ReportList *reports, struct ID *dst_id, const char dst_path[], int dst_index, struct ID *src_id, const char src_path[], int src_index, short flag, int driver_type, short mapping_type)
 Main Driver Management API calls. More...
 
int ANIM_add_driver (struct ReportList *reports, struct ID *id, const char rna_path[], int array_index, short flag, int type)
 Main Driver Management API calls. More...
 
bool ANIM_remove_driver (struct ReportList *reports, struct ID *id, const char rna_path[], int array_index, short flag)
 Main Driver Management API calls. More...
 
void ANIM_drivers_copybuf_free (void)
 
void ANIM_driver_vars_copybuf_free (void)
 
bool ANIM_driver_can_paste (void)
 
bool ANIM_copy_driver (struct ReportList *reports, struct ID *id, const char rna_path[], int array_index, short flag)
 Main Driver Management API calls. More...
 
bool ANIM_paste_driver (struct ReportList *reports, struct ID *id, const char rna_path[], int array_index, short flag)
 Main Driver Management API calls. More...
 
bool ANIM_driver_vars_can_paste (void)
 
bool ANIM_driver_vars_copy (struct ReportList *reports, struct FCurve *fcu)
 
bool ANIM_driver_vars_paste (struct ReportList *reports, struct FCurve *fcu, bool replace)
 
void ANIM_copy_as_driver (struct ID *target_id, const char *target_path, const char *var_name)
 

Macro Definition Documentation

◆ ANIM_KS_AVAILABLE_ID

#define ANIM_KS_AVAILABLE_ID   "Available"

Definition at line 684 of file ED_keyframing.h.

◆ ANIM_KS_LOC_ROT_SCALE_CPROP_ID

#define ANIM_KS_LOC_ROT_SCALE_CPROP_ID   "LocRotScaleCProp"

Definition at line 683 of file ED_keyframing.h.

◆ ANIM_KS_LOC_ROT_SCALE_ID

#define ANIM_KS_LOC_ROT_SCALE_ID   "LocRotScale"

Definition at line 682 of file ED_keyframing.h.

◆ ANIM_KS_LOCATION_ID

#define ANIM_KS_LOCATION_ID   "Location"

Definition at line 679 of file ED_keyframing.h.

◆ ANIM_KS_ROTATION_ID

#define ANIM_KS_ROTATION_ID   "Rotation"

Definition at line 680 of file ED_keyframing.h.

◆ ANIM_KS_SCALING_ID

#define ANIM_KS_SCALING_ID   "Scaling"

Definition at line 681 of file ED_keyframing.h.

◆ ANIM_KS_WHOLE_CHARACTER_ID

#define ANIM_KS_WHOLE_CHARACTER_ID   "WholeCharacter"

Definition at line 685 of file ED_keyframing.h.

◆ ANIM_KS_WHOLE_CHARACTER_SELECTED_ID

#define ANIM_KS_WHOLE_CHARACTER_SELECTED_ID   "WholeCharacterSelected"

Definition at line 686 of file ED_keyframing.h.

◆ IS_AUTOKEY_FLAG

#define IS_AUTOKEY_FLAG (   scene,
  flag 
)
Value:
((scene) ? (((scene)->toolsettings->autokey_flag & AUTOKEY_FLAG_##flag) || \
(U.autokey_flag & AUTOKEY_FLAG_##flag)) : \
(U.autokey_flag & AUTOKEY_FLAG_##flag))
unsigned int U
Definition: btGjkEpa3.h:78
Scene scene

Check if a flag is set for auto-key-framing (per scene takes precedence).

Definition at line 589 of file ED_keyframing.h.

◆ IS_AUTOKEY_MODE

#define IS_AUTOKEY_MODE (   scene,
  mode 
)
Value:
((scene) ? ((scene)->toolsettings->autokey_mode == AUTOKEY_MODE_##mode) : \
(U.autokey_mode == AUTOKEY_MODE_##mode))

Check the mode for auto-keyframing (per scene takes precedence).

Definition at line 585 of file ED_keyframing.h.

◆ IS_AUTOKEY_ON

#define IS_AUTOKEY_ON (   scene)     ((scene) ? ((scene)->toolsettings->autokey_mode & AUTOKEY_ON) : (U.autokey_mode & AUTOKEY_ON))

Check if auto-key-framing is enabled (per scene takes precedence).

Definition at line 582 of file ED_keyframing.h.

Typedef Documentation

◆ cbKeyingSet_Generate

typedef void(* cbKeyingSet_Generate) (struct KeyingSetInfo *ksi, struct bContext *C, struct KeyingSet *ks, struct PointerRNA *ptr)

Definition at line 211 of file ED_keyframing.h.

◆ cbKeyingSet_Iterator

typedef void(* cbKeyingSet_Iterator) (struct KeyingSetInfo *ksi, struct bContext *C, struct KeyingSet *ks)

Definition at line 207 of file ED_keyframing.h.

◆ cbKeyingSet_Poll

typedef bool(* cbKeyingSet_Poll) (struct KeyingSetInfo *ksi, struct bContext *C)

Definition at line 205 of file ED_keyframing.h.

◆ eAnimFilterFlags

Filter flags for id_frame_has_keyframe.

Warning
do not alter order of these, as also stored in files (for v3d->keyflags).

◆ eCreateDriver_MappingTypes

◆ eCreateDriverFlags

◆ eDriverFCurveCreationMode

◆ eModifyKey_Modes

◆ eModifyKey_Returns

◆ KeyingSetInfo

typedef struct KeyingSetInfo KeyingSetInfo

Enumeration Type Documentation

◆ eAnimFilterFlags

Filter flags for id_frame_has_keyframe.

Warning
do not alter order of these, as also stored in files (for v3d->keyflags).
Enumerator
ANIMFILTER_KEYS_LOCAL 
ANIMFILTER_KEYS_MUTED 
ANIMFILTER_KEYS_ACTIVE 
ANIMFILTER_KEYS_NOMAT 
ANIMFILTER_KEYS_NOSKEY 

Definition at line 639 of file ED_keyframing.h.

◆ eCreateDriver_MappingTypes

Enumerator
CREATEDRIVER_MAPPING_1_N 

1 to Many - Use the specified index, and drive all elements with it

CREATEDRIVER_MAPPING_1_1 

1 to 1 - Only for the specified index on each side

CREATEDRIVER_MAPPING_N_N 

Many to Many - Match up the indices one by one (only for drivers on vectors/arrays)

CREATEDRIVER_MAPPING_NONE 

None (Single Prop): Do not create driver with any targets; these will get added later instead

CREATEDRIVER_MAPPING_NONE_ALL 

None (All Properties): Do not create driver with any targets; these will get added later instead

Definition at line 407 of file ED_keyframing.h.

◆ eCreateDriverFlags

Enumerator
CREATEDRIVER_WITH_DEFAULT_DVAR 

create drivers with a default variable for nicer UI

CREATEDRIVER_WITH_FMODIFIER 

create drivers with Generator FModifier (for backwards compat)

Definition at line 399 of file ED_keyframing.h.

◆ eDriverFCurveCreationMode

Enumerator
DRIVER_FCURVE_LOOKUP_ONLY 
DRIVER_FCURVE_KEYFRAMES 
DRIVER_FCURVE_GENERATOR 
DRIVER_FCURVE_EMPTY 

Definition at line 431 of file ED_keyframing.h.

◆ eModifyKey_Modes

Enumerator
MODIFYKEY_MODE_INSERT 
MODIFYKEY_MODE_DELETE 

Definition at line 258 of file ED_keyframing.h.

◆ eModifyKey_Returns

Enumerator
MODIFYKEY_INVALID_CONTEXT 
MODIFYKEY_MISSING_TYPEINFO 

Definition at line 264 of file ED_keyframing.h.

Function Documentation

◆ alloc_driver_fcurve()

struct FCurve* alloc_driver_fcurve ( const char  rna_path[],
int  array_index,
eDriverFCurveCreationMode  creation_mode 
)

◆ ANIM_add_driver()

int ANIM_add_driver ( struct ReportList reports,
struct ID id,
const char  rna_path[],
int  array_index,
short  flag,
int  type 
)

◆ ANIM_add_driver_with_target()

int ANIM_add_driver_with_target ( struct ReportList reports,
struct ID dst_id,
const char  dst_path[],
int  dst_index,
struct ID src_id,
const char  src_path[],
int  src_index,
short  flag,
int  driver_type,
short  mapping_type 
)

Main Driver Management API calls.

Add a new driver for the specified property on the given ID block, and make it be driven by the specified target.

This is intended to be used in conjunction with a modal "eyedropper" for picking the variable that is going to be used to drive this one.

Parameters
flageCreateDriverFlags
driver_typeeDriver_Types
mapping_typeeCreateDriver_MappingTypes

Definition at line 281 of file drivers.c.

References add_driver_with_target(), ANIM_add_driver(), BKE_reportf(), CREATEDRIVER_MAPPING_1_1, CREATEDRIVER_MAPPING_1_N, CREATEDRIVER_MAPPING_N_N, CREATEDRIVER_MAPPING_NONE, CREATEDRIVER_WITH_DEFAULT_DVAR, FCurve::flag, len, MIN2, ID::name, ptr, RNA_id_pointer_create(), RNA_path_resolve_property(), RNA_property_array_check(), RNA_property_array_length(), and RPT_ERROR.

Referenced by driverdropper_sample().

◆ ANIM_apply_keyingset()

int ANIM_apply_keyingset ( struct bContext C,
ListBase dsources,
struct bAction act,
struct KeyingSet ks,
short  mode,
float  cfra 
)

Use the specified KeyingSet and context info (if required) to add/remove various Keyframes on the specified frame.

Modify keyframes for the channels specified by the KeyingSet. This takes into account many of the different combinations of using KeyingSets.

Returns
the number of channels that key-frames were added or an eModifyKey_Returns value (always a negative number).

Definition at line 1038 of file keyingsets.c.

References ANIM_get_keyframing_flags(), ANIM_validate_keyingset(), KS_Path::array_index, BKE_animsys_eval_context_construct(), BKE_animsys_free_nla_keyframing_context_cache(), BKE_reportf(), BLI_assert, C, CTX_data_depsgraph_pointer(), CTX_data_main(), CTX_data_scene(), CTX_wm_reports(), DEG_id_tag_update(), delete_keyframe(), depsgraph, error(), ListBase::first, KS_Path::flag, KS_Path::group, KS_Path::groupmode, GS, KS_Path::id, Object::id, ID_OB, ID_RECALC_ANIMATION_NO_FLUSH, ID_RECALC_GEOMETRY, ID_RECALC_TRANSFORM, insert_keyframe(), ToolSettings::keyframe_type, KS_Path::keyingflag, KeyingSet::keyingflag, KS_Path::keyingoverride, KeyingSet::keyingoverride, keyingset_apply_keying_flags(), KSP_FLAG_WHOLE_ARRAY, KSP_GROUP_KSNAME, KSP_GROUP_NONE, MODIFYKEY_MODE_DELETE, MODIFYKEY_MODE_INSERT, NA_ADDED, KeyingSet::name, ID::name, NC_ANIMATION, ND_KEYFRAME, KS_Path::next, NULL, KeyingSet::paths, ptr, RNA_id_pointer_create(), KS_Path::rna_path, RNA_path_resolve_property(), RNA_property_array_length(), RPT_WARNING, scene, Scene::toolsettings, and WM_main_add_notifier().

Referenced by autokeyframe_object(), autokeyframe_pose(), delete_key_using_keying_set(), ED_autokeyframe_object(), ED_autokeyframe_pchan(), ED_view3d_camera_autokey(), insert_key_exec(), pose_clear_transform_generic_exec(), poseAnim_mapping_autoKeyframe(), poselib_add_exec(), and poselib_keytag_pose().

◆ ANIM_builtin_keyingset_get_named()

struct KeyingSet* ANIM_builtin_keyingset_get_named ( struct KeyingSet prevKS,
const char  name[] 
)

Find builtin KeyingSet by name.

Returns
The first builtin KeyingSet with the given name, which occurs after the given one (or start of list if none given).

Definition at line 531 of file keyingsets.c.

References builtin_keyingsets, ListBase::first, KeyingSet::idname, KeyingSet::next, NULL, and STREQ.

Referenced by ANIM_get_keyingset_for_autokeying(), autokeyframe_object(), autokeyframe_pose(), pose_flip_quats_exec(), and poselib_add_exec().

◆ ANIM_copy_as_driver()

void ANIM_copy_as_driver ( struct ID target_id,
const char *  target_path,
const char *  var_name 
)

◆ ANIM_copy_driver()

bool ANIM_copy_driver ( struct ReportList reports,
struct ID id,
const char  rna_path[],
int  array_index,
short  flag 
)

Main Driver Management API calls.

Make a copy of the driver for the specified property on the given ID block.

◆ ANIM_driver_can_paste()

bool ANIM_driver_can_paste ( void  )

Returns whether there is a driver in the copy/paste buffer to paste.

Definition at line 580 of file drivers.c.

References channeldriver_copypaste_buf, and NULL.

Referenced by ui_popup_context_menu_for_button().

◆ ANIM_driver_vars_can_paste()

bool ANIM_driver_vars_can_paste ( void  )

Checks if there are driver variables in the copy/paste buffer.

Definition at line 708 of file drivers.c.

References BLI_listbase_is_empty(), and driver_vars_copybuf.

◆ ANIM_driver_vars_copy()

bool ANIM_driver_vars_copy ( struct ReportList reports,
struct FCurve fcu 
)

◆ ANIM_driver_vars_copybuf_free()

void ANIM_driver_vars_copybuf_free ( void  )

Clear copy-paste buffer for driver variable sets.

Note
This function frees any MEM_calloc'ed copy/paste buffer data.

Definition at line 692 of file drivers.c.

References BLI_listbase_clear(), driver_free_variable(), driver_vars_copybuf, ListBase::first, and DriverVar::next.

Referenced by ANIM_copy_as_driver(), ANIM_driver_vars_copy(), and WM_exit_ex().

◆ ANIM_driver_vars_paste()

bool ANIM_driver_vars_paste ( struct ReportList reports,
struct FCurve fcu,
bool  replace 
)

Paste the variables in the buffer to the given FCurve.

Definition at line 737 of file drivers.c.

References FCurve::driver, and NULL.

Referenced by graph_driver_vars_paste_exec().

◆ ANIM_drivers_copybuf_free()

void ANIM_drivers_copybuf_free ( void  )

Clear copy-paste buffer for drivers.

Note
This function frees any MEM_calloc'ed copy/paste buffer data.

Definition at line 571 of file drivers.c.

References BKE_fcurve_free(), channeldriver_copypaste_buf, and NULL.

Referenced by ANIM_copy_as_driver(), ANIM_copy_driver(), and WM_exit_ex().

◆ ANIM_get_keyframing_flags()

eInsertKeyFlags ANIM_get_keyframing_flags ( struct Scene scene,
bool  use_autokey_mode 
)

◆ ANIM_get_keyingset_for_autokeying()

struct KeyingSet* ANIM_get_keyingset_for_autokeying ( const struct Scene scene,
const char *  transformKSName 
)

Get Keying Set to use for Auto-Key-Framing some transforms.

◆ ANIM_keying_sets_enum_itemf()

const struct EnumPropertyItem* ANIM_keying_sets_enum_itemf ( struct bContext C,
struct PointerRNA ptr,
struct PropertyRNA prop,
bool r_free 
)

Dynamically populate an enum of Keying Sets.

◆ ANIM_keyingset_context_ok_poll()

bool ANIM_keyingset_context_ok_poll ( struct bContext C,
struct KeyingSet ks 
)

◆ ANIM_keyingset_find_id()

bool ANIM_keyingset_find_id ( struct KeyingSet ks,
ID id 
)

Check if the ID appears in the paths specified by the KeyingSet.

Definition at line 632 of file keyingsets.c.

References BLI_findptr(), ELEM, NULL, and KeyingSet::paths.

Referenced by insert_key_exec().

◆ ANIM_keyingset_get_from_enum_type()

KeyingSet* ANIM_keyingset_get_from_enum_type ( struct Scene scene,
int  type 
)

Get the keying set from enum values generated in ANIM_keying_sets_enum_itemf.

Type is the Keying Set the user specified to use when calling the operator:

Parameters
type
  • == 0: use scene's active Keying Set.
  • > 0: use a user-defined Keying Set from the active scene.
  • < 0: use a builtin Keying Set.

Definition at line 847 of file keyingsets.c.

References Scene::active_keyingset, BLI_findlink(), builtin_keyingsets, Scene::keyingsets, NULL, scene, and type.

Referenced by keyingset_get_from_op_with_error().

◆ ANIM_keyingset_get_from_idname()

KeyingSet* ANIM_keyingset_get_from_idname ( struct Scene scene,
const char *  idname 
)

◆ ANIM_keyingset_info_find_name()

KeyingSetInfo* ANIM_keyingset_info_find_name ( const char  name[])

Find KeyingSet type info given a name.

Definition at line 520 of file keyingsets.c.

References BLI_findstring(), keyingset_type_infos, and NULL.

Referenced by ANIM_keyingset_context_ok_poll(), and ANIM_validate_keyingset().

◆ ANIM_keyingset_info_register()

void ANIM_keyingset_info_register ( KeyingSetInfo ksi)

◆ ANIM_keyingset_info_unregister()

void ANIM_keyingset_info_unregister ( struct Main bmain,
KeyingSetInfo ksi 
)

◆ ANIM_keyingset_infos_exit()

void ANIM_keyingset_infos_exit ( void  )

◆ ANIM_keyingset_visit_for_search()

void ANIM_keyingset_visit_for_search ( const struct bContext C,
struct PointerRNA ptr,
struct PropertyRNA prop,
const char *  edit_text,
StringPropertySearchVisitFunc  visit_fn,
void visit_user_data 
)

◆ ANIM_keyingset_visit_for_search_no_poll()

void ANIM_keyingset_visit_for_search_no_poll ( const struct bContext C,
struct PointerRNA ptr,
struct PropertyRNA prop,
const char *  edit_text,
StringPropertySearchVisitFunc  visit_fn,
void visit_user_data 
)

◆ ANIM_paste_driver()

bool ANIM_paste_driver ( struct ReportList reports,
struct ID id,
const char  rna_path[],
int  array_index,
short  flag 
)

Main Driver Management API calls.

Add a new driver for the specified property on the given ID block or replace an existing one with the driver + driver-curve data from the buffer.

◆ ANIM_relative_keyingset_add_source()

void ANIM_relative_keyingset_add_source ( ListBase dsources,
struct ID id,
struct StructRNA srna,
void data 
)

◆ ANIM_remove_driver()

bool ANIM_remove_driver ( struct ReportList reports,
struct ID id,
const char  rna_path[],
int  array_index,
short  flag 
)

Main Driver Management API calls.

Remove the driver for the specified property on the given ID block (if available).

◆ ANIM_scene_get_active_keyingset()

struct KeyingSet* ANIM_scene_get_active_keyingset ( const struct Scene scene)

Get the active Keying Set for the given scene.

◆ ANIM_scene_get_keyingset_index()

int ANIM_scene_get_keyingset_index ( struct Scene scene,
struct KeyingSet ks 
)

Get the index of the Keying Set provided, for the given Scene.

Definition at line 665 of file keyingsets.c.

References BLI_findindex(), builtin_keyingsets, Scene::keyingsets, NULL, and scene.

◆ ANIM_validate_keyingset()

eModifyKey_Returns ANIM_validate_keyingset ( struct bContext C,
ListBase dsources,
struct KeyingSet ks 
)

Given a KeyingSet and context info, validate Keying Set's paths. This is only really necessary with relative/built-in KeyingSets where their list of paths is dynamically generated based on the current context info.

Returns
0 if succeeded, otherwise an error code: eModifyKey_Returns.

Definition at line 954 of file keyingsets.c.

References ANIM_keyingset_info_find_name(), BKE_keyingset_free(), BLI_listbase_is_empty(), C, KeyingSet::flag, KeyingSetInfo::iter, KEYINGSET_ABSOLUTE, MODIFYKEY_INVALID_CONTEXT, MODIFYKEY_MISSING_TYPEINFO, NULL, KeyingSet::paths, KeyingSetInfo::poll, RKS_ITER_overrides_list(), and KeyingSet::typeinfo.

Referenced by ANIM_apply_keyingset(), pose_select_same_keyingset(), and select_grouped_keyingset().

◆ autokeyframe_cfra_can_key()

bool autokeyframe_cfra_can_key ( const struct Scene scene,
struct ID id 
)

Auto-keyframing feature - checks for whether anything should be done for the current frame.

◆ delete_keyframe()

int delete_keyframe ( struct Main bmain,
struct ReportList reports,
struct ID id,
struct bAction act,
const char  rna_path[],
int  array_index,
float  cfra 
)

◆ ED_action_fcurve_ensure()

struct FCurve* ED_action_fcurve_ensure ( struct Main bmain,
struct bAction act,
const char  group[],
struct PointerRNA ptr,
const char  rna_path[],
int  array_index 
)

◆ ED_action_fcurve_find()

struct FCurve* ED_action_fcurve_find ( struct bAction act,
const char  rna_path[],
int  array_index 
)

Find the F-Curve from the Active Action, for the given Animation Data block. This assumes that all the destinations are valid.

Definition at line 164 of file keyframing.c.

References BKE_fcurve_find(), bAction::curves, ELEM, and NULL.

Referenced by clear_keyframe(), delete_keyframe(), and insert_keyframe_fcurve_value().

◆ ED_autokeyframe_object()

bool ED_autokeyframe_object ( struct bContext C,
struct Scene scene,
struct Object ob,
struct KeyingSet ks 
)

◆ ED_autokeyframe_pchan()

bool ED_autokeyframe_pchan ( struct bContext C,
struct Scene scene,
struct Object ob,
struct bPoseChannel pchan,
struct KeyingSet ks 
)

◆ ED_autokeyframe_property()

bool ED_autokeyframe_property ( struct bContext C,
struct Scene scene,
PointerRNA ptr,
PropertyRNA prop,
int  rnaindex,
float  cfra,
bool  only_if_property_keyed 
)

Use for auto-key-framing

Parameters
only_if_property_keyedif true, auto-key-framing only creates keyframes on already keyed properties. This is by design when using buttons. For other callers such as gizmos or VSE preview transform, creating new animation/keyframes also on non-keyed properties is desired.

Definition at line 3111 of file keyframing.c.

References ANIM_get_keyframing_flags(), FCurve::array_index, autokeyframe_cfra_can_key(), BKE_animsys_eval_context_construct(), BKE_fcurve_find_by_rna_context_ui(), BLI_assert, C, CTX_data_depsgraph_pointer(), CTX_data_main(), CTX_wm_reports(), depsgraph, FCurve::grp, id, insert_keyframe(), insert_keyframe_direct(), INSERTKEY_DRIVER, IS_AUTOKEY_ON, ToolSettings::keyframe_type, MEM_freeN, NA_EDITED, bActionGroup::name, NC_ANIMATION, ND_KEYFRAME, NULL, PointerRNA::owner_id, ptr, FCurve::rna_path, RNA_path_from_ID_to_property(), scene, Scene::toolsettings, and WM_event_add_notifier().

Referenced by autokeyframe_sequencer_image(), ui_but_anim_autokey(), and WM_gizmo_target_property_anim_autokey().

◆ ED_id_action_ensure()

struct bAction* ED_id_action_ensure ( struct Main bmain,
struct ID id 
)

◆ fcurve_frame_has_keyframe()

bool fcurve_frame_has_keyframe ( const struct FCurve fcu,
float  frame,
short  filter 
)

Lesser Keyframe Checking API call.

Checks if some F-Curve has a keyframe for a given frame.

Note
Used for the buttons to check for keyframes.

◆ fcurve_is_changed()

bool fcurve_is_changed ( struct PointerRNA  ptr,
struct PropertyRNA prop,
struct FCurve fcu,
const struct AnimationEvalContext anim_eval_context 
)

Lesser Keyframe Checking API call.

  • Returns whether the current value of a given property differs from the interpolated value.
  • Used for button drawing.

◆ id_frame_has_keyframe()

bool id_frame_has_keyframe ( struct ID id,
float  frame,
short  filter 
)

Main Keyframe Checking API call.

Checks whether a keyframe exists for the given ID-block one the given frame. It is recommended to call this method over the other keyframe-checkers directly, in case some detail of the implementation changes...

Parameters
frameThe value of this is quite often result of BKE_scene_ctime_get()

Definition at line 3036 of file keyframing.c.

References AnimData::action, action_frame_has_keyframe(), BKE_animdata_from_id(), filter(), GS, id, ID_OB, ID_SCE, ID::name, NULL, and object_frame_has_keyframe().

Referenced by autokeyframe_cfra_can_key(), draw_selected_name(), and object_frame_has_keyframe().

◆ insert_bezt_fcurve()

int insert_bezt_fcurve ( struct FCurve fcu,
const struct BezTriple bezt,
eInsertKeyFlags  flag 
)

Lesser Key-framing API call.

Use this when validation of necessary animation data isn't necessary as it already exists, and there is a BezTriple that can be directly copied into the array.

This function adds a given BezTriple to an F-Curve. It will allocate memory for the array if needed, and will insert the BezTriple into a suitable place in chronological order.

Note
any recalculate of the F-Curve that needs to be done will need to be done by the caller.

◆ insert_keyframe()

int insert_keyframe ( struct Main bmain,
struct ReportList reports,
struct ID id,
struct bAction act,
const char  group[],
const char  rna_path[],
int  array_index,
const struct AnimationEvalContext anim_eval_context,
eBezTriple_KeyframeType  keytype,
struct ListBase nla_cache,
eInsertKeyFlags  flag 
)

Main Insert Key-framing API call.

Use this to create any necessary animation data, and then insert a keyframe using the current value being keyframed, in the relevant place.

Parameters
flagUsed for special settings that alter the behavior of the keyframe insertion. These include the 'visual' key-framing modes, quick refresh, and extra keyframe filtering.
array_indexThe index to key or -1 keys all array indices.
Returns
The number of key-frames inserted.

◆ insert_keyframe_direct()

bool insert_keyframe_direct ( struct ReportList reports,
struct PointerRNA  ptr,
struct PropertyRNA prop,
struct FCurve fcu,
const struct AnimationEvalContext anim_eval_context,
eBezTriple_KeyframeType  keytype,
struct NlaKeyframingContext nla,
eInsertKeyFlags  flag 
)

Secondary Insert Key-framing API call.

Use this when validation of necessary animation data is not necessary, since an RNA-pointer to the necessary data being keyframed, and a pointer to the F-Curve to use have both been provided.

This function can't keyframe quaternion channels on some NLA strip types.

Parameters
keytypeThe "keyframe type" (eBezTriple_KeyframeType), as shown in the Dope Sheet.
flagUsed for special settings that alter the behavior of the keyframe insertion. These include the 'visual' key-framing modes, quick refresh, and extra keyframe filtering.
Returns
Success.

◆ insert_vert_fcurve()

int insert_vert_fcurve ( struct FCurve fcu,
float  x,
float  y,
eBezTriple_KeyframeType  keyframe_type,
eInsertKeyFlags  flag 
)

Main Key-framing API call.

Use this when validation of necessary animation data isn't necessary as it already exists. It will insert a keyframe using the current value being keyframed. Returns the index at which a keyframe was added (or -1 if failed).

This function is a wrapper for insert_bezt_fcurve(), and should be used when adding a new keyframe to a curve, when the keyframe doesn't exist anywhere else yet. It returns the index at which the keyframe was added.

Parameters
keyframe_typeThe type of keyframe (eBezTriple_KeyframeType).
flagOptional flags (eInsertKeyFlags) for controlling how keys get added and/or whether updates get done.

Definition at line 545 of file keyframing.c.

References Freestyle::a, BezTriple::amplitude, BezTriple::back, BEZKEYTYPE, FCurve::bezt, BEZT_IPO_BEZ, BEZT_IPO_CONST, BEZT_IPO_LIN, BKE_fcurve_active_keyframe_set(), BKE_fcurve_handles_recalc(), BezTriple::f1, BezTriple::f2, BezTriple::f3, FCURVE_DISCRETE_VALUES, FCURVE_INT_VALUES, FCurve::flag, BezTriple::h1, BezTriple::h2, HD_AUTO_ANIM, insert_bezt_fcurve(), INSERTKEY_FAST, INSERTKEY_NO_USERPREF, INSERTKEY_OVERWRITE_FULL, INSERTKEY_REPLACE, BezTriple::ipo, BezTriple::period, SELECT, subdivide_nonauto_handles(), FCurve::totvert, BezTriple::vec, x, and y.

Referenced by BCAnimationCurve::add_value(), alloc_driver_fcurve(), BCAnimationCurve::clean_handles(), graphkeys_click_insert_exec(), insert_fcurve_key(), insert_graph_keys(), insert_keyframe_value(), sample_fcurve(), and blender::bke::tests::TEST().

◆ update_autoflags_fcurve()

void update_autoflags_fcurve ( struct FCurve fcu,
struct bContext C,
struct ReportList reports,
struct PointerRNA ptr 
)

Lesser Key-framing API call.

Update integer/discrete flags of the FCurve (used when creating/inserting keyframes, but also through RNA when editing an ID prop, see T37103).

Definition at line 274 of file keyframing.c.

References BKE_report(), BKE_reportf(), C, PointerRNA::data, FCurve::flag, NA_EDITED, ID::name, NC_ANIMATION, ND_KEYFRAME, NULL, PointerRNA::owner_id, ptr, FCurve::rna_path, RNA_path_resolve_property(), RPT_ERROR, TIP_, update_autoflags_fcurve_direct(), and WM_event_add_notifier().

◆ verify_driver_fcurve()

struct FCurve* verify_driver_fcurve ( struct ID id,
const char  rna_path[],
int  array_index,
eDriverFCurveCreationMode  creation_mode 
)

Get (or add relevant data to be able to do so) F-Curve from the driver stack, for the given Animation Data block. This assumes that all the destinations are valid.

Note
This low-level function shouldn't be used directly for most tools, although there are special cases where this approach is preferable.

Definition at line 50 of file drivers.c.

References alloc_driver_fcurve(), BKE_animdata_ensure_id(), BKE_animdata_from_id(), BKE_fcurve_find(), BLI_addtail(), DRIVER_FCURVE_LOOKUP_ONLY, AnimData::drivers, ELEM, and NULL.

Referenced by add_driver_with_target(), ANIM_add_driver(), ANIM_copy_driver(), ANIM_paste_driver(), ANIM_remove_driver(), and ui_but_anim_expression_create().

Variable Documentation

◆ prop_driver_create_mapping_types

EnumPropertyItem prop_driver_create_mapping_types[]
extern

Mapping Types enum for operators.

Note
Used by ANIM_OT_driver_button_add and UI_OT_eyedropper_driver.

Definition at line 835 of file drivers.c.

Referenced by ANIM_OT_driver_button_add_menu(), driver_mapping_type_itemf(), and UI_OT_eyedropper_driver().