Blender V5.0
keyframing.cc File Reference
#include <cstdio>
#include <fmt/format.h>
#include "MEM_guardedalloc.h"
#include "BLI_math_base.h"
#include "BLI_string.h"
#include "BLT_translation.hh"
#include "DNA_ID.h"
#include "DNA_anim_types.h"
#include "DNA_armature_types.h"
#include "DNA_scene_types.h"
#include "DNA_sequence_types.h"
#include "BKE_action.hh"
#include "BKE_anim_data.hh"
#include "BKE_animsys.h"
#include "BKE_armature.hh"
#include "BKE_context.hh"
#include "BKE_fcurve.hh"
#include "BKE_global.hh"
#include "BKE_idtype.hh"
#include "BKE_lib_id.hh"
#include "BKE_nla.hh"
#include "BKE_report.hh"
#include "BKE_scene.hh"
#include "DEG_depsgraph.hh"
#include "DEG_depsgraph_query.hh"
#include "ED_anim_api.hh"
#include "ED_keyframing.hh"
#include "ED_object.hh"
#include "ED_screen.hh"
#include "ED_sequencer.hh"
#include "ANIM_action.hh"
#include "ANIM_action_iterators.hh"
#include "ANIM_animdata.hh"
#include "ANIM_armature.hh"
#include "ANIM_bone_collections.hh"
#include "ANIM_driver.hh"
#include "ANIM_fcurve.hh"
#include "ANIM_keyframing.hh"
#include "ANIM_keyingsets.hh"
#include "ANIM_rna.hh"
#include "SEQ_relations.hh"
#include "UI_interface.hh"
#include "UI_interface_layout.hh"
#include "UI_resources.hh"
#include "WM_api.hh"
#include "WM_types.hh"
#include "RNA_access.hh"
#include "RNA_define.hh"
#include "RNA_enum_types.hh"
#include "RNA_path.hh"
#include "RNA_prototypes.hh"
#include "anim_intern.hh"

Go to the source code of this file.

Enumerations

enum  { COMMONKEY_MODE_INSERT = 0 , COMMONKEY_MODE_DELETE }

Functions

static wmOperatorStatus delete_key_using_keying_set (bContext *C, wmOperator *op, KeyingSet *ks)
void update_autoflags_fcurve (FCurve *fcu, bContext *C, ReportList *reports, PointerRNA *ptr)
 Lesser Key-framing API call.
void ED_keyframes_add (FCurve *fcu, int num_keys_to_add)
static bool modify_key_op_poll (bContext *C)
static wmOperatorStatus insert_key_with_keyingset (bContext *C, wmOperator *op, KeyingSet *ks)
static blender::Vector< RNAPathconstruct_rna_paths (PointerRNA *ptr)
static bool get_selection (bContext *C, blender::Vector< PointerRNA > *r_selection)
static wmOperatorStatus insert_key (bContext *C, wmOperator *op)
static wmOperatorStatus insert_key_exec (bContext *C, wmOperator *op)
static wmOperatorStatus insert_key_invoke (bContext *C, wmOperator *op, const wmEvent *)
void ANIM_OT_keyframe_insert (wmOperatorType *ot)
static wmOperatorStatus keyframe_insert_with_keyingset_exec (bContext *C, wmOperator *op)
void ANIM_OT_keyframe_insert_by_name (wmOperatorType *ot)
static wmOperatorStatus insert_key_menu_invoke (bContext *C, wmOperator *op, const wmEvent *)
void ANIM_OT_keyframe_insert_menu (wmOperatorType *ot)
static wmOperatorStatus delete_key_exec (bContext *C, wmOperator *op)
void ANIM_OT_keyframe_delete (wmOperatorType *ot)
void ANIM_OT_keyframe_delete_by_name (wmOperatorType *ot)
static bool can_delete_fcurve (FCurve *fcu, Object *ob)
static wmOperatorStatus clear_anim_v3d_exec (bContext *C, wmOperator *)
static wmOperatorStatus clear_anim_v3d_invoke (bContext *C, wmOperator *op, const wmEvent *)
void ANIM_OT_keyframe_clear_v3d (wmOperatorType *ot)
static blender::Vector< std::string > get_selected_strips_rna_paths (blender::Vector< PointerRNA > &selection)
static void invalidate_strip_caches (blender::Vector< PointerRNA > selection, Scene *scene)
static bool fcurve_belongs_to_strip (const FCurve &fcurve, const std::string &strip_path)
static wmOperatorStatus clear_anim_vse_exec (bContext *C, wmOperator *op)
static wmOperatorStatus clear_anim_vse_invoke (bContext *C, wmOperator *op, const wmEvent *)
void ANIM_OT_keyframe_clear_vse (wmOperatorType *ot)
static bool can_delete_key (FCurve *fcu, Object *ob, ReportList *reports)
static bool can_delete_scene_key (FCurve *fcu, Scene *scene, wmOperator *op)
static wmOperatorStatus delete_key_vse_without_keying_set (bContext *C, wmOperator *op)
static wmOperatorStatus delete_key_vse_exec (bContext *C, wmOperator *op)
static wmOperatorStatus delete_key_vse_invoke (bContext *C, wmOperator *op, const wmEvent *)
void ANIM_OT_keyframe_delete_vse (wmOperatorType *ot)
static wmOperatorStatus delete_key_v3d_without_keying_set (bContext *C, wmOperator *op)
static wmOperatorStatus delete_key_v3d_exec (bContext *C, wmOperator *op)
static wmOperatorStatus delete_key_v3d_invoke (bContext *C, wmOperator *op, const wmEvent *)
void ANIM_OT_keyframe_delete_v3d (wmOperatorType *ot)
static wmOperatorStatus insert_key_button_exec (bContext *C, wmOperator *op)
void ANIM_OT_keyframe_insert_button (wmOperatorType *ot)
static wmOperatorStatus delete_key_button_exec (bContext *C, wmOperator *op)
void ANIM_OT_keyframe_delete_button (wmOperatorType *ot)
static wmOperatorStatus clear_key_button_exec (bContext *C, wmOperator *op)
void ANIM_OT_keyframe_clear_button (wmOperatorType *ot)
bool fcurve_is_changed (PointerRNA ptr, PropertyRNA *prop, FCurve *fcu, const AnimationEvalContext *anim_eval_context)
 Lesser Keyframe Checking API call.
Internal Utilities
static KeyingSetkeyingset_get_from_op_with_error (wmOperator *op, PropertyRNA *prop, Scene *scene)

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
COMMONKEY_MODE_INSERT 
COMMONKEY_MODE_DELETE 

Definition at line 149 of file editors/animation/keyframing.cc.

Function Documentation

◆ ANIM_OT_keyframe_clear_button()

void ANIM_OT_keyframe_clear_button ( wmOperatorType * ot)

◆ ANIM_OT_keyframe_clear_v3d()

◆ ANIM_OT_keyframe_clear_vse()

◆ ANIM_OT_keyframe_delete()

◆ ANIM_OT_keyframe_delete_button()

void ANIM_OT_keyframe_delete_button ( wmOperatorType * ot)

◆ ANIM_OT_keyframe_delete_by_name()

◆ ANIM_OT_keyframe_delete_v3d()

◆ ANIM_OT_keyframe_delete_vse()

◆ ANIM_OT_keyframe_insert()

◆ ANIM_OT_keyframe_insert_button()

void ANIM_OT_keyframe_insert_button ( wmOperatorType * ot)

◆ ANIM_OT_keyframe_insert_by_name()

◆ ANIM_OT_keyframe_insert_menu()

◆ can_delete_fcurve()

◆ can_delete_key()

◆ can_delete_scene_key()

bool can_delete_scene_key ( FCurve * fcu,
Scene * scene,
wmOperator * op )
static

◆ clear_anim_v3d_exec()

◆ clear_anim_v3d_invoke()

◆ clear_anim_vse_exec()

◆ clear_anim_vse_invoke()

◆ clear_key_button_exec()

◆ construct_rna_paths()

◆ delete_key_button_exec()

◆ delete_key_exec()

◆ delete_key_using_keying_set()

◆ delete_key_v3d_exec()

◆ delete_key_v3d_invoke()

◆ delete_key_v3d_without_keying_set()

◆ delete_key_vse_exec()

◆ delete_key_vse_invoke()

◆ delete_key_vse_without_keying_set()

◆ ED_keyframes_add()

void ED_keyframes_add ( FCurve * fcu,
int num_keys_to_add )

Add the given number of keyframes to the FCurve. Their coordinates are uninitialized, so the curve should not be used without further attention.

The newly created keys are selected, existing keys are not touched.

This can be used to allocate all the keys at once, and then update them afterwards.

Definition at line 121 of file editors/animation/keyframing.cc.

References FCurve::bezt, BEZT_IPO_BEZ, BLI_assert_msg, BezTriple::f1, BezTriple::f2, BezTriple::f3, BezTriple::h1, BezTriple::h2, HD_AUTO_ANIM, BezTriple::ipo, MEM_recallocN, SELECT, and FCurve::totvert.

Referenced by blender::bke::tests::testcurve_with_duplicates().

◆ fcurve_belongs_to_strip()

bool fcurve_belongs_to_strip ( const FCurve & fcurve,
const std::string & strip_path )
static

Definition at line 872 of file editors/animation/keyframing.cc.

References FCurve::rna_path.

◆ fcurve_is_changed()

bool fcurve_is_changed ( PointerRNA ptr,
PropertyRNA * prop,
FCurve * fcu,
const 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.

Definition at line 1638 of file editors/animation/keyframing.cc.

References FCurve::array_index, calculate_fcurve(), compare_ff_relative(), blender::animrig::get_rna_values(), PathResolvedRNA::prop, PathResolvedRNA::prop_index, PathResolvedRNA::ptr, ptr, and blender::Vector< T, InlineBufferCapacity, Allocator >::size().

Referenced by ui_but_anim_flag().

◆ get_selected_strips_rna_paths()

◆ get_selection()

◆ insert_key()

◆ insert_key_button_exec()

◆ insert_key_exec()

◆ insert_key_invoke()

wmOperatorStatus insert_key_invoke ( bContext * C,
wmOperator * op,
const wmEvent *  )
static

◆ insert_key_menu_invoke()

◆ insert_key_with_keyingset()

◆ invalidate_strip_caches()

void invalidate_strip_caches ( blender::Vector< PointerRNA > selection,
Scene * scene )
static

◆ keyframe_insert_with_keyingset_exec()

◆ keyingset_get_from_op_with_error()

◆ modify_key_op_poll()

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 159 of file editors/animation/keyframing.cc.

References C, CTX_data_scene(), CTX_wm_area(), and ELEM.

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

◆ update_autoflags_fcurve()

void update_autoflags_fcurve ( FCurve * fcu,
bContext * C,
ReportList * reports,
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 #37103).

Definition at line 85 of file editors/animation/keyframing.cc.

References BKE_report(), BKE_reportf(), C, FCurve::flag, NA_EDITED, NC_ANIMATION, ND_KEYFRAME, ptr, FCurve::rna_path, RNA_path_resolve_property(), RNA_property_type(), RPT_, RPT_ERROR, blender::animrig::update_autoflags_fcurve_direct(), and WM_event_add_notifier().