109 for (marker =
markers->first; marker; marker = markern) {
110 markern = marker->next;
113 if (marker->flag &
SELECT) {
133 ot->
name =
"Make Markers Local";
134 ot->
idname =
"ACTION_OT_markers_make_local";
135 ot->
description =
"Move selected scene markers to the active Action as local 'pose' markers";
167 *
max = -999999999.0f;
170 if (anim_data.
first) {
172 for (ale = anim_data.
first; ale; ale = ale->
next) {
194 masklay_shape = masklay_shape->
next) {
195 const float framenum = (
float)masklay_shape->
frame;
283 ot->
name =
"Set Preview Range to Selected";
284 ot->
idname =
"ACTION_OT_previewrange_set";
285 ot->
description =
"Set Preview Range based on extents of selected Keyframes";
364 if (only_sel && (found ==
false)) {
386 if (only_sel ==
false) {
399 float ymid = (ymax - ymin) / 2.0f + ymin;
437 ot->
description =
"Reset viewable area to show full keyframe range";
450 ot->
name =
"Frame Selected";
451 ot->
idname =
"ACTION_OT_view_selected";
452 ot->
description =
"Reset viewable area to show selected keyframes range";
475 ot->
name =
"Go to Current Frame";
476 ot->
idname =
"ACTION_OT_view_frame";
574 if (kf_empty && !gpf_ok) {
586 ot->
name =
"Copy Keyframes";
588 ot->
description =
"Copy selected keyframes to the copy/paste buffer";
606 bool gpframes_inbuf =
false;
627 "Keyframe pasting is not available for grease pencil or mask mode");
637 if (!gpframes_inbuf) {
670 return BLI_strdup(
TIP_(
"Paste keyframes from mirrored bones if they exist"));
681 ot->
name =
"Paste Keyframes";
684 "Paste keyframes from copy/paste buffer for the selected channels, starting on the current "
702 "Paste time offset of keys");
708 "Method of merging pasted keys and existing");
710 ot->
srna,
"flipped",
false,
"Flipped",
"Paste keyframes from mirrored bones if they exist");
718 {1,
"ALL", 0,
"All Channels",
""},
719 {2,
"SEL", 0,
"Only Selected Channels",
""},
721 {3,
"GROUP", 0,
"In Active Group",
""},
735 if (gpd != *gpd_old) {
779 float cfra = anim_eval_context.
eval_time;
812 else if (mode == 3) {
832 for (ale = anim_data.
first; ale; ale = ale->
next) {
843 BLI_assert_msg(
false,
"Keys cannot be inserted into this animation type.");
888 ot->
name =
"Insert Keyframes";
889 ot->
idname =
"ACTION_OT_keyframe_insert";
890 ot->
description =
"Insert keyframes for the specified channels";
911 bool changed =
false;
919 for (ale = anim_data.
first; ale; ale = ale->
next) {
968 ot->
name =
"Duplicate Keyframes";
987 bool changed_final =
false;
995 for (ale = anim_data.
first; ale; ale = ale->
next) {
996 bool changed =
false;
1020 changed_final =
true;
1027 return changed_final;
1055 ot->
name =
"Delete Keyframes";
1083 for (ale = anim_data.
first; ale; ale = ale->
next) {
1127 ot->
name =
"Clean Keyframes";
1129 ot->
description =
"Simplify F-Curves by removing closely spaced keyframes";
1141 ot->
srna,
"threshold", 0.001f, 0.0f, FLT_MAX,
"Threshold",
"", 0.0f, 1000.0f);
1160 for (ale = anim_data.
first; ale; ale = ale->
next) {
1198 ot->
name =
"Sample Keyframes";
1200 ot->
description =
"Add keyframes on every frame between the selected keyframes";
1216 #define MAKE_CYCLIC_EXPO -1
1217 #define CLEAR_CYCLIC_EXPO -2
1224 "Constant Extrapolation",
1225 "Values on endpoint keyframes are held"},
1229 "Linear Extrapolation",
1230 "Straight-line slope of end segments are extended past the endpoint keyframes"},
1235 "Make Cyclic (F-Modifier)",
1236 "Add Cycles F-Modifier if one doesn't exist already"},
1240 "Clear Cyclic (F-Modifier)",
1241 "Remove Cycles F-Modifier if not needed anymore"},
1258 for (ale = anim_data.
first; ale; ale = ale->
next) {
1329 ot->
name =
"Set Keyframe Extrapolation";
1330 ot->
idname =
"ACTION_OT_extrapolation_type";
1331 ot->
description =
"Set extrapolation mode for selected F-Curves";
1381 ot->
name =
"Set Keyframe Interpolation";
1382 ot->
idname =
"ACTION_OT_interpolation_type";
1384 "Set interpolation mode for the F-Curve segments starting from the selected keyframes";
1431 ot->
name =
"Set Keyframe Easing Type";
1432 ot->
idname =
"ACTION_OT_easing_type";
1434 "Set easing type for the F-Curve segments starting from the selected keyframes";
1470 for (ale = anim_data.
first; ale; ale = ale->
next) {
1518 ot->
name =
"Set Keyframe Handle Type";
1519 ot->
idname =
"ACTION_OT_handle_type";
1520 ot->
description =
"Set type of handle for selected keyframes";
1553 for (ale = anim_data.
first; ale; ale = ale->
next) {
1554 switch (ale->
type) {
1566 BLI_assert_msg(
false,
"Keytype cannot be set into this animation type.");
1606 ot->
name =
"Set Keyframe Type";
1607 ot->
idname =
"ACTION_OT_keyframe_type";
1608 ot->
description =
"Set type of keyframe for the selected keyframes";
1630 if (
G.is_rendering) {
1656 for (ale = anim_data.
first; ale; ale = ale->
next) {
1690 BLI_assert_msg(
false,
"Cannot jump to keyframe into this animation type.");
1712 ot->
name =
"Jump to Keyframes";
1713 ot->
idname =
"ACTION_OT_frame_jump";
1714 ot->
description =
"Set the current frame to the average frame value of selected keyframes";
1731 "Selection to Current Frame",
1732 "Snap selected keyframes to the current frame"},
1736 "Selection to Nearest Frame",
1737 "Snap selected keyframes to the nearest (whole) frame "
1738 "(use to fix accidental sub-frame offsets)"},
1742 "Selection to Nearest Second",
1743 "Snap selected keyframes to the nearest second"},
1747 "Selection to Nearest Marker",
1748 "Snap selected keyframes to the nearest marker"},
1782 for (ale = anim_data.
first; ale; ale = ale->
next) {
1836 ot->
description =
"Snap selected keyframes to the times specified";
1857 "By Times Over Current Frame",
1858 "Flip times of selected keyframes using the current frame as the mirror line"},
1862 "By Values Over Zero Value",
1863 "Flip values of selected keyframes (i.e. negative values become positive, and vice versa)"},
1867 "By Times Over First Selected Marker",
1868 "Flip times of selected keyframes using the first selected marker as the reference point"},
1906 for (ale = anim_data.
first; ale; ale = ale->
next) {
1958 ot->
name =
"Mirror Keys";
1960 ot->
description =
"Flip selected keyframes over the selected mirror line";
typedef float(TangentPoint)[2]
Blender kernel action and pose functionality.
void BKE_animsys_free_nla_keyframing_context_cache(struct ListBase *cache)
AnimationEvalContext BKE_animsys_eval_context_construct(struct Depsgraph *depsgraph, float eval_time)
struct ScrArea * CTX_wm_area(const bContext *C)
struct bScreen * CTX_wm_screen(const bContext *C)
struct SpaceAction * CTX_wm_space_action(const bContext *C)
float evaluate_fcurve(struct FCurve *fcu, float evaltime)
bool BKE_fcurve_is_empty(struct FCurve *fcu)
bool BKE_fcurve_delete_keys_selected(struct FCurve *fcu)
bool remove_fmodifier(ListBase *modifiers, struct FModifier *fcm)
void BKE_fcurve_handles_recalc(struct FCurve *fcu)
struct FModifier * add_fmodifier(ListBase *modifiers, int type, struct FCurve *owner_fcu)
bool list_has_suitable_fmodifier(ListBase *modifiers, int mtype, short acttype)
bool BKE_fcurve_calc_range(struct FCurve *fcu, float *min, float *max, bool do_sel_only, bool do_min_length)
struct bGPDframe * BKE_gpencil_layer_frame_get(struct bGPDlayer *gpl, int cframe, eGP_GetFrame_Mode addnew)
void BKE_gpencil_tag(struct bGPdata *gpd)
float BKE_nla_tweakedit_remap(struct AnimData *adt, float cframe, short mode)
void BKE_report(ReportList *reports, eReportType type, const char *message)
#define BLI_assert_msg(a, msg)
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void BLI_remlink(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
MINLINE int round_fl_to_int(float a)
MINLINE float max_ff(float a, float b)
MINLINE float min_ff(float a, float b)
BLI_INLINE int BLI_rcti_size_y(const struct rcti *rct)
BLI_INLINE float BLI_rctf_size_x(const struct rctf *rct)
char * BLI_strdup(const char *str) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL() ATTR_MALLOC
#define BLT_I18NCONTEXT_ID_ACTION
@ SACTION_POSEMARKERS_SHOW
@ FCURVE_EXTRAPOLATE_CONSTANT
@ FCURVE_EXTRAPOLATE_LINEAR
Object is a sort of wrapper for general info.
@ GP_TOOL_FLAG_RETAIN_LAST
#define ACHANNEL_HEIGHT(ac)
#define ACHANNEL_FIRST_TOP(ac)
#define ANIM_UPDATE_DEFAULT
@ ACHANNEL_SETTING_SELECT
#define ACHANNEL_STEP(ac)
@ ANIMFILTER_DATA_VISIBLE
@ ANIMFILTER_CURVE_VISIBLE
@ ANIMFILTER_LIST_VISIBLE
@ ANIMFILTER_LIST_CHANNELS
@ KEYFRAME_PASTE_MERGE_MIX
@ KEYFRAME_PASTE_OFFSET_CFRA_START
short(* KeyframeEditFunc)(KeyframeEditData *ked, struct BezTriple *bezt)
@ KEYFRAME_PASTE_NOTHING_TO_PASTE
@ KEYFRAME_PASTE_NOWHERE_TO_PASTE
void ED_masklayer_frames_duplicate(struct MaskLayer *mask_layer)
bool ED_masklayer_frames_delete(struct MaskLayer *mask_layer)
void ED_masklayer_snap_frames(struct MaskLayer *mask_layer, struct Scene *scene, short mode)
void ED_area_tag_redraw(ScrArea *area)
bool ED_operator_action_active(struct bContext *C)
void UI_view2d_center_set(struct View2D *v2d, float x, float y)
void UI_view2d_sync(struct bScreen *screen, struct ScrArea *area, struct View2D *v2dcur, int flag)
void UI_view2d_center_get(const struct View2D *v2d, float *r_x, float *r_y)
void ACTION_OT_view_selected(wmOperatorType *ot)
static bool actkeys_framejump_poll(bContext *C)
static int actkeys_delete_exec(bContext *C, wmOperator *UNUSED(op))
void ACTION_OT_keyframe_type(wmOperatorType *ot)
void ACTION_OT_easing_type(wmOperatorType *ot)
static bool act_markers_make_local_poll(bContext *C)
static void snap_action_keys(bAnimContext *ac, short mode)
static int actkeys_view_frame_exec(bContext *C, wmOperator *op)
static void clean_action_keys(bAnimContext *ac, float thresh, bool clean_chan)
static int actkeys_duplicate_exec(bContext *C, wmOperator *UNUSED(op))
static const EnumPropertyItem prop_actkeys_snap_types[]
void ACTION_OT_view_all(wmOperatorType *ot)
void ACTION_OT_sample(wmOperatorType *ot)
static int actkeys_viewall(bContext *C, const bool only_sel)
static bool duplicate_action_keys(bAnimContext *ac)
void ACTION_OT_previewrange_set(wmOperatorType *ot)
static int actkeys_snap_exec(bContext *C, wmOperator *op)
void ACTION_OT_duplicate(wmOperatorType *ot)
void ACTION_OT_delete(wmOperatorType *ot)
void ACTION_OT_view_frame(wmOperatorType *ot)
static int actkeys_previewrange_exec(bContext *C, wmOperator *UNUSED(op))
static void insert_fcurve_key(bAnimContext *ac, bAnimListElem *ale, const AnimationEvalContext anim_eval_context, eInsertKeyFlags flag, ListBase *nla_cache)
void ACTION_OT_extrapolation_type(wmOperatorType *ot)
static int actkeys_ipo_exec(bContext *C, wmOperator *op)
void ACTION_OT_keyframe_insert(wmOperatorType *ot)
static void insert_action_keys(bAnimContext *ac, short mode)
static eKeyPasteError paste_action_keys(bAnimContext *ac, const eKeyPasteOffset offset_mode, const eKeyMergeMode merge_mode, bool flip)
static char * actkeys_paste_description(bContext *UNUSED(C), wmOperatorType *UNUSED(op), PointerRNA *ptr)
static bool delete_action_keys(bAnimContext *ac)
void ACTION_OT_snap(wmOperatorType *ot)
static int act_markers_make_local_exec(bContext *C, wmOperator *UNUSED(op))
static int actkeys_paste_exec(bContext *C, wmOperator *op)
void ACTION_OT_frame_jump(wmOperatorType *ot)
static void sample_action_keys(bAnimContext *ac)
void ACTION_OT_paste(wmOperatorType *ot)
static int actkeys_clean_exec(bContext *C, wmOperator *op)
static const EnumPropertyItem prop_actkeys_mirror_types[]
static bool actkeys_channels_get_selected_extents(bAnimContext *ac, float *r_min, float *r_max)
static void sethandles_action_keys(bAnimContext *ac, short mode)
static void mirror_action_keys(bAnimContext *ac, short mode)
void ACTION_OT_copy(wmOperatorType *ot)
static short copy_action_keys(bAnimContext *ac)
static bool get_keyframe_extents(bAnimContext *ac, float *min, float *max, const short onlySel)
static int actkeys_easing_exec(bContext *C, wmOperator *op)
static int actkeys_copy_exec(bContext *C, wmOperator *op)
static int actkeys_mirror_exec(bContext *C, wmOperator *op)
void ACTION_OT_markers_make_local(wmOperatorType *ot)
void ACTION_OT_interpolation_type(wmOperatorType *ot)
static int actkeys_expo_exec(bContext *C, wmOperator *op)
static int actkeys_handletype_exec(bContext *C, wmOperator *op)
void ACTION_OT_handle_type(wmOperatorType *ot)
static const EnumPropertyItem prop_actkeys_insertkey_types[]
static int actkeys_insertkey_exec(bContext *C, wmOperator *op)
void ACTION_OT_mirror(wmOperatorType *ot)
static void insert_gpencil_key(bAnimContext *ac, bAnimListElem *ale, const eGP_GetFrame_Mode add_frame_mode, bGPdata **gpd_old)
static void setexpo_action_keys(bAnimContext *ac, short mode)
static void setkeytype_action_keys(bAnimContext *ac, short mode)
void ACTION_OT_clean(wmOperatorType *ot)
#define CLEAR_CYCLIC_EXPO
static int actkeys_viewsel_exec(bContext *C, wmOperator *UNUSED(op))
static int actkeys_framejump_exec(bContext *C, wmOperator *UNUSED(op))
static int actkeys_viewall_exec(bContext *C, wmOperator *UNUSED(op))
static int actkeys_keytype_exec(bContext *C, wmOperator *op)
static const EnumPropertyItem prop_actkeys_expo_types[]
static int actkeys_sample_exec(bContext *C, wmOperator *op)
@ ACTKEYS_SNAP_NEAREST_FRAME
@ ACTKEYS_SNAP_NEAREST_SECOND
@ ACTKEYS_SNAP_NEAREST_MARKER
short ANIM_channel_setting_get(bAnimContext *ac, bAnimListElem *ale, eAnimChannel_Settings setting)
const bAnimChannelType * ANIM_channel_get_typeinfo(bAnimListElem *ale)
void ANIM_fcurve_delete_from_animdata(bAnimContext *ac, AnimData *adt, FCurve *fcu)
void ANIM_animdata_freelist(ListBase *anim_data)
void ANIM_animdata_update(bAnimContext *ac, ListBase *anim_data)
AnimData * ANIM_nla_mapping_get(bAnimContext *ac, bAnimListElem *ale)
void ANIM_nla_mapping_apply_fcurve(AnimData *adt, FCurve *fcu, bool restore, bool only_keys)
void ANIM_center_frame(struct bContext *C, int smooth_viewtx)
bool ANIM_animdata_get_context(const bContext *C, bAnimContext *ac)
size_t ANIM_animdata_filter(bAnimContext *ac, ListBase *anim_data, eAnimFilter_Flags filter_mode, void *data, eAnimCont_Types datatype)
TimeMarker * ED_markers_get_first_selected(ListBase *markers)
ListBase * ED_context_get_markers(const bContext *C)
void ED_gpencil_layer_frames_keytype_set(bGPDlayer *gpl, short type)
void ED_gpencil_layer_frames_duplicate(bGPDlayer *gpl)
bool ED_gpencil_layer_frames_delete(bGPDlayer *gpl)
bool ED_gpencil_anim_copybuf_paste(bAnimContext *ac, const short offset_mode)
bool ED_gpencil_layer_frame_select_check(const bGPDlayer *gpl)
void ED_gpencil_layer_mirror_frames(bGPDlayer *gpl, Scene *scene, short mode)
void ED_gpencil_layer_snap_frames(bGPDlayer *gpl, Scene *scene, short mode)
bool ED_gpencil_anim_copybuf_copy(bAnimContext *ac)
DO_INLINE void filter(lfVector *V, fmatrix3x3 *S)
const vector< Marker > & markers
KeyframeEditFunc ANIM_editkeyframes_mirror(short mode)
KeyframeEditFunc ANIM_editkeyframes_keytype(short mode)
KeyframeEditFunc ANIM_editkeyframes_easing(short mode)
KeyframeEditFunc ANIM_editkeyframes_ipo(short mode)
short ANIM_fcurve_keyframes_loop(KeyframeEditData *ked, FCurve *fcu, KeyframeEditFunc key_ok, KeyframeEditFunc key_cb, FcuEditFunc fcu_cb)
KeyframeEditFunc ANIM_editkeyframes_ok(short mode)
KeyframeEditFunc ANIM_editkeyframes_snap(short mode)
void ANIM_animdata_keyframe_callback(bAnimContext *ac, eAnimFilter_Flags filter, KeyframeEditFunc callback_fn)
short bezt_calc_average(KeyframeEditData *ked, BezTriple *bezt)
KeyframeEditFunc ANIM_editkeyframes_handles(short mode)
const EnumPropertyItem rna_enum_keyframe_paste_offset_items[]
eKeyPasteError paste_animedit_keys(bAnimContext *ac, ListBase *anim_data, const eKeyPasteOffset offset_mode, const eKeyMergeMode merge_mode, bool flip)
short copy_animedit_keys(bAnimContext *ac, ListBase *anim_data)
const EnumPropertyItem rna_enum_keyframe_paste_merge_items[]
void sample_fcurve(FCurve *fcu)
void ANIM_fcurves_copybuf_free(void)
bool duplicate_fcurve_keys(FCurve *fcu)
void clean_fcurve(struct bAnimContext *ac, bAnimListElem *ale, float thresh, bool cleardefault)
int insert_vert_fcurve(FCurve *fcu, float x, float y, eBezTriple_KeyframeType keyframe_type, eInsertKeyFlags flag)
Main Key-framing API call.
eInsertKeyFlags ANIM_get_keyframing_flags(Scene *scene, const bool use_autokey_mode)
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)
float RNA_float_get(PointerRNA *ptr, const char *name)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
int RNA_enum_get(PointerRNA *ptr, const char *name)
const EnumPropertyItem rna_enum_beztriple_interpolation_mode_items[]
const EnumPropertyItem rna_enum_keyframe_handle_type_items[]
PropertyRNA * RNA_def_float(StructOrFunctionRNA *cont_, const char *identifier, float default_value, float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, bool default_value, const char *ui_name, const char *ui_description)
void RNA_def_property_translation_context(PropertyRNA *prop, const char *context)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, int default_value, const char *ui_name, const char *ui_description)
const EnumPropertyItem rna_enum_beztriple_interpolation_easing_items[]
const EnumPropertyItem rna_enum_beztriple_keyframe_type_items[]
struct MaskLayerShape * next
struct ToolSettings * toolsettings
bool(* has_setting)(bAnimContext *ac, bAnimListElem *ale, eAnimChannel_Settings setting)
eAnimChannel_Role channel_role
struct ReportList * reports
struct Depsgraph * depsgraph
struct bAnimListElem * next
int(* invoke)(struct bContext *, struct wmOperator *, const struct wmEvent *) ATTR_WARN_UNUSED_RESULT
char *(* get_description)(struct bContext *C, struct wmOperatorType *, struct PointerRNA *)
bool(* poll)(struct bContext *) ATTR_WARN_UNUSED_RESULT
int(* exec)(struct bContext *, struct wmOperator *) ATTR_WARN_UNUSED_RESULT
struct ReportList * reports
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
void WM_operator_properties_confirm_or_exec(wmOperatorType *ot)
int WM_operator_confirm_or_exec(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
int WM_operator_smooth_viewtx_get(const wmOperator *op)
int WM_menu_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))