Fix VSE retiming usability issues #113211
|
@ -564,6 +564,7 @@ class SEQUENCER_MT_select(Menu):
|
|||
layout = self.layout
|
||||
st = context.space_data
|
||||
has_sequencer, _has_preview = _space_view_types(st)
|
||||
is_retiming = context.scene.sequence_editor.selected_retiming_keys
|
||||
|
||||
layout.operator("sequencer.select_all", text="All").action = 'SELECT'
|
||||
layout.operator("sequencer.select_all", text="None").action = 'DESELECT'
|
||||
|
@ -572,21 +573,24 @@ class SEQUENCER_MT_select(Menu):
|
|||
layout.separator()
|
||||
|
||||
layout.operator("sequencer.select_box", text="Box Select")
|
||||
|
||||
col = layout.column()
|
||||
if has_sequencer:
|
||||
props = layout.operator("sequencer.select_box", text="Box Select (Include Handles)")
|
||||
props = col.operator("sequencer.select_box", text="Box Select (Include Handles)")
|
||||
props.include_handles = True
|
||||
|
||||
layout.separator()
|
||||
col.separator()
|
||||
|
||||
if has_sequencer:
|
||||
layout.operator_menu_enum("sequencer.select_side_of_frame", "side", text="Side of Frame...")
|
||||
layout.menu("SEQUENCER_MT_select_handle", text="Handle")
|
||||
layout.menu("SEQUENCER_MT_select_channel", text="Channel")
|
||||
layout.menu("SEQUENCER_MT_select_linked", text="Linked")
|
||||
col.operator_menu_enum("sequencer.select_side_of_frame", "side", text="Side of Frame...")
|
||||
col.menu("SEQUENCER_MT_select_handle", text="Handle")
|
||||
col.menu("SEQUENCER_MT_select_channel", text="Channel")
|
||||
col.menu("SEQUENCER_MT_select_linked", text="Linked")
|
||||
|
||||
layout.separator()
|
||||
col.separator()
|
||||
|
||||
layout.operator_menu_enum("sequencer.select_grouped", "type", text="Grouped")
|
||||
col.operator_menu_enum("sequencer.select_grouped", "type", text="Grouped")
|
||||
col.enabled = not is_retiming
|
||||
|
||||
|
||||
class SEQUENCER_MT_marker(Menu):
|
||||
|
@ -932,47 +936,33 @@ class SEQUENCER_MT_strip_movie(Menu):
|
|||
class SEQUENCER_MT_strip_retiming(Menu):
|
||||
bl_label = "Retiming"
|
||||
|
||||
def draw_strip_context(self, context):
|
||||
layout = self.layout
|
||||
def draw(self, context):
|
||||
is_retiming = context.scene.sequence_editor.selected_retiming_keys
|
||||
strip = context.active_sequence_strip
|
||||
layout = self.layout
|
||||
|
||||
layout.operator("sequencer.retiming_key_add")
|
||||
layout.operator("sequencer.retiming_freeze_frame_add")
|
||||
col = layout.column()
|
||||
col.operator("sequencer.retiming_transition_add")
|
||||
col.enabled = is_retiming
|
||||
|
||||
layout.separator()
|
||||
|
||||
layout.operator("sequencer.retiming_reset")
|
||||
layout.operator("sequencer.delete", text="Delete Retiming Keys")
|
||||
col = layout.column()
|
||||
col.operator("sequencer.retiming_reset")
|
||||
col.enabled = not is_retiming
|
||||
|
||||
layout.separator()
|
||||
|
||||
layout.operator("sequencer.retiming_segment_speed_set")
|
||||
layout.operator(
|
||||
"sequencer.retiming_show",
|
||||
icon='CHECKBOX_HLT' if (strip and strip.show_retiming_keys) else 'CHECKBOX_DEHLT',
|
||||
text="Toggle Retiming Keys",
|
||||
)
|
||||
|
||||
def draw_retiming_context(self, context):
|
||||
layout = self.layout
|
||||
|
||||
layout.operator("sequencer.retiming_key_add")
|
||||
layout.operator("sequencer.retiming_freeze_frame_add")
|
||||
layout.operator("sequencer.retiming_transition_add")
|
||||
layout.separator()
|
||||
|
||||
layout.operator("sequencer.delete")
|
||||
layout.separator()
|
||||
|
||||
layout.operator("sequencer.select_box")
|
||||
layout.operator("sequencer.select_all")
|
||||
layout.separator()
|
||||
|
||||
layout.operator("sequencer.retiming_segment_speed_set")
|
||||
layout.operator("sequencer.retiming_show", icon='CHECKBOX_HLT')
|
||||
|
||||
def draw(self, context):
|
||||
ed = context.scene.sequence_editor
|
||||
if ed.selected_retiming_keys:
|
||||
self.draw_retiming_context(context)
|
||||
else:
|
||||
self.draw_strip_context(context)
|
||||
|
||||
|
||||
class SEQUENCER_MT_strip(Menu):
|
||||
|
@ -1951,33 +1941,40 @@ class SEQUENCER_PT_time(SequencerButtonsPanel, Panel):
|
|||
|
||||
max_length = max(len(x) for x in length_list)
|
||||
max_factor = (1.9 - max_length) / 30
|
||||
factor = 0.45
|
||||
|
||||
layout.enabled = not strip.lock
|
||||
layout.active = not strip.mute
|
||||
|
||||
sub = layout.row(align=True)
|
||||
split = sub.split(factor=0.5 + max_factor)
|
||||
split = sub.split(factor=factor + max_factor)
|
||||
split.alignment = 'RIGHT'
|
||||
split.label(text="")
|
||||
split.prop(strip, "show_retiming_keys")
|
||||
|
||||
sub = layout.row(align=True)
|
||||
split = sub.split(factor=factor + max_factor)
|
||||
split.alignment = 'RIGHT'
|
||||
split.label(text="Channel")
|
||||
split.prop(strip, "channel", text="")
|
||||
|
||||
sub = layout.column(align=True)
|
||||
split = sub.split(factor=0.5 + max_factor, align=True)
|
||||
split = sub.split(factor=factor + max_factor, align=True)
|
||||
split.alignment = 'RIGHT'
|
||||
split.label(text="Start")
|
||||
split.prop(strip, "frame_start", text=smpte_from_frame(frame_start))
|
||||
|
||||
split = sub.split(factor=0.5 + max_factor, align=True)
|
||||
split = sub.split(factor=factor + max_factor, align=True)
|
||||
split.alignment = 'RIGHT'
|
||||
split.label(text="Duration")
|
||||
split.prop(strip, "frame_final_duration", text=smpte_from_frame(frame_final_duration))
|
||||
|
||||
# Use label, editing this value from the UI allows negative values,
|
||||
# users can adjust duration.
|
||||
split = sub.split(factor=0.5 + max_factor, align=True)
|
||||
split = sub.split(factor=factor + max_factor, align=True)
|
||||
split.alignment = 'RIGHT'
|
||||
split.label(text="End")
|
||||
split = split.split(factor=0.8 + max_factor, align=True)
|
||||
split = split.split(factor=factor + 0.3 + max_factor, align=True)
|
||||
split.label(text="%14s" % smpte_from_frame(frame_final_end))
|
||||
split.alignment = 'RIGHT'
|
||||
split.label(text=str(frame_final_end) + " ")
|
||||
|
@ -1987,12 +1984,12 @@ class SEQUENCER_PT_time(SequencerButtonsPanel, Panel):
|
|||
layout.alignment = 'RIGHT'
|
||||
sub = layout.column(align=True)
|
||||
|
||||
split = sub.split(factor=0.5 + max_factor, align=True)
|
||||
split = sub.split(factor=factor + max_factor, align=True)
|
||||
split.alignment = 'RIGHT'
|
||||
split.label(text="Strip Offset Start")
|
||||
split.prop(strip, "frame_offset_start", text=smpte_from_frame(frame_offset_start))
|
||||
|
||||
split = sub.split(factor=0.5 + max_factor, align=True)
|
||||
split = sub.split(factor=factor + max_factor, align=True)
|
||||
split.alignment = 'RIGHT'
|
||||
split.label(text="End")
|
||||
split.prop(strip, "frame_offset_end", text=smpte_from_frame(frame_offset_end))
|
||||
|
@ -2000,12 +1997,12 @@ class SEQUENCER_PT_time(SequencerButtonsPanel, Panel):
|
|||
layout.alignment = 'RIGHT'
|
||||
sub = layout.column(align=True)
|
||||
|
||||
split = sub.split(factor=0.5 + max_factor, align=True)
|
||||
split = sub.split(factor=factor + max_factor, align=True)
|
||||
split.alignment = 'RIGHT'
|
||||
split.label(text="Hold Offset Start")
|
||||
split.prop(strip, "animation_offset_start", text=smpte_from_frame(strip.animation_offset_start))
|
||||
|
||||
split = sub.split(factor=0.5 + max_factor, align=True)
|
||||
split = sub.split(factor=factor + max_factor, align=True)
|
||||
split.alignment = 'RIGHT'
|
||||
split.label(text="End")
|
||||
split.prop(strip, "animation_offset_end", text=smpte_from_frame(strip.animation_offset_end))
|
||||
|
@ -2017,10 +2014,10 @@ class SEQUENCER_PT_time(SequencerButtonsPanel, Panel):
|
|||
(frame_current <= frame_final_start + frame_final_duration)
|
||||
)
|
||||
|
||||
split = col.split(factor=0.5 + max_factor, align=True)
|
||||
split = col.split(factor=factor + max_factor, align=True)
|
||||
split.alignment = 'RIGHT'
|
||||
split.label(text="Current Frame")
|
||||
split = split.split(factor=0.8 + max_factor, align=True)
|
||||
split = split.split(factor=factor + 0.3 + max_factor, align=True)
|
||||
frame_display = frame_current - frame_final_start
|
||||
split.label(text="%14s" % smpte_from_frame(frame_display))
|
||||
split.alignment = 'RIGHT'
|
||||
|
@ -2032,7 +2029,7 @@ class SEQUENCER_PT_time(SequencerButtonsPanel, Panel):
|
|||
if scene:
|
||||
sta = scene.frame_start
|
||||
end = scene.frame_end
|
||||
split = col.split(factor=0.5 + max_factor)
|
||||
split = col.split(factor=factor + max_factor)
|
||||
split.alignment = 'RIGHT'
|
||||
split.label(text="Original Frame Range")
|
||||
split.alignment = 'LEFT'
|
||||
|
|
|
@ -327,3 +327,4 @@ struct SeqRetimingKey *retiming_mousover_key_get(const struct bContext *C,
|
|||
Sequence **r_seq);
|
||||
int left_fake_key_frame_get(const bContext *C, const Sequence *seq);
|
||||
int right_fake_key_frame_get(const bContext *C, const Sequence *seq);
|
||||
bool retiming_keys_are_visible(const bContext *C);
|
||||
|
|
|
@ -57,6 +57,12 @@
|
|||
#define KEY_SIZE (10 * U.pixelsize)
|
||||
#define KEY_CENTER (UI_view2d_view_to_region_y(v2d, strip_y_rescale(seq, 0.0f)) + 4 + KEY_SIZE / 2)
|
||||
|
||||
bool retiming_keys_are_visible(const bContext *C)
|
||||
{
|
||||
const SpaceSeq *sseq = CTX_wm_space_seq(C);
|
||||
return (sseq->timeline_overlay.flag & SEQ_TIMELINE_SHOW_STRIP_RETIMING) != 0;
|
||||
}
|
||||
|
||||
static float strip_y_rescale(const Sequence *seq, const float y_value)
|
||||
{
|
||||
const float y_range = SEQ_STRIP_OFSTOP - SEQ_STRIP_OFSBOTTOM;
|
||||
|
@ -401,9 +407,7 @@ static void retime_keys_draw(const bContext *C)
|
|||
}
|
||||
|
||||
const SpaceSeq *sseq = CTX_wm_space_seq(C);
|
||||
if ((sseq->timeline_overlay.flag & SEQ_TIMELINE_SHOW_STRIP_RETIMING) == 0 &&
|
||||
!sequencer_retiming_mode_is_active(C))
|
||||
{
|
||||
if (!retiming_keys_are_visible(C)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -519,9 +523,7 @@ static void retime_speed_draw(const bContext *C)
|
|||
}
|
||||
|
||||
const SpaceSeq *sseq = CTX_wm_space_seq(C);
|
||||
if ((sseq->timeline_overlay.flag & SEQ_TIMELINE_SHOW_STRIP_RETIMING) == 0 &&
|
||||
!sequencer_retiming_mode_is_active(C))
|
||||
{
|
||||
if (!retiming_keys_are_visible(C)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -444,7 +444,7 @@ static int sequencer_de_select_all_exec(bContext *C, wmOperator *op)
|
|||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
|
||||
if (sequencer_retiming_mode_is_active(C)) {
|
||||
if (sequencer_retiming_mode_is_active(C) && retiming_keys_are_visible(C)) {
|
||||
return sequencer_retiming_select_all_exec(C, op);
|
||||
}
|
||||
|
||||
|
@ -912,7 +912,7 @@ int sequencer_select_exec(bContext *C, wmOperator *op)
|
|||
}
|
||||
}
|
||||
|
||||
if (sequencer_retiming_mode_is_active(C)) {
|
||||
if (sequencer_retiming_mode_is_active(C) && retiming_keys_are_visible(C)) {
|
||||
return sequencer_retiming_key_select_exec(C, op);
|
||||
}
|
||||
|
||||
|
@ -981,7 +981,7 @@ int sequencer_select_exec(bContext *C, wmOperator *op)
|
|||
SeqRetimingKey *key = retiming_mousover_key_get(C, mval, &seq_key_test);
|
||||
|
||||
if (seq_key_test && SEQ_retiming_data_is_editable(seq_key_test) &&
|
||||
!sequencer_retiming_mode_is_active(C))
|
||||
!sequencer_retiming_mode_is_active(C) && retiming_keys_are_visible(C))
|
||||
{
|
||||
|
||||
/* Realize "fake" key, if it is clicked on. */
|
||||
|
@ -1665,7 +1665,7 @@ static int sequencer_box_select_exec(bContext *C, wmOperator *op)
|
|||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
|
||||
if (sequencer_retiming_mode_is_active(C)) {
|
||||
if (sequencer_retiming_mode_is_active(C) && retiming_keys_are_visible(C)) {
|
||||
return sequencer_retiming_box_select_exec(C, op);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue