Blender  V3.3
Enumerations | Functions
keyframing.c File Reference
#include <float.h>
#include <math.h>
#include <stddef.h>
#include <stdio.h>
#include <string.h>
#include "MEM_guardedalloc.h"
#include "BLI_blenlib.h"
#include "BLI_dynstr.h"
#include "BLI_math.h"
#include "BLI_utildefines.h"
#include "BLT_translation.h"
#include "DNA_action_types.h"
#include "DNA_anim_types.h"
#include "DNA_armature_types.h"
#include "DNA_constraint_types.h"
#include "DNA_key_types.h"
#include "DNA_material_types.h"
#include "DNA_object_types.h"
#include "DNA_rigidbody_types.h"
#include "DNA_scene_types.h"
#include "BKE_action.h"
#include "BKE_anim_data.h"
#include "BKE_animsys.h"
#include "BKE_armature.h"
#include "BKE_context.h"
#include "BKE_fcurve.h"
#include "BKE_fcurve_driver.h"
#include "BKE_global.h"
#include "BKE_idtype.h"
#include "BKE_key.h"
#include "BKE_lib_id.h"
#include "BKE_main.h"
#include "BKE_material.h"
#include "BKE_nla.h"
#include "BKE_report.h"
#include "DEG_depsgraph.h"
#include "DEG_depsgraph_build.h"
#include "DEG_depsgraph_query.h"
#include "ED_anim_api.h"
#include "ED_keyframes_edit.h"
#include "ED_keyframing.h"
#include "ED_object.h"
#include "ED_screen.h"
#include "UI_interface.h"
#include "UI_resources.h"
#include "WM_api.h"
#include "WM_types.h"
#include "RNA_access.h"
#include "RNA_define.h"
#include "RNA_enum_types.h"
#include "RNA_path.h"
#include "RNA_prototypes.h"
#include "anim_intern.h"

Go to the source code of this file.

Enumerations

enum  { KEYNEEDED_DONTADD = 0 , KEYNEEDED_JUSTADD , KEYNEEDED_DELPREV , KEYNEEDED_DELNEXT }
 
enum  { VISUALKEY_NONE = 0 , VISUALKEY_LOC , VISUALKEY_ROT , VISUALKEY_SCA }
 
enum  { COMMONKEY_MODE_INSERT = 0 , COMMONKEY_MODE_DELETE }
 

Functions

static int delete_key_using_keying_set (bContext *C, wmOperator *op, KeyingSet *ks)
 
eInsertKeyFlags ANIM_get_keyframing_flags (Scene *scene, const bool use_autokey_mode)
 
bActionED_id_action_ensure (Main *bmain, ID *id)
 
FCurveED_action_fcurve_find (struct bAction *act, const char rna_path[], const int array_index)
 
FCurveED_action_fcurve_ensure (struct Main *bmain, struct bAction *act, const char group[], struct PointerRNA *ptr, const char rna_path[], const int array_index)
 
static void update_autoflags_fcurve_direct (FCurve *fcu, PropertyRNA *prop)
 
void update_autoflags_fcurve (FCurve *fcu, bContext *C, ReportList *reports, PointerRNA *ptr)
 Lesser Key-framing API call. More...
 
static eFCU_Cycle_Type remap_cyclic_keyframe_location (FCurve *fcu, float *px, float *py)
 
static void make_new_fcurve_cyclic (const bAction *act, FCurve *fcu)
 
static void replace_bezt_keyframe_ypos (BezTriple *dst, const BezTriple *bezt)
 
int insert_bezt_fcurve (FCurve *fcu, const BezTriple *bezt, eInsertKeyFlags flag)
 
static void subdivide_nonauto_handles (const FCurve *fcu, BezTriple *bezt, BezTriple *prev, BezTriple *next)
 
int insert_vert_fcurve (FCurve *fcu, float x, float y, eBezTriple_KeyframeType keyframe_type, eInsertKeyFlags flag)
 Main Key-framing API call. More...
 
static short new_key_needed (FCurve *fcu, float cFrame, float nValue)
 
static floatsetting_get_rna_values (PointerRNA *ptr, PropertyRNA *prop, float *buffer, int buffer_size, int *r_count)
 
static bool visualkey_can_use (PointerRNA *ptr, PropertyRNA *prop)
 
static floatvisualkey_get_values (PointerRNA *ptr, PropertyRNA *prop, float *buffer, int buffer_size, int *r_count)
 
static void get_keyframe_values_create_reports (ReportList *reports, PointerRNA ptr, PropertyRNA *prop, const int index, const int count, const bool force_all, const BLI_bitmap *successful_remaps)
 
static floatget_keyframe_values (ReportList *reports, PointerRNA ptr, PropertyRNA *prop, int index, struct NlaKeyframingContext *nla_context, eInsertKeyFlags flag, float *buffer, int buffer_size, const struct AnimationEvalContext *anim_eval_context, int *r_count, bool *r_force_all, BLI_bitmap **r_successful_remaps)
 
static bool insert_keyframe_value (ReportList *reports, PointerRNA *ptr, PropertyRNA *prop, FCurve *fcu, const AnimationEvalContext *anim_eval_context, float curval, eBezTriple_KeyframeType keytype, eInsertKeyFlags flag)
 
bool insert_keyframe_direct (ReportList *reports, PointerRNA ptr, PropertyRNA *prop, FCurve *fcu, const AnimationEvalContext *anim_eval_context, eBezTriple_KeyframeType keytype, struct NlaKeyframingContext *nla_context, eInsertKeyFlags flag)
 
static bool insert_keyframe_fcurve_value (Main *bmain, ReportList *reports, PointerRNA *ptr, PropertyRNA *prop, bAction *act, const char group[], const char rna_path[], int array_index, const AnimationEvalContext *anim_eval_context, float curval, eBezTriple_KeyframeType keytype, eInsertKeyFlags flag)
 
static AnimationEvalContext nla_time_remap (const AnimationEvalContext *anim_eval_context, PointerRNA *id_ptr, AnimData *adt, bAction *act, ListBase *nla_cache, NlaKeyframingContext **r_nla_context)
 
int insert_keyframe (Main *bmain, ReportList *reports, ID *id, bAction *act, const char group[], const char rna_path[], int array_index, const AnimationEvalContext *anim_eval_context, eBezTriple_KeyframeType keytype, ListBase *nla_cache, eInsertKeyFlags flag)
 
static bool delete_keyframe_fcurve (AnimData *adt, FCurve *fcu, float cfra)
 
static void deg_tag_after_keyframe_delete (Main *bmain, ID *id, AnimData *adt)
 
int delete_keyframe (Main *bmain, ReportList *reports, ID *id, bAction *act, const char rna_path[], int array_index, float cfra)
 Main Delete Key-Framing API call. More...
 
static int clear_keyframe (Main *bmain, ReportList *reports, ID *id, bAction *act, const char rna_path[], int array_index, eInsertKeyFlags UNUSED(flag))
 
static bool modify_key_op_poll (bContext *C)
 
static int insert_key_exec (bContext *C, wmOperator *op)
 
void ANIM_OT_keyframe_insert (wmOperatorType *ot)
 
void ANIM_OT_keyframe_insert_by_name (wmOperatorType *ot)
 
static int insert_key_menu_invoke (bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
 
void ANIM_OT_keyframe_insert_menu (wmOperatorType *ot)
 
static int delete_key_exec (bContext *C, wmOperator *op)
 
void ANIM_OT_keyframe_delete (wmOperatorType *ot)
 
void ANIM_OT_keyframe_delete_by_name (wmOperatorType *ot)
 
static int clear_anim_v3d_exec (bContext *C, wmOperator *UNUSED(op))
 
void ANIM_OT_keyframe_clear_v3d (wmOperatorType *ot)
 
static int delete_key_v3d_without_keying_set (bContext *C, wmOperator *op)
 
static int delete_key_v3d_exec (bContext *C, wmOperator *op)
 
void ANIM_OT_keyframe_delete_v3d (wmOperatorType *ot)
 
static int insert_key_button_exec (bContext *C, wmOperator *op)
 
void ANIM_OT_keyframe_insert_button (wmOperatorType *ot)
 
static int delete_key_button_exec (bContext *C, wmOperator *op)
 
void ANIM_OT_keyframe_delete_button (wmOperatorType *ot)
 
static int clear_key_button_exec (bContext *C, wmOperator *op)
 
void ANIM_OT_keyframe_clear_button (wmOperatorType *ot)
 
bool autokeyframe_cfra_can_key (const Scene *scene, ID *id)
 
bool fcurve_frame_has_keyframe (const FCurve *fcu, float frame, short filter)
 
bool fcurve_is_changed (PointerRNA ptr, PropertyRNA *prop, FCurve *fcu, const AnimationEvalContext *anim_eval_context)
 
static bool action_frame_has_keyframe (bAction *act, float frame, short filter)
 
static bool object_frame_has_keyframe (Object *ob, float frame, short filter)
 
bool id_frame_has_keyframe (ID *id, float frame, short filter)
 Main Keyframe Checking API call. More...
 
bool ED_autokeyframe_object (bContext *C, Scene *scene, Object *ob, KeyingSet *ks)
 
bool ED_autokeyframe_pchan (bContext *C, Scene *scene, Object *ob, bPoseChannel *pchan, KeyingSet *ks)
 
bool ED_autokeyframe_property (bContext *C, Scene *scene, PointerRNA *ptr, PropertyRNA *prop, int rnaindex, float cfra, const bool only_if_property_keyed)
 
Internal Utilities
static KeyingSetkeyingset_get_from_op_with_error (wmOperator *op, PropertyRNA *prop, Scene *scene)
 

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
KEYNEEDED_DONTADD 
KEYNEEDED_JUSTADD 
KEYNEEDED_DELPREV 
KEYNEEDED_DELNEXT 

Definition at line 653 of file keyframing.c.

◆ anonymous enum

anonymous enum
Enumerator
VISUALKEY_NONE 
VISUALKEY_LOC 
VISUALKEY_ROT 
VISUALKEY_SCA 

Definition at line 847 of file keyframing.c.

◆ anonymous enum

anonymous enum
Enumerator
COMMONKEY_MODE_INSERT 
COMMONKEY_MODE_DELETE 

Definition at line 1928 of file keyframing.c.

Function Documentation

◆ action_frame_has_keyframe()

static bool action_frame_has_keyframe ( bAction act,
float  frame,
short  filter 
)
static

Checks whether an Action has a keyframe for a given frame Since we're only concerned whether a keyframe exists, we can simply loop until a match is found.

Definition at line 2938 of file keyframing.c.

References ACT_MUTED, ANIMFILTER_KEYS_MUTED, FCurve::bezt, bAction::curves, fcurve_frame_has_keyframe(), filter(), ListBase::first, bAction::flag, FCurve::next, NULL, and FCurve::totvert.

Referenced by id_frame_has_keyframe(), and object_frame_has_keyframe().

◆ ANIM_get_keyframing_flags()

eInsertKeyFlags ANIM_get_keyframing_flags ( struct Scene scene,
bool  use_autokey_mode 
)

◆ ANIM_OT_keyframe_clear_button()

void ANIM_OT_keyframe_clear_button ( wmOperatorType ot)

◆ ANIM_OT_keyframe_clear_v3d()

void ANIM_OT_keyframe_clear_v3d ( wmOperatorType ot)

◆ ANIM_OT_keyframe_delete()

void ANIM_OT_keyframe_delete ( wmOperatorType ot)

◆ ANIM_OT_keyframe_delete_button()

void ANIM_OT_keyframe_delete_button ( wmOperatorType ot)

◆ ANIM_OT_keyframe_delete_by_name()

void ANIM_OT_keyframe_delete_by_name ( wmOperatorType ot)

◆ ANIM_OT_keyframe_delete_v3d()

void ANIM_OT_keyframe_delete_v3d ( wmOperatorType ot)

◆ ANIM_OT_keyframe_insert()

void ANIM_OT_keyframe_insert ( wmOperatorType ot)

◆ ANIM_OT_keyframe_insert_button()

void ANIM_OT_keyframe_insert_button ( wmOperatorType ot)

◆ ANIM_OT_keyframe_insert_by_name()

void ANIM_OT_keyframe_insert_by_name ( wmOperatorType ot)

◆ ANIM_OT_keyframe_insert_menu()

void ANIM_OT_keyframe_insert_menu ( wmOperatorType ot)

◆ autokeyframe_cfra_can_key()

bool autokeyframe_cfra_can_key ( const Scene scene,
ID id 
)

◆ clear_anim_v3d_exec()

static int clear_anim_v3d_exec ( bContext C,
wmOperator UNUSEDop 
)
static

◆ clear_key_button_exec()

static int clear_key_button_exec ( bContext C,
wmOperator op 
)
static

◆ clear_keyframe()

static int clear_keyframe ( Main bmain,
ReportList reports,
ID id,
bAction act,
const char  rna_path[],
int  array_index,
eInsertKeyFlags   UNUSEDflag 
)
static

Main Keyframing API call: Use this when validation of necessary animation data isn't necessary as it already exists. It will clear the current buttons fcurve(s).

The flag argument is used for special settings that alter the behavior of the keyframe deletion. These include the quick refresh options.

Returns
The number of f-curves removed.

Definition at line 1830 of file keyframing.c.

References AnimData::action, ANIM_fcurve_delete_from_animdata(), BKE_animdata_from_id(), BKE_fcurve_is_protected(), BKE_idtype_idcode_to_name(), BKE_report(), BKE_reportf(), deg_tag_after_keyframe_delete(), ED_action_fcurve_find(), ELEM, GS, id, ID::name, NULL, ptr, ret, RNA_id_pointer_create(), FCurve::rna_path, RNA_path_resolve_property(), RNA_property_array_length(), RPT_ERROR, and RPT_WARNING.

Referenced by clear_key_button_exec().

◆ deg_tag_after_keyframe_delete()

static void deg_tag_after_keyframe_delete ( Main bmain,
ID id,
AnimData adt 
)
static

◆ delete_key_button_exec()

static int delete_key_button_exec ( bContext C,
wmOperator op 
)
static

◆ delete_key_exec()

static int delete_key_exec ( bContext C,
wmOperator op 
)
static

◆ delete_key_using_keying_set()

static int delete_key_using_keying_set ( bContext C,
wmOperator op,
KeyingSet ks 
)
static

◆ delete_key_v3d_exec()

static int delete_key_v3d_exec ( bContext C,
wmOperator op 
)
static

◆ delete_key_v3d_without_keying_set()

static int delete_key_v3d_without_keying_set ( bContext C,
wmOperator op 
)
static

◆ 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 
)

◆ delete_keyframe_fcurve()

static bool delete_keyframe_fcurve ( AnimData adt,
FCurve fcu,
float  cfra 
)
static

◆ ED_action_fcurve_ensure()

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

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 ( bContext C,
Scene scene,
Object ob,
KeyingSet ks 
)

◆ ED_autokeyframe_pchan()

bool ED_autokeyframe_pchan ( bContext C,
Scene scene,
Object ob,
bPoseChannel pchan,
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()

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

◆ fcurve_frame_has_keyframe()

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

◆ fcurve_is_changed()

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

◆ get_keyframe_values()

static float* get_keyframe_values ( ReportList reports,
PointerRNA  ptr,
PropertyRNA prop,
int  index,
struct NlaKeyframingContext nla_context,
eInsertKeyFlags  flag,
float buffer,
int  buffer_size,
const struct AnimationEvalContext anim_eval_context,
int *  r_count,
bool r_force_all,
BLI_bitmap **  r_successful_remaps 
)
static

Retrieve current property values to keyframe, possibly applying NLA correction when necessary.

Parameters
r_successful_remapsEnables bits for indices which are both intended to be remapped and were successfully remapped. Bitmap allocated so it must be freed afterward.

Definition at line 1172 of file keyframing.c.

References BKE_animsys_nla_remap_keyframe_values(), BLI_BITMAP_NEW, buffer, get_keyframe_values_create_reports(), INSERTKEY_MATRIX, ptr, setting_get_rna_values(), visualkey_can_use(), and visualkey_get_values().

Referenced by insert_keyframe(), and insert_keyframe_direct().

◆ get_keyframe_values_create_reports()

static void get_keyframe_values_create_reports ( ReportList reports,
PointerRNA  ptr,
PropertyRNA prop,
const int  index,
const int  count,
const bool  force_all,
const BLI_bitmap successful_remaps 
)
static

◆ 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 ( FCurve fcu,
const BezTriple bezt,
eInsertKeyFlags  flag 
)

◆ insert_key_button_exec()

static int insert_key_button_exec ( bContext C,
wmOperator op 
)
static

◆ insert_key_exec()

static int insert_key_exec ( bContext C,
wmOperator op 
)
static

◆ insert_key_menu_invoke()

static int insert_key_menu_invoke ( bContext C,
wmOperator op,
const wmEvent UNUSEDevent 
)
static

◆ insert_keyframe()

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

◆ insert_keyframe_direct()

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

◆ insert_keyframe_fcurve_value()

static bool insert_keyframe_fcurve_value ( Main bmain,
ReportList reports,
PointerRNA ptr,
PropertyRNA prop,
bAction act,
const char  group[],
const char  rna_path[],
int  array_index,
const AnimationEvalContext anim_eval_context,
float  curval,
eBezTriple_KeyframeType  keytype,
eInsertKeyFlags  flag 
)
static

◆ insert_keyframe_value()

static bool insert_keyframe_value ( ReportList reports,
PointerRNA ptr,
PropertyRNA prop,
FCurve fcu,
const AnimationEvalContext anim_eval_context,
float  curval,
eBezTriple_KeyframeType  keytype,
eInsertKeyFlags  flag 
)
static

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

◆ keyingset_get_from_op_with_error()

static KeyingSet * keyingset_get_from_op_with_error ( wmOperator op,
PropertyRNA prop,
Scene scene 
)
static

◆ make_new_fcurve_cyclic()

static void make_new_fcurve_cyclic ( const bAction act,
FCurve fcu 
)
static

Used to make curves newly added to a cyclic Action cycle with the correct period.

Definition at line 354 of file keyframing.c.

References add_fmodifier(), FCurve::bezt, ListBase::first, floorf, FMODIFIER_TYPE_CYCLES, bAction::frame_end, bAction::frame_start, MEM_reallocN, FCurve::modifiers, FCurve::totvert, and BezTriple::vec.

Referenced by insert_keyframe_fcurve_value().

◆ modify_key_op_poll()

static bool modify_key_op_poll ( bContext C)
static

Polling callback for use with ANIM_*_keyframe() operators This is based on the standard ED_operator_areaactive callback, except that it does special checks for a few space-types too.

Definition at line 1938 of file keyframing.c.

References blender::compositor::area(), C, CTX_data_scene(), CTX_wm_area(), ELEM, NULL, and scene.

Referenced by ANIM_OT_keyframe_clear_button(), ANIM_OT_keyframe_delete(), ANIM_OT_keyframe_delete_button(), ANIM_OT_keyframe_delete_by_name(), ANIM_OT_keyframe_insert(), ANIM_OT_keyframe_insert_button(), and ANIM_OT_keyframe_insert_by_name().

◆ new_key_needed()

static short new_key_needed ( FCurve fcu,
float  cFrame,
float  nValue 
)
static

This helper function determines whether a new keyframe is needed.

Cases where keyframes should not be added:

  1. Keyframe to be added between two keyframes with similar values.
  2. Keyframe to be added on frame where two keyframes are already situated.
  3. Keyframe lies at point that intersects the linear line between two keyframes.

Definition at line 668 of file keyframing.c.

References FCurve::bezt, evaluate_fcurve(), IS_EQF, KEYNEEDED_DELNEXT, KEYNEEDED_DELPREV, KEYNEEDED_DONTADD, KEYNEEDED_JUSTADD, NULL, blender::meshintersect::prev(), FCurve::totvert, and BezTriple::vec.

Referenced by insert_keyframe_value().

◆ nla_time_remap()

static AnimationEvalContext nla_time_remap ( const AnimationEvalContext anim_eval_context,
PointerRNA id_ptr,
AnimData adt,
bAction act,
ListBase nla_cache,
NlaKeyframingContext **  r_nla_context 
)
static

◆ object_frame_has_keyframe()

static bool object_frame_has_keyframe ( Object ob,
float  frame,
short  filter 
)
static

◆ remap_cyclic_keyframe_location()

static eFCU_Cycle_Type remap_cyclic_keyframe_location ( FCurve fcu,
float px,
float py 
)
static

Move the point where a key is about to be inserted to be inside the main cycle range. Returns the type of the cycle if it is enabled and valid.

Definition at line 315 of file keyframing.c.

References FCurve::bezt, BKE_fcurve_get_cycle_type(), data, FCM_EXTRAPOLATE_CYCLIC_OFFSET, FCU_CYCLE_NONE, FCU_CYCLE_OFFSET, ListBase::first, floorf, if(), FCurve::modifiers, FCurve::totvert, type, and BezTriple::vec.

Referenced by insert_keyframe_value().

◆ replace_bezt_keyframe_ypos()

static void replace_bezt_keyframe_ypos ( BezTriple dst,
const BezTriple bezt 
)
static

Definition at line 393 of file keyframing.c.

References BezTriple::f1, BezTriple::f2, BezTriple::f3, and BezTriple::vec.

Referenced by insert_bezt_fcurve().

◆ setting_get_rna_values()

static float* setting_get_rna_values ( PointerRNA ptr,
PropertyRNA prop,
float buffer,
int  buffer_size,
int *  r_count 
)
static

◆ subdivide_nonauto_handles()

static void subdivide_nonauto_handles ( const FCurve fcu,
BezTriple bezt,
BezTriple prev,
BezTriple next 
)
static

Update the FCurve to allow insertion of bezt without modifying the curve shape.

Checks whether it is necessary to apply Bezier subdivision due to involvement of non-auto handles. If necessary, changes bezt handles from Auto to Aligned.

Parameters
beztkey being inserted
prevkeyframe before that key
nextkeyframe after that key

Definition at line 503 of file keyframing.c.

References FCurve::auto_smoothing, BEZT_IPO_BEZ, BEZT_IS_AUTOH, BKE_fcurve_bezt_subdivide_handles(), fabsf, FCURVE_SMOOTH_CONT_ACCEL, BezTriple::h1, BezTriple::h2, HD_ALIGN, HD_VECT, BezTriple::ipo, next, blender::meshintersect::prev(), and BezTriple::vec.

Referenced by insert_vert_fcurve().

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

◆ update_autoflags_fcurve_direct()

static void update_autoflags_fcurve_direct ( FCurve fcu,
PropertyRNA prop 
)
static

◆ visualkey_can_use()

static bool visualkey_can_use ( PointerRNA ptr,
PropertyRNA prop 
)
static

◆ visualkey_get_values()

static float* visualkey_get_values ( PointerRNA ptr,
PropertyRNA prop,
float buffer,
int  buffer_size,
int *  r_count 
)
static

This helper function extracts the value to use for visual-keyframing In the event that it is not possible to perform visual keying, try to fall-back to using the default method. Assumes that all data it has been passed is valid.

Definition at line 1028 of file keyframing.c.

References BKE_armature_mat_pose_to_bone(), BLI_assert, bPoseChannel::bone, BONE_CONNECTED, buffer, copy_m3_m4(), copy_m4_m4(), copy_v3_v3(), PointerRNA::data, Bone::flag, mat3_to_quat_is_ok(), mat4_to_axis_angle(), mat4_to_eulO(), mat4_to_size(), NULL, Object::obmat, Bone::parent, bPoseChannel::pose_mat, ptr, RNA_property_identifier(), bPoseChannel::rotmode, Object::rotmode, setting_get_rna_values(), and PointerRNA::type.

Referenced by get_keyframe_values().