Blender V4.3
action_edit.cc File Reference
#include <cfloat>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include "BLI_blenlib.h"
#include "BLI_map.hh"
#include "BLI_utildefines.h"
#include "BLT_translation.hh"
#include "DEG_depsgraph.hh"
#include "DNA_anim_types.h"
#include "DNA_gpencil_legacy_types.h"
#include "DNA_mask_types.h"
#include "DNA_scene_types.h"
#include "RNA_access.hh"
#include "RNA_define.hh"
#include "RNA_enum_types.hh"
#include "BKE_animsys.h"
#include "BKE_context.hh"
#include "BKE_fcurve.hh"
#include "BKE_global.hh"
#include "BKE_gpencil_legacy.h"
#include "BKE_grease_pencil.hh"
#include "BKE_nla.hh"
#include "BKE_report.hh"
#include "UI_interface_icons.hh"
#include "UI_view2d.hh"
#include "ANIM_action.hh"
#include "ANIM_animdata.hh"
#include "ANIM_fcurve.hh"
#include "ANIM_keyframing.hh"
#include "ED_anim_api.hh"
#include "ED_gpencil_legacy.hh"
#include "ED_grease_pencil.hh"
#include "ED_keyframes_edit.hh"
#include "ED_keyframing.hh"
#include "ED_markers.hh"
#include "ED_mask.hh"
#include "ED_screen.hh"
#include "WM_api.hh"
#include "WM_types.hh"
#include "action_intern.hh"

Go to the source code of this file.

Functions

Pose Markers: Localize Markers
static bool act_markers_make_local_poll (bContext *C)
 
static int act_markers_make_local_exec (bContext *C, wmOperator *)
 
void ACTION_OT_markers_make_local (wmOperatorType *ot)
 
Calculate Range
static bool get_keyframe_extents (bAnimContext *ac, float *min, float *max, const short onlySel)
 
View: Automatic Preview-Range Operator
static int actkeys_previewrange_exec (bContext *C, wmOperator *)
 
void ACTION_OT_previewrange_set (wmOperatorType *ot)
 
View: All Operator
static bool actkeys_channels_get_selected_extents (bAnimContext *ac, float *r_min, float *r_max)
 
static int actkeys_viewall (bContext *C, const bool only_sel)
 
static int actkeys_viewall_exec (bContext *C, wmOperator *)
 
static int actkeys_viewsel_exec (bContext *C, wmOperator *)
 
void ACTION_OT_view_all (wmOperatorType *ot)
 
void ACTION_OT_view_selected (wmOperatorType *ot)
 
View: Frame Operator
static int actkeys_view_frame_exec (bContext *C, wmOperator *op)
 
void ACTION_OT_view_frame (wmOperatorType *ot)
 
Keyframes: Copy/Paste Operator
static short copy_action_keys (bAnimContext *ac)
 
static eKeyPasteError paste_action_keys (bAnimContext *ac, const eKeyPasteOffset offset_mode, const eKeyMergeMode merge_mode, bool flip)
 
static blender::ed::greasepencil::KeyframeClipboardget_grease_pencil_keyframe_clipboard ()
 
static int actkeys_copy_exec (bContext *C, wmOperator *op)
 
void ACTION_OT_copy (wmOperatorType *ot)
 
static int actkeys_paste_exec (bContext *C, wmOperator *op)
 
static std::string actkeys_paste_get_description (bContext *, wmOperatorType *, PointerRNA *ptr)
 
void ACTION_OT_paste (wmOperatorType *ot)
 
Keyframes: Duplicate Operator
static bool duplicate_action_keys (bAnimContext *ac)
 
static int actkeys_duplicate_exec (bContext *C, wmOperator *)
 
void ACTION_OT_duplicate (wmOperatorType *ot)
 
Keyframes: Delete Operator
static bool delete_action_keys (bAnimContext *ac)
 
static int actkeys_delete_exec (bContext *C, wmOperator *)
 
static int actkeys_delete_invoke (bContext *C, wmOperator *op, const wmEvent *)
 
void ACTION_OT_delete (wmOperatorType *ot)
 
Keyframes: Clean Operator
static void clean_action_keys (bAnimContext *ac, float thresh, bool clean_chan)
 
static int actkeys_clean_exec (bContext *C, wmOperator *op)
 
void ACTION_OT_clean (wmOperatorType *ot)
 
Keyframes: Sample Operator
static void bake_action_keys (bAnimContext *ac)
 
static int actkeys_bake_exec (bContext *C, wmOperator *op)
 
void ACTION_OT_bake_keys (wmOperatorType *ot)
 
Settings: Set Interpolation-Type Operator
static int actkeys_ipo_exec (bContext *C, wmOperator *op)
 
void ACTION_OT_interpolation_type (wmOperatorType *ot)
 
Settings: Set Easing Operator
static int actkeys_easing_exec (bContext *C, wmOperator *op)
 
void ACTION_OT_easing_type (wmOperatorType *ot)
 
Settings: Set Handle-Type Operator
static void sethandles_action_keys (bAnimContext *ac, short mode)
 
static int actkeys_handletype_exec (bContext *C, wmOperator *op)
 
void ACTION_OT_handle_type (wmOperatorType *ot)
 
Settings: Set Keyframe-Type Operator
static void setkeytype_action_keys (bAnimContext *ac, eBezTriple_KeyframeType mode)
 
static int actkeys_keytype_exec (bContext *C, wmOperator *op)
 
void ACTION_OT_keyframe_type (wmOperatorType *ot)
 
Transform: Jump to Selected Frames Operator
static bool actkeys_framejump_poll (bContext *C)
 
static int actkeys_framejump_exec (bContext *C, wmOperator *)
 
void ACTION_OT_frame_jump (wmOperatorType *ot)
 

Settings: Set Extrapolation-Type Operator

#define MAKE_CYCLIC_EXPO   -1
 
#define CLEAR_CYCLIC_EXPO   -2
 
static const EnumPropertyItem prop_actkeys_expo_types []
 
static void setexpo_action_keys (bAnimContext *ac, short mode)
 
static int actkeys_expo_exec (bContext *C, wmOperator *op)
 
void ACTION_OT_extrapolation_type (wmOperatorType *ot)
 

Keyframes: Insert Operator

static const EnumPropertyItem prop_actkeys_insertkey_types []
 
static void insert_gpencil_key (bAnimContext *ac, bAnimListElem *ale, const eGP_GetFrame_Mode add_frame_mode, bGPdata **gpd_old)
 
static void insert_grease_pencil_key (bAnimContext *ac, bAnimListElem *ale, const bool hold_previous)
 
static void insert_fcurve_key (bAnimContext *ac, bAnimListElem *ale, const AnimationEvalContext anim_eval_context, eInsertKeyFlags flag)
 
static void insert_action_keys (bAnimContext *ac, short mode)
 
static int actkeys_insertkey_exec (bContext *C, wmOperator *op)
 
void ACTION_OT_keyframe_insert (wmOperatorType *ot)
 

Transform: Snap Keyframes Operator

static const EnumPropertyItem prop_actkeys_snap_types []
 
static void snap_action_keys (bAnimContext *ac, short mode)
 
static int actkeys_snap_exec (bContext *C, wmOperator *op)
 
void ACTION_OT_snap (wmOperatorType *ot)
 

Transform: Mirror Keyframes Operator

static const EnumPropertyItem prop_actkeys_mirror_types []
 
static void mirror_action_keys (bAnimContext *ac, short mode)
 
static int actkeys_mirror_exec (bContext *C, wmOperator *op)
 
void ACTION_OT_mirror (wmOperatorType *ot)
 

Macro Definition Documentation

◆ CLEAR_CYCLIC_EXPO

#define CLEAR_CYCLIC_EXPO   -2

Definition at line 1372 of file action_edit.cc.

Referenced by setexpo_action_keys().

◆ MAKE_CYCLIC_EXPO

#define MAKE_CYCLIC_EXPO   -1

Definition at line 1371 of file action_edit.cc.

Referenced by setexpo_action_keys().

Function Documentation

◆ act_markers_make_local_exec()

◆ act_markers_make_local_poll()

◆ ACTION_OT_bake_keys()

◆ ACTION_OT_clean()

◆ ACTION_OT_copy()

◆ ACTION_OT_delete()

◆ ACTION_OT_duplicate()

◆ ACTION_OT_easing_type()

◆ ACTION_OT_extrapolation_type()

◆ ACTION_OT_frame_jump()

◆ ACTION_OT_handle_type()

◆ ACTION_OT_interpolation_type()

◆ ACTION_OT_keyframe_insert()

◆ ACTION_OT_keyframe_type()

◆ ACTION_OT_markers_make_local()

◆ ACTION_OT_mirror()

◆ ACTION_OT_paste()

◆ ACTION_OT_previewrange_set()

◆ ACTION_OT_snap()

◆ ACTION_OT_view_all()

◆ ACTION_OT_view_frame()

◆ ACTION_OT_view_selected()

◆ actkeys_bake_exec()

◆ actkeys_channels_get_selected_extents()

◆ actkeys_clean_exec()

◆ actkeys_copy_exec()

◆ actkeys_delete_exec()

◆ actkeys_delete_invoke()

static int actkeys_delete_invoke ( bContext * C,
wmOperator * op,
const wmEvent *  )
static

◆ actkeys_duplicate_exec()

◆ actkeys_easing_exec()

◆ actkeys_expo_exec()

◆ actkeys_framejump_exec()

◆ actkeys_framejump_poll()

static bool actkeys_framejump_poll ( bContext * C)
static

Definition at line 1800 of file action_edit.cc.

References ED_operator_action_active(), and G.

Referenced by ACTION_OT_frame_jump().

◆ actkeys_handletype_exec()

◆ actkeys_insertkey_exec()

◆ actkeys_ipo_exec()

◆ actkeys_keytype_exec()

◆ actkeys_mirror_exec()

◆ actkeys_paste_exec()

◆ actkeys_paste_get_description()

static std::string actkeys_paste_get_description ( bContext * ,
wmOperatorType * ,
PointerRNA * ptr )
static

Definition at line 712 of file action_edit.cc.

References BLI_strdup(), ptr, RNA_boolean_get(), and TIP_.

Referenced by ACTION_OT_paste().

◆ actkeys_previewrange_exec()

◆ actkeys_snap_exec()

◆ actkeys_view_frame_exec()

static int actkeys_view_frame_exec ( bContext * C,
wmOperator * op )
static

◆ actkeys_viewall()

◆ actkeys_viewall_exec()

static int actkeys_viewall_exec ( bContext * C,
wmOperator *  )
static

Definition at line 440 of file action_edit.cc.

References actkeys_viewall().

Referenced by ACTION_OT_view_all().

◆ actkeys_viewsel_exec()

static int actkeys_viewsel_exec ( bContext * C,
wmOperator *  )
static

Definition at line 446 of file action_edit.cc.

References actkeys_viewall().

Referenced by ACTION_OT_view_selected().

◆ bake_action_keys()

◆ clean_action_keys()

◆ copy_action_keys()

◆ delete_action_keys()

◆ duplicate_action_keys()

◆ get_grease_pencil_keyframe_clipboard()

static blender::ed::greasepencil::KeyframeClipboard & get_grease_pencil_keyframe_clipboard ( )
static

Definition at line 579 of file action_edit.cc.

Referenced by actkeys_copy_exec(), and actkeys_paste_exec().

◆ get_keyframe_extents()

◆ insert_action_keys()

◆ insert_fcurve_key()

◆ insert_gpencil_key()

static void insert_gpencil_key ( bAnimContext * ac,
bAnimListElem * ale,
const eGP_GetFrame_Mode add_frame_mode,
bGPdata ** gpd_old )
static

◆ insert_grease_pencil_key()

static void insert_grease_pencil_key ( bAnimContext * ac,
bAnimListElem * ale,
const bool hold_previous )
static

◆ mirror_action_keys()

◆ paste_action_keys()

◆ setexpo_action_keys()

◆ sethandles_action_keys()

◆ setkeytype_action_keys()

◆ snap_action_keys()

Variable Documentation

◆ prop_actkeys_expo_types

const EnumPropertyItem prop_actkeys_expo_types[]
static
Initial value:
= {
"CONSTANT",
0,
"Constant Extrapolation",
"Values on endpoint keyframes are held"},
"LINEAR",
0,
"Linear Extrapolation",
"Straight-line slope of end segments are extended past the endpoint keyframes"},
"MAKE_CYCLIC",
0,
"Make Cyclic (F-Modifier)",
"Add Cycles F-Modifier if one doesn't exist already"},
"CLEAR_CYCLIC",
0,
"Clear Cyclic (F-Modifier)",
"Remove Cycles F-Modifier if not needed anymore"},
{0, nullptr, 0, nullptr, nullptr},
}
@ FCURVE_EXTRAPOLATE_CONSTANT
@ FCURVE_EXTRAPOLATE_LINEAR
#define MAKE_CYCLIC_EXPO
#define CLEAR_CYCLIC_EXPO

Definition at line 1375 of file action_edit.cc.

Referenced by ACTION_OT_extrapolation_type().

◆ prop_actkeys_insertkey_types

const EnumPropertyItem prop_actkeys_insertkey_types[]
static
Initial value:
= {
{1, "ALL", 0, "All Channels", ""},
{2, "SEL", 0, "Only Selected Channels", ""},
{3, "GROUP", 0, "In Active Group", ""},
{0, nullptr, 0, nullptr, nullptr},
}

Definition at line 770 of file action_edit.cc.

Referenced by ACTION_OT_keyframe_insert().

◆ prop_actkeys_mirror_types

const EnumPropertyItem prop_actkeys_mirror_types[]
static
Initial value:
= {
"CFRA",
0,
"By Times Over Current Frame",
"Flip times of selected keyframes using the current frame as the mirror line"},
"XAXIS",
0,
"By Values Over Zero Value",
"Flip values of selected keyframes (i.e. negative values become positive, and vice versa)"},
"MARKER",
0,
"By Times Over First Selected Marker",
"Flip times of selected keyframes using the first selected marker as the reference point"},
{0, nullptr, 0, nullptr, nullptr},
}
@ ACTKEYS_MIRROR_CFRA
@ ACTKEYS_MIRROR_MARKER
@ ACTKEYS_MIRROR_XAXIS

Definition at line 2062 of file action_edit.cc.

Referenced by ACTION_OT_mirror().

◆ prop_actkeys_snap_types

const EnumPropertyItem prop_actkeys_snap_types[]
static
Initial value:
= {
"CFRA",
0,
"Selection to Current Frame",
"Snap selected keyframes to the current frame"},
"NEAREST_FRAME",
0,
"Selection to Nearest Frame",
"Snap selected keyframes to the nearest (whole) frame "
"(use to fix accidental subframe offsets)"},
"NEAREST_SECOND",
0,
"Selection to Nearest Second",
"Snap selected keyframes to the nearest second"},
"NEAREST_MARKER",
0,
"Selection to Nearest Marker",
"Snap selected keyframes to the nearest marker"},
{0, nullptr, 0, nullptr, nullptr},
}
@ ACTKEYS_SNAP_NEAREST_FRAME
@ ACTKEYS_SNAP_NEAREST_SECOND
@ ACTKEYS_SNAP_CFRA
@ ACTKEYS_SNAP_NEAREST_MARKER

Definition at line 1916 of file action_edit.cc.

Referenced by ACTION_OT_snap().