de-duplicate sequencer jump operator, use next/prev option instead.
This commit is contained in:
@@ -2030,8 +2030,8 @@ static void SCREEN_OT_keyframe_jump(wmOperatorType *ot)
|
||||
ot->poll = ED_operator_screenactive_norender;
|
||||
ot->flag = OPTYPE_UNDO;
|
||||
|
||||
/* rna */
|
||||
RNA_def_boolean(ot->srna, "next", 1, "Next Keyframe", "");
|
||||
/* properties */
|
||||
RNA_def_boolean(ot->srna, "next", TRUE, "Next Keyframe", "");
|
||||
}
|
||||
|
||||
/* ************** switch screen operator ***************************** */
|
||||
|
||||
@@ -2345,42 +2345,13 @@ static int next_prev_edit_internal(Scene *scene, int side)
|
||||
return change;
|
||||
}
|
||||
|
||||
/* move frame to next edit point operator */
|
||||
static int sequencer_next_edit_exec(bContext *C, wmOperator *UNUSED(op))
|
||||
/* jump frame to edit point operator */
|
||||
static int sequencer_strip_jump_exec(bContext *C, wmOperator *op)
|
||||
{
|
||||
Scene *scene = CTX_data_scene(C);
|
||||
|
||||
if (!next_prev_edit_internal(scene, SEQ_SIDE_RIGHT))
|
||||
return OPERATOR_CANCELLED;
|
||||
short next = RNA_boolean_get(op->ptr, "next");
|
||||
|
||||
WM_event_add_notifier(C, NC_SCENE | ND_FRAME, scene);
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
||||
void SEQUENCER_OT_next_edit(wmOperatorType *ot)
|
||||
{
|
||||
/* identifiers */
|
||||
ot->name = "Next Edit";
|
||||
ot->idname = "SEQUENCER_OT_next_edit";
|
||||
ot->description = "Move frame to next edit point";
|
||||
|
||||
/* api callbacks */
|
||||
ot->exec = sequencer_next_edit_exec;
|
||||
ot->poll = sequencer_edit_poll;
|
||||
|
||||
/* flags */
|
||||
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
|
||||
|
||||
/* properties */
|
||||
}
|
||||
|
||||
/* move frame to previous edit point operator */
|
||||
static int sequencer_previous_edit_exec(bContext *C, wmOperator *UNUSED(op))
|
||||
{
|
||||
Scene *scene = CTX_data_scene(C);
|
||||
|
||||
if (!next_prev_edit_internal(scene, SEQ_SIDE_LEFT))
|
||||
if (!next_prev_edit_internal(scene, next ? SEQ_SIDE_RIGHT : SEQ_SIDE_LEFT))
|
||||
return OPERATOR_CANCELLED;
|
||||
|
||||
WM_event_add_notifier(C, NC_SCENE | ND_FRAME, scene);
|
||||
@@ -2388,21 +2359,22 @@ static int sequencer_previous_edit_exec(bContext *C, wmOperator *UNUSED(op))
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
||||
void SEQUENCER_OT_previous_edit(wmOperatorType *ot)
|
||||
void SEQUENCER_OT_strip_jump(wmOperatorType *ot)
|
||||
{
|
||||
/* identifiers */
|
||||
ot->name = "Previous Edit";
|
||||
ot->idname = "SEQUENCER_OT_previous_edit";
|
||||
ot->name = "Jump to Strip";
|
||||
ot->idname = "SEQUENCER_OT_strip_jump";
|
||||
ot->description = "Move frame to previous edit point";
|
||||
|
||||
/* api callbacks */
|
||||
ot->exec = sequencer_previous_edit_exec;
|
||||
ot->exec = sequencer_strip_jump_exec;
|
||||
ot->poll = sequencer_edit_poll;
|
||||
|
||||
/* flags */
|
||||
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
|
||||
|
||||
/* properties */
|
||||
RNA_def_boolean(ot->srna, "next", TRUE, "Next Strip", "");
|
||||
}
|
||||
|
||||
static void swap_sequence(Scene *scene, Sequence *seqa, Sequence *seqb)
|
||||
|
||||
@@ -95,8 +95,7 @@ void SEQUENCER_OT_meta_toggle(struct wmOperatorType *ot);
|
||||
void SEQUENCER_OT_meta_make(struct wmOperatorType *ot);
|
||||
void SEQUENCER_OT_meta_separate(struct wmOperatorType *ot);
|
||||
void SEQUENCER_OT_snap(struct wmOperatorType *ot);
|
||||
void SEQUENCER_OT_previous_edit(struct wmOperatorType *ot);
|
||||
void SEQUENCER_OT_next_edit(struct wmOperatorType *ot);
|
||||
void SEQUENCER_OT_strip_jump(struct wmOperatorType *ot);
|
||||
void SEQUENCER_OT_swap(struct wmOperatorType *ot);
|
||||
void SEQUENCER_OT_swap_data(struct wmOperatorType *ot);
|
||||
void SEQUENCER_OT_rendersize(struct wmOperatorType *ot);
|
||||
|
||||
@@ -72,8 +72,7 @@ void sequencer_operatortypes(void)
|
||||
WM_operatortype_append(SEQUENCER_OT_meta_make);
|
||||
WM_operatortype_append(SEQUENCER_OT_meta_separate);
|
||||
WM_operatortype_append(SEQUENCER_OT_snap);
|
||||
WM_operatortype_append(SEQUENCER_OT_next_edit);
|
||||
WM_operatortype_append(SEQUENCER_OT_previous_edit);
|
||||
WM_operatortype_append(SEQUENCER_OT_strip_jump);
|
||||
WM_operatortype_append(SEQUENCER_OT_swap);
|
||||
WM_operatortype_append(SEQUENCER_OT_swap_data);
|
||||
WM_operatortype_append(SEQUENCER_OT_rendersize);
|
||||
@@ -189,8 +188,10 @@ void sequencer_keymap(wmKeyConfig *keyconf)
|
||||
WM_keymap_add_item(keymap, "SEQUENCER_OT_view_all", HOMEKEY, KM_PRESS, 0, 0);
|
||||
WM_keymap_add_item(keymap, "SEQUENCER_OT_view_selected", PADPERIOD, KM_PRESS, 0, 0);
|
||||
|
||||
WM_keymap_add_item(keymap, "SEQUENCER_OT_next_edit", PAGEUPKEY, KM_PRESS, 0, 0);
|
||||
WM_keymap_add_item(keymap, "SEQUENCER_OT_previous_edit", PAGEDOWNKEY, KM_PRESS, 0, 0);
|
||||
kmi = WM_keymap_add_item(keymap, "SEQUENCER_OT_strip_jump", PAGEUPKEY, KM_PRESS, 0, 0);
|
||||
RNA_boolean_set(kmi->ptr, "next", TRUE);
|
||||
kmi = WM_keymap_add_item(keymap, "SEQUENCER_OT_strip_jump", PAGEDOWNKEY, KM_PRESS, 0, 0);
|
||||
RNA_boolean_set(kmi->ptr, "next", FALSE);
|
||||
|
||||
RNA_enum_set(WM_keymap_add_item(keymap, "SEQUENCER_OT_swap", LEFTARROWKEY, KM_PRESS, KM_ALT, 0)->ptr, "side", SEQ_SIDE_LEFT);
|
||||
RNA_enum_set(WM_keymap_add_item(keymap, "SEQUENCER_OT_swap", RIGHTARROWKEY, KM_PRESS, KM_ALT, 0)->ptr, "side", SEQ_SIDE_RIGHT);
|
||||
|
||||
Reference in New Issue
Block a user