VSE: Strip drawing improvements

This patch include changes:
- Thicker and clearer selection indication
- Slimmer handles
- More transparent muted strips
- Trim frame number is drawn inside the strip
- Strip text is drawn in upper part of strip
- Color strips now have specific color, with chosen color drawn under strip text
- Transition strip will use color of input strips showing direction of transition
- Selecting effect strip will highlight input strips
- Selecting multicam strips will highlight target channel
- Missing media state is now indicated by a red line drawn on the top part of the strip
- A checkerboard pattern is now drawn on the outsides of the meta range
- Hold still regions are now always drawn if existent, with a darker shade of the strip’s background color

Author: Alessio Monti di Sopra <a.monti>

Reviewed By: ISS

Differential Revision: https://developer.blender.org/D6883
This commit is contained in:
Richard Antalik 2020-03-19 00:24:09 +01:00
parent 348d2fa09e
commit 271231f58e
Notes: blender-bot 2023-02-14 09:24:53 +01:00
Referenced by commit 61bffa565e, Fix T90412: Inconsistency in mask strip color
12 changed files with 577 additions and 392 deletions

View File

@ -641,13 +641,17 @@ const bTheme U_theme_default = {
.facedot_size = 4,
.movie = RGBA(0x4d6890ff),
.movieclip = RGBA(0x8f4c4cff),
.mask = RGBA(0x666666ff),
.image = RGBA(0x8f744bff),
.scene = RGBA(0x828f50ff),
.audio = RGBA(0x4c8f8fff),
.effect = RGBA(0x598f4cff),
.effect = RGBA(0x514a73ff),
.transition = RGBA(0x8f4571ff),
.meta = RGBA(0x5b4d91ff),
.text_strip = RGBA(0x824c8fff),
.color_strip = RGBA(0x8f8f8fff),
.active_strip = RGBA(0xd9d9d9ff),
.selected_strip = RGBA(0xff8f0dff),
.gp_vertex_size = 3,
.gp_vertex_select = RGBA(0xff8500ff),
.anim_preview_range = RGBA(0xa14d0066),
@ -810,6 +814,7 @@ const bTheme U_theme_default = {
.vertex_size = 3,
.outline_width = 1,
.facedot_size = 4,
.grid_levels = 2,
.syntaxl = RGBA(0x565656ff),
.syntaxs = RGBA(0x975b5bff),
.syntaxb = RGBA(0xccb83dff),
@ -827,7 +832,6 @@ const bTheme U_theme_default = {
.nodeclass_pattern = RGBA(0x6c696fff),
.nodeclass_layout = RGBA(0x6c696fff),
.movie = RGBA(0x1a1a1acc),
.grid_levels = 2,
.gp_vertex_size = 3,
.gp_vertex = RGBA(0x97979700),
.gp_vertex_select = RGBA(0xff8500ff),

View File

@ -779,10 +779,13 @@
image_strip="#8f744b"
scene_strip="#828f50"
audio_strip="#4c8f8f"
effect_strip="#598f4c"
transition_strip="#8f4571"
effect_strip="#4c456c"
meta_strip="#5b4d91"
mask_strip="#8f5656"
text_strip="#824c8f"
color_strip="#8f8f8f"
active_strip="#d9d9d9"
selected_strip="#ff6a00"
frame_current="#5680c2"
time_scrub_background="#292929e6"
keyframe="#ff8500"

View File

@ -806,14 +806,6 @@ void BKE_sequence_calc_disp(Scene *scene, Sequence *seq)
seq->startdisp = seq->start + seq->startofs - seq->startstill;
seq->enddisp = seq->start + seq->len - seq->endofs + seq->endstill;
seq->handsize = 10.0; /* 10 frames */
if (seq->enddisp - seq->startdisp < 10) {
seq->handsize = (float)(0.5 * (seq->enddisp - seq->startdisp));
}
else if (seq->enddisp - seq->startdisp > 250) {
seq->handsize = (float)((seq->enddisp - seq->startdisp) / 25);
}
if (seq->type == SEQ_TYPE_META) {
seq_update_sound_bounds_recursive(scene, seq);
}

View File

@ -207,6 +207,10 @@ static void do_versions_theme(const UserDef *userdef, bTheme *btheme)
*/
{
/* Keep this block, even when empty. */
FROM_DEFAULT_V4_UCHAR(space_sequencer.active_strip);
FROM_DEFAULT_V4_UCHAR(space_sequencer.selected_strip);
FROM_DEFAULT_V4_UCHAR(space_sequencer.color_strip);
FROM_DEFAULT_V4_UCHAR(space_sequencer.mask);
}
#undef FROM_DEFAULT_V4_UCHAR

View File

@ -205,10 +205,12 @@ typedef enum ThemeColorID {
TH_SEQ_SCENE,
TH_SEQ_AUDIO,
TH_SEQ_EFFECT,
TH_SEQ_TRANSITION,
TH_SEQ_META,
TH_SEQ_TEXT,
TH_SEQ_PREVIEW,
TH_SEQ_COLOR,
TH_SEQ_ACTIVE,
TH_SEQ_SELECTED,
TH_EDGE_SHARP,
TH_EDITMESH_ACTIVE,

View File

@ -665,9 +665,6 @@ const uchar *UI_ThemeGetColorPtr(bTheme *btheme, int spacetype, int colorid)
case TH_SEQ_EFFECT:
cp = ts->effect;
break;
case TH_SEQ_TRANSITION:
cp = ts->transition;
break;
case TH_SEQ_META:
cp = ts->meta;
break;
@ -677,6 +674,15 @@ const uchar *UI_ThemeGetColorPtr(bTheme *btheme, int spacetype, int colorid)
case TH_SEQ_PREVIEW:
cp = ts->preview_back;
break;
case TH_SEQ_COLOR:
cp = ts->color_strip;
break;
case TH_SEQ_ACTIVE:
cp = ts->active_strip;
break;
case TH_SEQ_SELECTED:
cp = ts->selected_strip;
break;
case TH_CONSOLE_OUTPUT:
cp = ts->console_output;

View File

@ -17,6 +17,7 @@
set(INC
../include
../../blenfont
../../blenkernel
../../blenlib
../../blentranslation

File diff suppressed because it is too large Load Diff

View File

@ -407,7 +407,7 @@ Sequence *find_nearest_seq(Scene *scene, View2D *v2d, int *hand, const int mval[
/* clamp handles to defined size in pixel space */
handsize = seq->handsize;
handsize = 2.0f * sequence_handle_size_get_clamped(seq, pixelx);
displen = (float)abs(seq->startdisp - seq->enddisp);
/* don't even try to grab the handles of small strips */

View File

@ -1044,7 +1044,7 @@ static int sequencer_box_select_exec(bContext *C, wmOperator *op)
if (handles) {
/* Get the handles draw size. */
float pixelx = BLI_rctf_size_x(&v2d->cur) / BLI_rcti_size_x(&v2d->mask);
float handsize = sequence_handle_size_get_clamped(seq, pixelx) * 0.75f;
float handsize = sequence_handle_size_get_clamped(seq, pixelx);
/* Right handle. */
if (rectf.xmax > (seq->enddisp - handsize)) {

View File

@ -324,7 +324,7 @@ typedef struct ThemeSpace {
unsigned char syntaxd[4], syntaxr[4]; // in nodespace used for distort
unsigned char line_numbers[4];
char _pad6[3];
char _pad6[7];
unsigned char nodeclass_output[4], nodeclass_filter[4];
unsigned char nodeclass_vector[4], nodeclass_texture[4];
@ -333,7 +333,8 @@ typedef struct ThemeSpace {
/** For sequence editor. */
unsigned char movie[4], movieclip[4], mask[4], image[4], scene[4], audio[4];
unsigned char effect[4], transition[4], meta[4], text_strip[4];
unsigned char effect[4], transition[4], meta[4], text_strip[4], color_strip[4];
unsigned char active_strip[4], selected_strip[4];
/** For dopesheet - scale factor for size of keyframes (i.e. height of channels). */
float keyframe_scale_fac;

View File

@ -3079,10 +3079,9 @@ static void rna_def_userdef_theme_space_seq(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Effect Strip", "");
RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
prop = RNA_def_property(srna, "transition_strip", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "transition");
prop = RNA_def_property(srna, "color_strip", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Transition Strip", "");
RNA_def_property_ui_text(prop, "Color Strip", "");
RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
prop = RNA_def_property(srna, "meta_strip", PROP_FLOAT, PROP_COLOR_GAMMA);
@ -3091,11 +3090,27 @@ static void rna_def_userdef_theme_space_seq(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Meta Strip", "");
RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
prop = RNA_def_property(srna, "mask_strip", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "mask");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Mask Strip", "");
RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
prop = RNA_def_property(srna, "text_strip", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Text Strip", "");
RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
prop = RNA_def_property(srna, "active_strip", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Active Strip", "");
RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
prop = RNA_def_property(srna, "selected_strip", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Selected Strips", "");
RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
prop = RNA_def_property(srna, "frame_current", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "cframe");
RNA_def_property_array(prop, 3);