Blender  V3.3
Macros | Functions | Variables
action_edit.c File Reference
#include <float.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include "BLI_blenlib.h"
#include "BLI_math.h"
#include "BLI_utildefines.h"
#include "BLT_translation.h"
#include "DNA_anim_types.h"
#include "DNA_gpencil_types.h"
#include "DNA_key_types.h"
#include "DNA_mask_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "RNA_access.h"
#include "RNA_define.h"
#include "RNA_enum_types.h"
#include "BKE_action.h"
#include "BKE_animsys.h"
#include "BKE_context.h"
#include "BKE_fcurve.h"
#include "BKE_global.h"
#include "BKE_gpencil.h"
#include "BKE_key.h"
#include "BKE_nla.h"
#include "BKE_report.h"
#include "UI_view2d.h"
#include "ED_anim_api.h"
#include "ED_gpencil.h"
#include "ED_keyframes_edit.h"
#include "ED_keyframing.h"
#include "ED_markers.h"
#include "ED_mask.h"
#include "ED_screen.h"
#include "WM_api.h"
#include "WM_types.h"
#include "UI_interface.h"
#include "action_intern.h"

Go to the source code of this file.

Macros

#define MAKE_CYCLIC_EXPO   -1
 
#define CLEAR_CYCLIC_EXPO   -2
 

Functions

static bool act_markers_make_local_poll (bContext *C)
 
static int act_markers_make_local_exec (bContext *C, wmOperator *UNUSED(op))
 
void ACTION_OT_markers_make_local (wmOperatorType *ot)
 
static bool get_keyframe_extents (bAnimContext *ac, float *min, float *max, const short onlySel)
 
static int actkeys_previewrange_exec (bContext *C, wmOperator *UNUSED(op))
 
void ACTION_OT_previewrange_set (wmOperatorType *ot)
 
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 *UNUSED(op))
 
static int actkeys_viewsel_exec (bContext *C, wmOperator *UNUSED(op))
 
void ACTION_OT_view_all (wmOperatorType *ot)
 
void ACTION_OT_view_selected (wmOperatorType *ot)
 
static int actkeys_view_frame_exec (bContext *C, wmOperator *op)
 
void ACTION_OT_view_frame (wmOperatorType *ot)
 
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 int actkeys_copy_exec (bContext *C, wmOperator *op)
 
void ACTION_OT_copy (wmOperatorType *ot)
 
static int actkeys_paste_exec (bContext *C, wmOperator *op)
 
static char * actkeys_paste_description (bContext *UNUSED(C), wmOperatorType *UNUSED(op), PointerRNA *ptr)
 
void ACTION_OT_paste (wmOperatorType *ot)
 
static void insert_gpencil_key (bAnimContext *ac, bAnimListElem *ale, const eGP_GetFrame_Mode add_frame_mode, bGPdata **gpd_old)
 
static void insert_fcurve_key (bAnimContext *ac, bAnimListElem *ale, const AnimationEvalContext anim_eval_context, eInsertKeyFlags flag, ListBase *nla_cache)
 
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)
 
static bool duplicate_action_keys (bAnimContext *ac)
 
static int actkeys_duplicate_exec (bContext *C, wmOperator *UNUSED(op))
 
void ACTION_OT_duplicate (wmOperatorType *ot)
 
static bool delete_action_keys (bAnimContext *ac)
 
static int actkeys_delete_exec (bContext *C, wmOperator *UNUSED(op))
 
void ACTION_OT_delete (wmOperatorType *ot)
 
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)
 
static void sample_action_keys (bAnimContext *ac)
 
static int actkeys_sample_exec (bContext *C, wmOperator *op)
 
void ACTION_OT_sample (wmOperatorType *ot)
 
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)
 
static int actkeys_ipo_exec (bContext *C, wmOperator *op)
 
void ACTION_OT_interpolation_type (wmOperatorType *ot)
 
static int actkeys_easing_exec (bContext *C, wmOperator *op)
 
void ACTION_OT_easing_type (wmOperatorType *ot)
 
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)
 
static void setkeytype_action_keys (bAnimContext *ac, short mode)
 
static int actkeys_keytype_exec (bContext *C, wmOperator *op)
 
void ACTION_OT_keyframe_type (wmOperatorType *ot)
 
static bool actkeys_framejump_poll (bContext *C)
 
static int actkeys_framejump_exec (bContext *C, wmOperator *UNUSED(op))
 
void ACTION_OT_frame_jump (wmOperatorType *ot)
 
static void snap_action_keys (bAnimContext *ac, short mode)
 
static int actkeys_snap_exec (bContext *C, wmOperator *op)
 
void ACTION_OT_snap (wmOperatorType *ot)
 
static void mirror_action_keys (bAnimContext *ac, short mode)
 
static int actkeys_mirror_exec (bContext *C, wmOperator *op)
 
void ACTION_OT_mirror (wmOperatorType *ot)
 

Variables

static const EnumPropertyItem prop_actkeys_insertkey_types []
 
static const EnumPropertyItem prop_actkeys_expo_types []
 
static const EnumPropertyItem prop_actkeys_snap_types []
 
static const EnumPropertyItem prop_actkeys_mirror_types []
 

Macro Definition Documentation

◆ CLEAR_CYCLIC_EXPO

#define CLEAR_CYCLIC_EXPO   -2

Definition at line 1217 of file action_edit.c.

◆ MAKE_CYCLIC_EXPO

#define MAKE_CYCLIC_EXPO   -1

Definition at line 1216 of file action_edit.c.

Function Documentation

◆ act_markers_make_local_exec()

static int act_markers_make_local_exec ( bContext C,
wmOperator UNUSEDop 
)
static

◆ act_markers_make_local_poll()

static bool act_markers_make_local_poll ( bContext C)
static

◆ ACTION_OT_clean()

void ACTION_OT_clean ( wmOperatorType ot)

◆ ACTION_OT_copy()

void ACTION_OT_copy ( wmOperatorType ot)

◆ ACTION_OT_delete()

void ACTION_OT_delete ( wmOperatorType ot)

◆ ACTION_OT_duplicate()

void ACTION_OT_duplicate ( wmOperatorType ot)

◆ ACTION_OT_easing_type()

void ACTION_OT_easing_type ( wmOperatorType ot)

◆ ACTION_OT_extrapolation_type()

void ACTION_OT_extrapolation_type ( wmOperatorType ot)

◆ ACTION_OT_frame_jump()

void ACTION_OT_frame_jump ( wmOperatorType ot)

◆ ACTION_OT_handle_type()

void ACTION_OT_handle_type ( wmOperatorType ot)

◆ ACTION_OT_interpolation_type()

void ACTION_OT_interpolation_type ( wmOperatorType ot)

◆ ACTION_OT_keyframe_insert()

void ACTION_OT_keyframe_insert ( wmOperatorType ot)

◆ ACTION_OT_keyframe_type()

void ACTION_OT_keyframe_type ( wmOperatorType ot)

◆ ACTION_OT_markers_make_local()

void ACTION_OT_markers_make_local ( wmOperatorType ot)

◆ ACTION_OT_mirror()

void ACTION_OT_mirror ( wmOperatorType ot)

◆ ACTION_OT_paste()

void ACTION_OT_paste ( wmOperatorType ot)

◆ ACTION_OT_previewrange_set()

void ACTION_OT_previewrange_set ( wmOperatorType ot)

◆ ACTION_OT_sample()

void ACTION_OT_sample ( wmOperatorType ot)

◆ ACTION_OT_snap()

void ACTION_OT_snap ( wmOperatorType ot)

◆ ACTION_OT_view_all()

void ACTION_OT_view_all ( wmOperatorType ot)

◆ ACTION_OT_view_frame()

void ACTION_OT_view_frame ( wmOperatorType ot)

◆ ACTION_OT_view_selected()

void ACTION_OT_view_selected ( wmOperatorType ot)

◆ actkeys_channels_get_selected_extents()

static bool actkeys_channels_get_selected_extents ( bAnimContext ac,
float r_min,
float r_max 
)
static

◆ actkeys_clean_exec()

static int actkeys_clean_exec ( bContext C,
wmOperator op 
)
static

◆ actkeys_copy_exec()

static int actkeys_copy_exec ( bContext C,
wmOperator op 
)
static

◆ actkeys_delete_exec()

static int actkeys_delete_exec ( bContext C,
wmOperator UNUSEDop 
)
static

◆ actkeys_duplicate_exec()

static int actkeys_duplicate_exec ( bContext C,
wmOperator UNUSEDop 
)
static

◆ actkeys_easing_exec()

static int actkeys_easing_exec ( bContext C,
wmOperator op 
)
static

◆ actkeys_expo_exec()

static int actkeys_expo_exec ( bContext C,
wmOperator op 
)
static

◆ actkeys_framejump_exec()

static int actkeys_framejump_exec ( bContext C,
wmOperator UNUSEDop 
)
static

◆ actkeys_framejump_poll()

static bool actkeys_framejump_poll ( bContext C)
static

Definition at line 1627 of file action_edit.c.

References C, ED_operator_action_active(), and G.

Referenced by ACTION_OT_frame_jump().

◆ actkeys_handletype_exec()

static int actkeys_handletype_exec ( bContext C,
wmOperator op 
)
static

◆ actkeys_insertkey_exec()

static int actkeys_insertkey_exec ( bContext C,
wmOperator op 
)
static

◆ actkeys_ipo_exec()

static int actkeys_ipo_exec ( bContext C,
wmOperator op 
)
static

◆ actkeys_keytype_exec()

static int actkeys_keytype_exec ( bContext C,
wmOperator op 
)
static

◆ actkeys_mirror_exec()

static int actkeys_mirror_exec ( bContext C,
wmOperator op 
)
static

◆ actkeys_paste_description()

static char* actkeys_paste_description ( bContext UNUSEDC,
wmOperatorType UNUSEDop,
PointerRNA ptr 
)
static

Definition at line 664 of file action_edit.c.

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

Referenced by ACTION_OT_paste().

◆ actkeys_paste_exec()

static int actkeys_paste_exec ( bContext C,
wmOperator op 
)
static

◆ actkeys_previewrange_exec()

static int actkeys_previewrange_exec ( bContext C,
wmOperator UNUSEDop 
)
static

◆ actkeys_sample_exec()

static int actkeys_sample_exec ( bContext C,
wmOperator op 
)
static

◆ actkeys_snap_exec()

static int actkeys_snap_exec ( bContext C,
wmOperator op 
)
static

◆ actkeys_view_frame_exec()

static int actkeys_view_frame_exec ( bContext C,
wmOperator op 
)
static

◆ actkeys_viewall()

static int actkeys_viewall ( bContext C,
const bool  only_sel 
)
static

◆ actkeys_viewall_exec()

static int actkeys_viewall_exec ( bContext C,
wmOperator UNUSEDop 
)
static

Definition at line 418 of file action_edit.c.

References actkeys_viewall(), and C.

Referenced by ACTION_OT_view_all().

◆ actkeys_viewsel_exec()

static int actkeys_viewsel_exec ( bContext C,
wmOperator UNUSEDop 
)
static

Definition at line 424 of file action_edit.c.

References actkeys_viewall(), and C.

Referenced by ACTION_OT_view_selected().

◆ clean_action_keys()

static void clean_action_keys ( bAnimContext ac,
float  thresh,
bool  clean_chan 
)
static

◆ copy_action_keys()

static short copy_action_keys ( bAnimContext ac)
static

◆ delete_action_keys()

static bool delete_action_keys ( bAnimContext ac)
static

◆ duplicate_action_keys()

static bool duplicate_action_keys ( bAnimContext ac)
static

◆ get_keyframe_extents()

static bool get_keyframe_extents ( bAnimContext ac,
float min,
float max,
const short  onlySel 
)
static

◆ insert_action_keys()

static void insert_action_keys ( bAnimContext ac,
short  mode 
)
static

◆ insert_fcurve_key()

static void insert_fcurve_key ( bAnimContext ac,
bAnimListElem ale,
const AnimationEvalContext  anim_eval_context,
eInsertKeyFlags  flag,
ListBase nla_cache 
)
static

◆ insert_gpencil_key()

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

◆ mirror_action_keys()

static void mirror_action_keys ( bAnimContext ac,
short  mode 
)
static

◆ paste_action_keys()

static eKeyPasteError paste_action_keys ( bAnimContext ac,
const eKeyPasteOffset  offset_mode,
const eKeyMergeMode  merge_mode,
bool  flip 
)
static

◆ sample_action_keys()

static void sample_action_keys ( bAnimContext ac)
static

◆ setexpo_action_keys()

static void setexpo_action_keys ( bAnimContext ac,
short  mode 
)
static

◆ sethandles_action_keys()

static void sethandles_action_keys ( bAnimContext ac,
short  mode 
)
static

◆ setkeytype_action_keys()

static void setkeytype_action_keys ( bAnimContext ac,
short  mode 
)
static

◆ snap_action_keys()

static void snap_action_keys ( bAnimContext ac,
short  mode 
)
static

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, NULL, 0, NULL, NULL},
}
@ FCURVE_EXTRAPOLATE_CONSTANT
@ FCURVE_EXTRAPOLATE_LINEAR
#define MAKE_CYCLIC_EXPO
Definition: action_edit.c:1216
#define CLEAR_CYCLIC_EXPO
Definition: action_edit.c:1217

Definition at line 1220 of file action_edit.c.

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, NULL, 0, NULL, NULL},
}

Definition at line 717 of file action_edit.c.

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, NULL, 0, NULL, NULL},
}
@ ACTKEYS_MIRROR_CFRA
@ ACTKEYS_MIRROR_MARKER
@ ACTKEYS_MIRROR_XAXIS

Definition at line 1853 of file action_edit.c.

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 sub-frame 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, NULL, 0, NULL, NULL},
}
@ ACTKEYS_SNAP_NEAREST_FRAME
@ ACTKEYS_SNAP_NEAREST_SECOND
@ ACTKEYS_SNAP_CFRA
@ ACTKEYS_SNAP_NEAREST_MARKER

Definition at line 1727 of file action_edit.c.

Referenced by ACTION_OT_snap().