forked from blender/blender
main sync #3
@ -41,7 +41,9 @@
|
|||||||
|
|
||||||
#include "anim_intern.h"
|
#include "anim_intern.h"
|
||||||
|
|
||||||
/* ********************** frame change operator ***************************/
|
/* -------------------------------------------------------------------- */
|
||||||
|
/** \name Frame Change Operator
|
||||||
|
* \{ */
|
||||||
|
|
||||||
/* Check if the operator can be run from the current context */
|
/* Check if the operator can be run from the current context */
|
||||||
static bool change_frame_poll(bContext *C)
|
static bool change_frame_poll(bContext *C)
|
||||||
@ -349,7 +351,11 @@ static void ANIM_OT_change_frame(wmOperatorType *ot)
|
|||||||
RNA_def_property_flag(prop, PROP_SKIP_SAVE);
|
RNA_def_property_flag(prop, PROP_SKIP_SAVE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ****************** Start/End Frame Operators *******************************/
|
/** \} */
|
||||||
|
|
||||||
|
/* -------------------------------------------------------------------- */
|
||||||
|
/** \name Start/End Frame Operators
|
||||||
|
* \{ */
|
||||||
|
|
||||||
static bool anim_set_end_frames_poll(bContext *C)
|
static bool anim_set_end_frames_poll(bContext *C)
|
||||||
{
|
{
|
||||||
@ -483,7 +489,11 @@ static void ANIM_OT_end_frame_set(wmOperatorType *ot)
|
|||||||
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
|
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ****************** set preview range operator ****************************/
|
/** \} */
|
||||||
|
|
||||||
|
/* -------------------------------------------------------------------- */
|
||||||
|
/** \name Set Preview Range Operator
|
||||||
|
* \{ */
|
||||||
|
|
||||||
static int previewrange_define_exec(bContext *C, wmOperator *op)
|
static int previewrange_define_exec(bContext *C, wmOperator *op)
|
||||||
{
|
{
|
||||||
@ -545,7 +555,11 @@ static void ANIM_OT_previewrange_set(wmOperatorType *ot)
|
|||||||
WM_operator_properties_border(ot);
|
WM_operator_properties_border(ot);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ****************** clear preview range operator ****************************/
|
/** \} */
|
||||||
|
|
||||||
|
/* -------------------------------------------------------------------- */
|
||||||
|
/** \name Clear Preview Range Operator
|
||||||
|
* \{ */
|
||||||
|
|
||||||
static int previewrange_clear_exec(bContext *C, wmOperator *UNUSED(op))
|
static int previewrange_clear_exec(bContext *C, wmOperator *UNUSED(op))
|
||||||
{
|
{
|
||||||
@ -586,7 +600,11 @@ static void ANIM_OT_previewrange_clear(wmOperatorType *ot)
|
|||||||
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
|
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ************************** registration **********************************/
|
/** \} */
|
||||||
|
|
||||||
|
/* -------------------------------------------------------------------- */
|
||||||
|
/** \name Registration
|
||||||
|
* \{ */
|
||||||
|
|
||||||
void ED_operatortypes_anim(void)
|
void ED_operatortypes_anim(void)
|
||||||
{
|
{
|
||||||
@ -632,3 +650,5 @@ void ED_keymap_anim(wmKeyConfig *keyconf)
|
|||||||
{
|
{
|
||||||
WM_keymap_ensure(keyconf, "Animation", 0, 0);
|
WM_keymap_ensure(keyconf, "Animation", 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \} */
|
||||||
|
@ -54,8 +54,9 @@
|
|||||||
|
|
||||||
#include "action_intern.h"
|
#include "action_intern.h"
|
||||||
|
|
||||||
/* ************************************************************************** */
|
/* -------------------------------------------------------------------- */
|
||||||
/* ACTION CREATION */
|
/** \name Utilities
|
||||||
|
* \{ */
|
||||||
|
|
||||||
AnimData *ED_actedit_animdata_from_context(const bContext *C, ID **r_adt_id_owner)
|
AnimData *ED_actedit_animdata_from_context(const bContext *C, ID **r_adt_id_owner)
|
||||||
{
|
{
|
||||||
@ -86,9 +87,12 @@ AnimData *ED_actedit_animdata_from_context(const bContext *C, ID **r_adt_id_owne
|
|||||||
return adt;
|
return adt;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------------------------------- */
|
/** \} */
|
||||||
|
|
||||||
|
/* -------------------------------------------------------------------- */
|
||||||
|
/** \name Create New Action
|
||||||
|
* \{ */
|
||||||
|
|
||||||
/* Create new action */
|
|
||||||
static bAction *action_create_new(bContext *C, bAction *oldact)
|
static bAction *action_create_new(bContext *C, bAction *oldact)
|
||||||
{
|
{
|
||||||
ScrArea *area = CTX_wm_area(C);
|
ScrArea *area = CTX_wm_area(C);
|
||||||
@ -150,14 +154,18 @@ static void actedit_change_action(bContext *C, bAction *act)
|
|||||||
RNA_property_update(C, &ptr, prop);
|
RNA_property_update(C, &ptr, prop);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ******************** New Action Operator *********************** */
|
/** \} */
|
||||||
|
|
||||||
|
/* -------------------------------------------------------------------- */
|
||||||
|
/** \name New Action Operator
|
||||||
|
*
|
||||||
|
* Criteria:
|
||||||
|
* 1) There must be an dope-sheet/action editor, and it must be in a mode which uses actions...
|
||||||
|
* OR
|
||||||
|
* The NLA Editor is active (i.e. Animation Data panel -> new action)
|
||||||
|
* 2) The associated #AnimData block must not be in tweak-mode.
|
||||||
|
* \{ */
|
||||||
|
|
||||||
/* Criteria:
|
|
||||||
* 1) There must be an dopesheet/action editor, and it must be in a mode which uses actions...
|
|
||||||
* OR
|
|
||||||
* The NLA Editor is active (i.e. Animation Data panel -> new action)
|
|
||||||
* 2) The associated AnimData block must not be in tweak-mode.
|
|
||||||
*/
|
|
||||||
static bool action_new_poll(bContext *C)
|
static bool action_new_poll(bContext *C)
|
||||||
{
|
{
|
||||||
Scene *scene = CTX_data_scene(C);
|
Scene *scene = CTX_data_scene(C);
|
||||||
@ -290,13 +298,17 @@ void ACTION_OT_new(wmOperatorType *ot)
|
|||||||
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
|
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ******************* Action Push-Down Operator ******************** */
|
/** \} */
|
||||||
|
|
||||||
|
/* -------------------------------------------------------------------- */
|
||||||
|
/** \name Action Push-Down Operator
|
||||||
|
*
|
||||||
|
* Criteria:
|
||||||
|
* 1) There must be an dope-sheet/action editor, and it must be in a mode which uses actions.
|
||||||
|
* 2) There must be an action active.
|
||||||
|
* 3) The associated #AnimData block must not be in tweak-mode.
|
||||||
|
* \{ */
|
||||||
|
|
||||||
/* Criteria:
|
|
||||||
* 1) There must be an dopesheet/action editor, and it must be in a mode which uses actions
|
|
||||||
* 2) There must be an action active
|
|
||||||
* 3) The associated AnimData block must not be in tweak-mode
|
|
||||||
*/
|
|
||||||
static bool action_pushdown_poll(bContext *C)
|
static bool action_pushdown_poll(bContext *C)
|
||||||
{
|
{
|
||||||
if (ED_operator_action_active(C)) {
|
if (ED_operator_action_active(C)) {
|
||||||
@ -370,7 +382,11 @@ void ACTION_OT_push_down(wmOperatorType *ot)
|
|||||||
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
|
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ******************* Action Stash Operator ******************** */
|
/** \} */
|
||||||
|
|
||||||
|
/* -------------------------------------------------------------------- */
|
||||||
|
/** \name Action Stash Operator
|
||||||
|
* \{ */
|
||||||
|
|
||||||
static int action_stash_exec(bContext *C, wmOperator *op)
|
static int action_stash_exec(bContext *C, wmOperator *op)
|
||||||
{
|
{
|
||||||
@ -432,12 +448,16 @@ void ACTION_OT_stash(wmOperatorType *ot)
|
|||||||
"Create a new action once the existing one has been safely stored");
|
"Create a new action once the existing one has been safely stored");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ----------------- */
|
/** \} */
|
||||||
|
|
||||||
|
/* -------------------------------------------------------------------- */
|
||||||
|
/** \name Action Stash & Create Operator
|
||||||
|
*
|
||||||
|
* Criteria:
|
||||||
|
* 1) There must be an dope-sheet/action editor, and it must be in a mode which uses actions.
|
||||||
|
* 2) The associated #AnimData block must not be in tweak-mode.
|
||||||
|
* \{ */
|
||||||
|
|
||||||
/* Criteria:
|
|
||||||
* 1) There must be an dopesheet/action editor, and it must be in a mode which uses actions
|
|
||||||
* 2) The associated AnimData block must not be in tweak-mode
|
|
||||||
*/
|
|
||||||
static bool action_stash_create_poll(bContext *C)
|
static bool action_stash_create_poll(bContext *C)
|
||||||
{
|
{
|
||||||
if (ED_operator_action_active(C)) {
|
if (ED_operator_action_active(C)) {
|
||||||
@ -536,17 +556,18 @@ void ACTION_OT_stash_and_create(wmOperatorType *ot)
|
|||||||
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
|
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ************************************************************************** */
|
/** \} */
|
||||||
/* ACTION UNLINK */
|
|
||||||
|
|
||||||
/* ******************* Action Unlink Operator ******************** */
|
/* -------------------------------------------------------------------- */
|
||||||
/* We use a custom unlink operator here, as there are some technicalities which need special care:
|
/** \name Action Unlink Operator
|
||||||
|
*
|
||||||
|
* We use a custom unlink operator here, as there are some technicalities which need special care:
|
||||||
* 1) When in Tweak Mode, it shouldn't be possible to unlink the active action,
|
* 1) When in Tweak Mode, it shouldn't be possible to unlink the active action,
|
||||||
* or else, everything turns to custard.
|
* or else, everything turns to custard.
|
||||||
* 2) If the Action doesn't have any other users, the user should at least get
|
* 2) If the Action doesn't have any other users, the user should at least get
|
||||||
* a warning that it is going to get lost.
|
* a warning that it is going to get lost.
|
||||||
* 3) We need a convenient way to exit Tweak Mode from the Action Editor
|
* 3) We need a convenient way to exit Tweak Mode from the Action Editor
|
||||||
*/
|
* \{ */
|
||||||
|
|
||||||
void ED_animedit_unlink_action(
|
void ED_animedit_unlink_action(
|
||||||
bContext *C, ID *id, AnimData *adt, bAction *act, ReportList *reports, bool force_delete)
|
bContext *C, ID *id, AnimData *adt, bAction *act, ReportList *reports, bool force_delete)
|
||||||
@ -701,8 +722,11 @@ void ACTION_OT_unlink(wmOperatorType *ot)
|
|||||||
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
|
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ************************************************************************** */
|
/** \} */
|
||||||
/* ACTION BROWSING */
|
|
||||||
|
/* -------------------------------------------------------------------- */
|
||||||
|
/** \name Action Browsing
|
||||||
|
* \{ */
|
||||||
|
|
||||||
/* Try to find NLA Strip to use for action layer up/down tool */
|
/* Try to find NLA Strip to use for action layer up/down tool */
|
||||||
static NlaStrip *action_layer_get_nlastrip(ListBase *strips, float ctime)
|
static NlaStrip *action_layer_get_nlastrip(ListBase *strips, float ctime)
|
||||||
@ -775,7 +799,11 @@ static void action_layer_switch_strip(
|
|||||||
BLI_assert(adt->actstrip == strip);
|
BLI_assert(adt->actstrip == strip);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ********************** One Layer Up Operator ************************** */
|
/** \} */
|
||||||
|
|
||||||
|
/* -------------------------------------------------------------------- */
|
||||||
|
/** \name One Layer Up Operator
|
||||||
|
* \{ */
|
||||||
|
|
||||||
static bool action_layer_next_poll(bContext *C)
|
static bool action_layer_next_poll(bContext *C)
|
||||||
{
|
{
|
||||||
@ -886,7 +914,11 @@ void ACTION_OT_layer_next(wmOperatorType *ot)
|
|||||||
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
|
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ********************* One Layer Down Operator ************************* */
|
/** \} */
|
||||||
|
|
||||||
|
/* -------------------------------------------------------------------- */
|
||||||
|
/** \name One Layer Down Operator
|
||||||
|
* \{ */
|
||||||
|
|
||||||
static bool action_layer_prev_poll(bContext *C)
|
static bool action_layer_prev_poll(bContext *C)
|
||||||
{
|
{
|
||||||
@ -985,4 +1017,4 @@ void ACTION_OT_layer_prev(wmOperatorType *ot)
|
|||||||
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
|
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ************************************************************************** */
|
/** \} */
|
||||||
|
@ -44,8 +44,9 @@
|
|||||||
|
|
||||||
#include "action_intern.h"
|
#include "action_intern.h"
|
||||||
|
|
||||||
/* ************************************************************************* */
|
/* -------------------------------------------------------------------- */
|
||||||
/* Channel List */
|
/** \name Channel List
|
||||||
|
* \{ */
|
||||||
|
|
||||||
void draw_channel_names(bContext *C, bAnimContext *ac, ARegion *region)
|
void draw_channel_names(bContext *C, bAnimContext *ac, ARegion *region)
|
||||||
{
|
{
|
||||||
@ -110,8 +111,11 @@ void draw_channel_names(bContext *C, bAnimContext *ac, ARegion *region)
|
|||||||
ANIM_animdata_freelist(&anim_data);
|
ANIM_animdata_freelist(&anim_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ************************************************************************* */
|
/** \} */
|
||||||
/* Keyframes */
|
|
||||||
|
/* -------------------------------------------------------------------- */
|
||||||
|
/** \name Keyframes
|
||||||
|
* \{ */
|
||||||
|
|
||||||
/* extra padding for lengths (to go under scrollers) */
|
/* extra padding for lengths (to go under scrollers) */
|
||||||
#define EXTRA_SCROLL_PAD 100.0f
|
#define EXTRA_SCROLL_PAD 100.0f
|
||||||
@ -424,8 +428,11 @@ void draw_channel_strips(bAnimContext *ac, SpaceAction *saction, ARegion *region
|
|||||||
ANIM_animdata_freelist(&anim_data);
|
ANIM_animdata_freelist(&anim_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ************************************************************************* */
|
/** \} */
|
||||||
/* Timeline - Caches */
|
|
||||||
|
/* -------------------------------------------------------------------- */
|
||||||
|
/** \name Timeline - Caches
|
||||||
|
* \{ */
|
||||||
|
|
||||||
static bool timeline_cache_is_hidden_by_setting(SpaceAction *saction, PTCacheID *pid)
|
static bool timeline_cache_is_hidden_by_setting(SpaceAction *saction, PTCacheID *pid)
|
||||||
{
|
{
|
||||||
@ -659,4 +666,4 @@ void timeline_draw_cache(SpaceAction *saction, Object *ob, Scene *scene)
|
|||||||
BLI_freelistN(&pidlist);
|
BLI_freelistN(&pidlist);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ************************************************************************* */
|
/** \} */
|
||||||
|
@ -54,10 +54,9 @@
|
|||||||
|
|
||||||
#include "action_intern.h"
|
#include "action_intern.h"
|
||||||
|
|
||||||
/* ************************************************************************** */
|
/* -------------------------------------------------------------------- */
|
||||||
/* POSE MARKERS STUFF */
|
/** \name Pose Markers: Localize Markers
|
||||||
|
* \{ */
|
||||||
/* *************************** Localize Markers ***************************** */
|
|
||||||
|
|
||||||
/* ensure that there is:
|
/* ensure that there is:
|
||||||
* 1) an active action editor
|
* 1) an active action editor
|
||||||
@ -142,10 +141,11 @@ void ACTION_OT_markers_make_local(wmOperatorType *ot)
|
|||||||
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
|
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ************************************************************************** */
|
/** \} */
|
||||||
/* KEYFRAME-RANGE STUFF */
|
|
||||||
|
|
||||||
/* *************************** Calculate Range ************************** */
|
/* -------------------------------------------------------------------- */
|
||||||
|
/** \name Calculate Range
|
||||||
|
* \{ */
|
||||||
|
|
||||||
/* Get the min/max keyframes. */
|
/* Get the min/max keyframes. */
|
||||||
static bool get_keyframe_extents(bAnimContext *ac, float *min, float *max, const short onlySel)
|
static bool get_keyframe_extents(bAnimContext *ac, float *min, float *max, const short onlySel)
|
||||||
@ -242,7 +242,11 @@ static bool get_keyframe_extents(bAnimContext *ac, float *min, float *max, const
|
|||||||
return found;
|
return found;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ****************** Automatic Preview-Range Operator ****************** */
|
/** \} */
|
||||||
|
|
||||||
|
/* -------------------------------------------------------------------- */
|
||||||
|
/** \name View: Automatic Preview-Range Operator
|
||||||
|
* \{ */
|
||||||
|
|
||||||
static int actkeys_previewrange_exec(bContext *C, wmOperator *UNUSED(op))
|
static int actkeys_previewrange_exec(bContext *C, wmOperator *UNUSED(op))
|
||||||
{
|
{
|
||||||
@ -292,7 +296,11 @@ void ACTION_OT_previewrange_set(wmOperatorType *ot)
|
|||||||
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
|
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ****************** View-All Operator ****************** */
|
/** \} */
|
||||||
|
|
||||||
|
/* -------------------------------------------------------------------- */
|
||||||
|
/** \name View: All Operator
|
||||||
|
* \{ */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Find the extents of the active channel
|
* Find the extents of the active channel
|
||||||
@ -459,7 +467,11 @@ void ACTION_OT_view_selected(wmOperatorType *ot)
|
|||||||
ot->flag = 0;
|
ot->flag = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ****************** View-All Operator ****************** */
|
/** \} */
|
||||||
|
|
||||||
|
/* -------------------------------------------------------------------- */
|
||||||
|
/** \name View: Frame Operator
|
||||||
|
* \{ */
|
||||||
|
|
||||||
static int actkeys_view_frame_exec(bContext *C, wmOperator *op)
|
static int actkeys_view_frame_exec(bContext *C, wmOperator *op)
|
||||||
{
|
{
|
||||||
@ -484,10 +496,12 @@ void ACTION_OT_view_frame(wmOperatorType *ot)
|
|||||||
ot->flag = 0;
|
ot->flag = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ************************************************************************** */
|
/** \} */
|
||||||
/* GENERAL STUFF */
|
|
||||||
|
/* -------------------------------------------------------------------- */
|
||||||
|
/** \name Keyframes: Copy/Paste Operator
|
||||||
|
* \{ */
|
||||||
|
|
||||||
/* ******************** Copy/Paste Keyframes Operator ************************* */
|
|
||||||
/* NOTE: the backend code for this is shared with the graph editor */
|
/* NOTE: the backend code for this is shared with the graph editor */
|
||||||
|
|
||||||
static short copy_action_keys(bAnimContext *ac)
|
static short copy_action_keys(bAnimContext *ac)
|
||||||
@ -712,7 +726,11 @@ void ACTION_OT_paste(wmOperatorType *ot)
|
|||||||
RNA_def_property_flag(prop, PROP_SKIP_SAVE);
|
RNA_def_property_flag(prop, PROP_SKIP_SAVE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ******************** Insert Keyframes Operator ************************* */
|
/** \} */
|
||||||
|
|
||||||
|
/* -------------------------------------------------------------------- */
|
||||||
|
/** \name Keyframes: Insert Operator
|
||||||
|
* \{ */
|
||||||
|
|
||||||
/* defines for insert keyframes tool */
|
/* defines for insert keyframes tool */
|
||||||
static const EnumPropertyItem prop_actkeys_insertkey_types[] = {
|
static const EnumPropertyItem prop_actkeys_insertkey_types[] = {
|
||||||
@ -902,7 +920,11 @@ void ACTION_OT_keyframe_insert(wmOperatorType *ot)
|
|||||||
ot->prop = RNA_def_enum(ot->srna, "type", prop_actkeys_insertkey_types, 0, "Type", "");
|
ot->prop = RNA_def_enum(ot->srna, "type", prop_actkeys_insertkey_types, 0, "Type", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ******************** Duplicate Keyframes Operator ************************* */
|
/** \} */
|
||||||
|
|
||||||
|
/* -------------------------------------------------------------------- */
|
||||||
|
/** \name Keyframes: Duplicate Operator
|
||||||
|
* \{ */
|
||||||
|
|
||||||
static bool duplicate_action_keys(bAnimContext *ac)
|
static bool duplicate_action_keys(bAnimContext *ac)
|
||||||
{
|
{
|
||||||
@ -978,7 +1000,11 @@ void ACTION_OT_duplicate(wmOperatorType *ot)
|
|||||||
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
|
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ******************** Delete Keyframes Operator ************************* */
|
/** \} */
|
||||||
|
|
||||||
|
/* -------------------------------------------------------------------- */
|
||||||
|
/** \name Keyframes: Delete Operator
|
||||||
|
* \{ */
|
||||||
|
|
||||||
static bool delete_action_keys(bAnimContext *ac)
|
static bool delete_action_keys(bAnimContext *ac)
|
||||||
{
|
{
|
||||||
@ -1067,7 +1093,11 @@ void ACTION_OT_delete(wmOperatorType *ot)
|
|||||||
WM_operator_properties_confirm_or_exec(ot);
|
WM_operator_properties_confirm_or_exec(ot);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ******************** Clean Keyframes Operator ************************* */
|
/** \} */
|
||||||
|
|
||||||
|
/* -------------------------------------------------------------------- */
|
||||||
|
/** \name Keyframes: Clean Operator
|
||||||
|
* \{ */
|
||||||
|
|
||||||
static void clean_action_keys(bAnimContext *ac, float thresh, bool clean_chan)
|
static void clean_action_keys(bAnimContext *ac, float thresh, bool clean_chan)
|
||||||
{
|
{
|
||||||
@ -1143,7 +1173,11 @@ void ACTION_OT_clean(wmOperatorType *ot)
|
|||||||
RNA_def_boolean(ot->srna, "channels", false, "Channels", "");
|
RNA_def_boolean(ot->srna, "channels", false, "Channels", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ******************** Sample Keyframes Operator *********************** */
|
/** \} */
|
||||||
|
|
||||||
|
/* -------------------------------------------------------------------- */
|
||||||
|
/** \name Keyframes: Sample Operator
|
||||||
|
* \{ */
|
||||||
|
|
||||||
/* Evaluates the curves between each selected keyframe on each frame, and keys the value. */
|
/* Evaluates the curves between each selected keyframe on each frame, and keys the value. */
|
||||||
static void sample_action_keys(bAnimContext *ac)
|
static void sample_action_keys(bAnimContext *ac)
|
||||||
@ -1208,10 +1242,11 @@ void ACTION_OT_sample(wmOperatorType *ot)
|
|||||||
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
|
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ************************************************************************** */
|
/** \} */
|
||||||
/* SETTINGS STUFF */
|
|
||||||
|
|
||||||
/* ******************** Set Extrapolation-Type Operator *********************** */
|
/* -------------------------------------------------------------------- */
|
||||||
|
/** \name Settings: Set Extrapolation-Type Operator
|
||||||
|
* \{ */
|
||||||
|
|
||||||
/* defines for make/clear cyclic extrapolation tools */
|
/* defines for make/clear cyclic extrapolation tools */
|
||||||
#define MAKE_CYCLIC_EXPO -1
|
#define MAKE_CYCLIC_EXPO -1
|
||||||
@ -1343,7 +1378,11 @@ void ACTION_OT_extrapolation_type(wmOperatorType *ot)
|
|||||||
ot->prop = RNA_def_enum(ot->srna, "type", prop_actkeys_expo_types, 0, "Type", "");
|
ot->prop = RNA_def_enum(ot->srna, "type", prop_actkeys_expo_types, 0, "Type", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ******************** Set Interpolation-Type Operator *********************** */
|
/** \} */
|
||||||
|
|
||||||
|
/* -------------------------------------------------------------------- */
|
||||||
|
/** \name Settings: Set Interpolation-Type Operator
|
||||||
|
* \{ */
|
||||||
|
|
||||||
static int actkeys_ipo_exec(bContext *C, wmOperator *op)
|
static int actkeys_ipo_exec(bContext *C, wmOperator *op)
|
||||||
{
|
{
|
||||||
@ -1398,7 +1437,11 @@ void ACTION_OT_interpolation_type(wmOperatorType *ot)
|
|||||||
RNA_def_property_translation_context(ot->prop, BLT_I18NCONTEXT_ID_ACTION);
|
RNA_def_property_translation_context(ot->prop, BLT_I18NCONTEXT_ID_ACTION);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ******************** Set Easing Operator *********************** */
|
/** \} */
|
||||||
|
|
||||||
|
/* -------------------------------------------------------------------- */
|
||||||
|
/** \name Settings: Set Easing Operator
|
||||||
|
* \{ */
|
||||||
|
|
||||||
static int actkeys_easing_exec(bContext *C, wmOperator *op)
|
static int actkeys_easing_exec(bContext *C, wmOperator *op)
|
||||||
{
|
{
|
||||||
@ -1447,7 +1490,11 @@ void ACTION_OT_easing_type(wmOperatorType *ot)
|
|||||||
ot->srna, "type", rna_enum_beztriple_interpolation_easing_items, 0, "Type", "");
|
ot->srna, "type", rna_enum_beztriple_interpolation_easing_items, 0, "Type", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ******************** Set Handle-Type Operator *********************** */
|
/** \} */
|
||||||
|
|
||||||
|
/* -------------------------------------------------------------------- */
|
||||||
|
/** \name Settings: Set Handle-Type Operator
|
||||||
|
* \{ */
|
||||||
|
|
||||||
/* this function is responsible for setting handle-type of selected keyframes */
|
/* this function is responsible for setting handle-type of selected keyframes */
|
||||||
static void sethandles_action_keys(bAnimContext *ac, short mode)
|
static void sethandles_action_keys(bAnimContext *ac, short mode)
|
||||||
@ -1532,7 +1579,11 @@ void ACTION_OT_handle_type(wmOperatorType *ot)
|
|||||||
ot->prop = RNA_def_enum(ot->srna, "type", rna_enum_keyframe_handle_type_items, 0, "Type", "");
|
ot->prop = RNA_def_enum(ot->srna, "type", rna_enum_keyframe_handle_type_items, 0, "Type", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ******************** Set Keyframe-Type Operator *********************** */
|
/** \} */
|
||||||
|
|
||||||
|
/* -------------------------------------------------------------------- */
|
||||||
|
/** \name Settings: Set Keyframe-Type Operator
|
||||||
|
* \{ */
|
||||||
|
|
||||||
/* this function is responsible for setting keyframe type for keyframes */
|
/* this function is responsible for setting keyframe type for keyframes */
|
||||||
static void setkeytype_action_keys(bAnimContext *ac, short mode)
|
static void setkeytype_action_keys(bAnimContext *ac, short mode)
|
||||||
@ -1620,10 +1671,11 @@ void ACTION_OT_keyframe_type(wmOperatorType *ot)
|
|||||||
ot->prop = RNA_def_enum(ot->srna, "type", rna_enum_beztriple_keyframe_type_items, 0, "Type", "");
|
ot->prop = RNA_def_enum(ot->srna, "type", rna_enum_beztriple_keyframe_type_items, 0, "Type", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ************************************************************************** */
|
/** \} */
|
||||||
/* TRANSFORM STUFF */
|
|
||||||
|
|
||||||
/* ***************** Jump to Selected Frames Operator *********************** */
|
/* -------------------------------------------------------------------- */
|
||||||
|
/** \name Transform: Jump to Selected Frames Operator
|
||||||
|
* \{ */
|
||||||
|
|
||||||
static bool actkeys_framejump_poll(bContext *C)
|
static bool actkeys_framejump_poll(bContext *C)
|
||||||
{
|
{
|
||||||
@ -1722,7 +1774,11 @@ void ACTION_OT_frame_jump(wmOperatorType *ot)
|
|||||||
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
|
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ******************** Snap Keyframes Operator *********************** */
|
/** \} */
|
||||||
|
|
||||||
|
/* -------------------------------------------------------------------- */
|
||||||
|
/** \name Transform: Snap Keyframes Operator
|
||||||
|
* \{ */
|
||||||
|
|
||||||
/* defines for snap keyframes tool */
|
/* defines for snap keyframes tool */
|
||||||
static const EnumPropertyItem prop_actkeys_snap_types[] = {
|
static const EnumPropertyItem prop_actkeys_snap_types[] = {
|
||||||
@ -1852,7 +1908,11 @@ void ACTION_OT_snap(wmOperatorType *ot)
|
|||||||
ot->prop = RNA_def_enum(ot->srna, "type", prop_actkeys_snap_types, 0, "Type", "");
|
ot->prop = RNA_def_enum(ot->srna, "type", prop_actkeys_snap_types, 0, "Type", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ******************** Mirror Keyframes Operator *********************** */
|
/** \} */
|
||||||
|
|
||||||
|
/* -------------------------------------------------------------------- */
|
||||||
|
/** \name Transform: Mirror Keyframes Operator
|
||||||
|
* \{ */
|
||||||
|
|
||||||
/* defines for mirror keyframes tool */
|
/* defines for mirror keyframes tool */
|
||||||
static const EnumPropertyItem prop_actkeys_mirror_types[] = {
|
static const EnumPropertyItem prop_actkeys_mirror_types[] = {
|
||||||
@ -1976,4 +2036,4 @@ void ACTION_OT_mirror(wmOperatorType *ot)
|
|||||||
ot->prop = RNA_def_enum(ot->srna, "type", prop_actkeys_mirror_types, 0, "Type", "");
|
ot->prop = RNA_def_enum(ot->srna, "type", prop_actkeys_mirror_types, 0, "Type", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ************************************************************************** */
|
/** \} */
|
||||||
|
@ -48,8 +48,9 @@
|
|||||||
|
|
||||||
#include "action_intern.h"
|
#include "action_intern.h"
|
||||||
|
|
||||||
/* ************************************************************************** */
|
/* -------------------------------------------------------------------- */
|
||||||
/* KEYFRAMES STUFF */
|
/** \name Keyframes Stuff
|
||||||
|
* \{ */
|
||||||
|
|
||||||
static bAnimListElem *actkeys_find_list_element_at_position(bAnimContext *ac,
|
static bAnimListElem *actkeys_find_list_element_at_position(bAnimContext *ac,
|
||||||
int filter,
|
int filter,
|
||||||
@ -218,12 +219,16 @@ static bool actkeys_is_key_at_position(bAnimContext *ac, float region_x, float r
|
|||||||
return found;
|
return found;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ******************** Deselect All Operator ***************************** */
|
/** \} */
|
||||||
/* This operator works in one of three ways:
|
|
||||||
* 1) (de)select all (AKEY) - test if select all or deselect all
|
/* -------------------------------------------------------------------- */
|
||||||
* 2) invert all (CTRL-IKEY) - invert selection of all keyframes
|
/** \name Deselect All Operator
|
||||||
* 3) (de)select all - no testing is done; only for use internal tools as normal function...
|
*
|
||||||
*/
|
* This operator works in one of three ways:
|
||||||
|
* 1) (de)select all (AKEY) - test if select all or deselect all.
|
||||||
|
* 2) invert all (CTRL-IKEY) - invert selection of all keyframes.
|
||||||
|
* 3) (de)select all - no testing is done; only for use internal tools as normal function.
|
||||||
|
* \{ */
|
||||||
|
|
||||||
/* Deselects keyframes in the action editor
|
/* Deselects keyframes in the action editor
|
||||||
* - This is called by the deselect all operator, as well as other ones!
|
* - This is called by the deselect all operator, as well as other ones!
|
||||||
@ -352,15 +357,18 @@ void ACTION_OT_select_all(wmOperatorType *ot)
|
|||||||
WM_operator_properties_select_all(ot);
|
WM_operator_properties_select_all(ot);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ******************** Box Select Operator **************************** */
|
/** \} */
|
||||||
/**
|
|
||||||
|
/* -------------------------------------------------------------------- */
|
||||||
|
/** \name Box Select Operator
|
||||||
|
*
|
||||||
* This operator currently works in one of three ways:
|
* This operator currently works in one of three ways:
|
||||||
* - BKEY - 1) all keyframes within region are selected #ACTKEYS_BORDERSEL_ALLKEYS.
|
* - BKEY - 1) all keyframes within region are selected #ACTKEYS_BORDERSEL_ALLKEYS.
|
||||||
* - ALT-BKEY - depending on which axis of the region was larger...
|
* - ALT-BKEY - depending on which axis of the region was larger...
|
||||||
* - 2) x-axis, so select all frames within frame range #ACTKEYS_BORDERSEL_FRAMERANGE.
|
* - 2) x-axis, so select all frames within frame range #ACTKEYS_BORDERSEL_FRAMERANGE.
|
||||||
* - 3) y-axis, so select all frames within channels that region included
|
* - 3) y-axis, so select all frames within channels that region included
|
||||||
* #ACTKEYS_BORDERSEL_CHANNELS.
|
* #ACTKEYS_BORDERSEL_CHANNELS.
|
||||||
*/
|
* \{ */
|
||||||
|
|
||||||
/* defines for box_select mode */
|
/* defines for box_select mode */
|
||||||
enum {
|
enum {
|
||||||
@ -606,11 +614,15 @@ void ACTION_OT_select_box(wmOperatorType *ot)
|
|||||||
RNA_def_property_flag(prop, PROP_SKIP_SAVE);
|
RNA_def_property_flag(prop, PROP_SKIP_SAVE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ******************** Region Select Operators ***************************** */
|
/** \} */
|
||||||
/* "Region Select" operators include the Lasso and Circle Select operators.
|
|
||||||
|
/* -------------------------------------------------------------------- */
|
||||||
|
/** \name Region Select Operators
|
||||||
|
*
|
||||||
|
* "Region Select" operators include the Lasso and Circle Select operators.
|
||||||
* These two ended up being lumped together, as it was easier in the
|
* These two ended up being lumped together, as it was easier in the
|
||||||
* original Graph Editor implementation of these to do it this way.
|
* original Graph Editor implementation of these to do it this way.
|
||||||
*/
|
* \{ */
|
||||||
|
|
||||||
typedef struct RegionSelectData {
|
typedef struct RegionSelectData {
|
||||||
bAnimContext *ac;
|
bAnimContext *ac;
|
||||||
@ -903,13 +915,17 @@ void ACTION_OT_select_circle(wmOperatorType *ot)
|
|||||||
WM_operator_properties_select_operation_simple(ot);
|
WM_operator_properties_select_operation_simple(ot);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ******************** Column Select Operator **************************** */
|
/** \} */
|
||||||
/* This operator works in one of four ways:
|
|
||||||
|
/* -------------------------------------------------------------------- */
|
||||||
|
/** \name Column Select Operator
|
||||||
|
*
|
||||||
|
* This operator works in one of four ways:
|
||||||
* - 1) select all keyframes in the same frame as a selected one (KKEY)
|
* - 1) select all keyframes in the same frame as a selected one (KKEY)
|
||||||
* - 2) select all keyframes in the same frame as the current frame marker (CTRL-KKEY)
|
* - 2) select all keyframes in the same frame as the current frame marker (CTRL-KKEY)
|
||||||
* - 3) select all keyframes in the same frame as a selected markers (SHIFT-KKEY)
|
* - 3) select all keyframes in the same frame as a selected markers (SHIFT-KKEY)
|
||||||
* - 4) select all keyframes that occur between selected markers (ALT-KKEY)
|
* - 4) select all keyframes that occur between selected markers (ALT-KKEY)
|
||||||
*/
|
* \{ */
|
||||||
|
|
||||||
/* defines for column-select mode */
|
/* defines for column-select mode */
|
||||||
static const EnumPropertyItem prop_column_select_types[] = {
|
static const EnumPropertyItem prop_column_select_types[] = {
|
||||||
@ -1140,7 +1156,11 @@ void ACTION_OT_select_column(wmOperatorType *ot)
|
|||||||
RNA_def_property_flag(ot->prop, PROP_HIDDEN);
|
RNA_def_property_flag(ot->prop, PROP_HIDDEN);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ******************** Select Linked Operator *********************** */
|
/** \} */
|
||||||
|
|
||||||
|
/* -------------------------------------------------------------------- */
|
||||||
|
/** \name Select Linked Operator
|
||||||
|
* \{ */
|
||||||
|
|
||||||
static int actkeys_select_linked_exec(bContext *C, wmOperator *UNUSED(op))
|
static int actkeys_select_linked_exec(bContext *C, wmOperator *UNUSED(op))
|
||||||
{
|
{
|
||||||
@ -1199,7 +1219,11 @@ void ACTION_OT_select_linked(wmOperatorType *ot)
|
|||||||
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
|
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ******************** Select More/Less Operators *********************** */
|
/** \} */
|
||||||
|
|
||||||
|
/* -------------------------------------------------------------------- */
|
||||||
|
/** \name Select More/Less Operators
|
||||||
|
* \{ */
|
||||||
|
|
||||||
/* Common code to perform selection */
|
/* Common code to perform selection */
|
||||||
static void select_moreless_action_keys(bAnimContext *ac, short mode)
|
static void select_moreless_action_keys(bAnimContext *ac, short mode)
|
||||||
@ -1322,8 +1346,13 @@ void ACTION_OT_select_less(wmOperatorType *ot)
|
|||||||
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
|
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ******************** Select Left/Right Operator ************************* */
|
/** \} */
|
||||||
/* Select keyframes left/right of the current frame indicator */
|
|
||||||
|
/* -------------------------------------------------------------------- */
|
||||||
|
/** \name Select Left/Right Operator
|
||||||
|
*
|
||||||
|
* Select keyframes left/right of the current frame indicator.
|
||||||
|
* \{ */
|
||||||
|
|
||||||
/* defines for left-right select tool */
|
/* defines for left-right select tool */
|
||||||
static const EnumPropertyItem prop_actkeys_leftright_select_types[] = {
|
static const EnumPropertyItem prop_actkeys_leftright_select_types[] = {
|
||||||
@ -1520,8 +1549,12 @@ void ACTION_OT_select_leftright(wmOperatorType *ot)
|
|||||||
RNA_def_property_flag(prop, PROP_SKIP_SAVE);
|
RNA_def_property_flag(prop, PROP_SKIP_SAVE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ******************** Mouse-Click Select Operator *********************** */
|
/** \} */
|
||||||
/* This operator works in one of three ways:
|
|
||||||
|
/* -------------------------------------------------------------------- */
|
||||||
|
/** \name Mouse-Click Select Operator
|
||||||
|
*
|
||||||
|
* This operator works in one of three ways:
|
||||||
* - 1) keyframe under mouse - no special modifiers
|
* - 1) keyframe under mouse - no special modifiers
|
||||||
* - 2) all keyframes on the same side of current frame indicator as mouse - ALT modifier
|
* - 2) all keyframes on the same side of current frame indicator as mouse - ALT modifier
|
||||||
* - 3) column select all keyframes in frame under mouse - CTRL modifier
|
* - 3) column select all keyframes in frame under mouse - CTRL modifier
|
||||||
@ -1529,9 +1562,7 @@ void ACTION_OT_select_leftright(wmOperatorType *ot)
|
|||||||
*
|
*
|
||||||
* In addition to these basic options, the SHIFT modifier can be used to toggle the
|
* In addition to these basic options, the SHIFT modifier can be used to toggle the
|
||||||
* selection mode between replacing the selection (without) and inverting the selection (with).
|
* selection mode between replacing the selection (without) and inverting the selection (with).
|
||||||
*/
|
* \{ */
|
||||||
|
|
||||||
/* ------------------- */
|
|
||||||
|
|
||||||
/* option 1) select keyframe directly under mouse */
|
/* option 1) select keyframe directly under mouse */
|
||||||
static void actkeys_mselect_single(bAnimContext *ac,
|
static void actkeys_mselect_single(bAnimContext *ac,
|
||||||
@ -1905,4 +1936,4 @@ void ACTION_OT_clickselect(wmOperatorType *ot)
|
|||||||
RNA_def_property_flag(prop, PROP_SKIP_SAVE);
|
RNA_def_property_flag(prop, PROP_SKIP_SAVE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ************************************************************************** */
|
/** \} */
|
||||||
|
@ -46,7 +46,9 @@
|
|||||||
|
|
||||||
#include "action_intern.h" /* own include */
|
#include "action_intern.h" /* own include */
|
||||||
|
|
||||||
/* ******************** default callbacks for action space ***************** */
|
/* -------------------------------------------------------------------- */
|
||||||
|
/** \name Default Callbacks for Action Space
|
||||||
|
* \{ */
|
||||||
|
|
||||||
static SpaceLink *action_create(const ScrArea *area, const Scene *scene)
|
static SpaceLink *action_create(const ScrArea *area, const Scene *scene)
|
||||||
{
|
{
|
||||||
@ -962,3 +964,5 @@ void ED_spacetype_action(void)
|
|||||||
|
|
||||||
BKE_spacetype_register(st);
|
BKE_spacetype_register(st);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \} */
|
||||||
|
Loading…
Reference in New Issue
Block a user