Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2019-03-26 13:16:47 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-03-26 13:16:47 +0300
commitce3b78c73a7ccc16fdccf7decedb5d1578dfdf0a (patch)
tree87f1a9c41ebe6f74806f1ae76206f1d328c85700 /source/blender/editors/space_sequencer
parent5279d118c2ddee0e6fef66aaf78452c1b302dd42 (diff)
Cleanup: style, use braces for editor/spaces
Diffstat (limited to 'source/blender/editors/space_sequencer')
-rw-r--r--source/blender/editors/space_sequencer/sequencer_add.c60
-rw-r--r--source/blender/editors/space_sequencer/sequencer_buttons.c3
-rw-r--r--source/blender/editors/space_sequencer/sequencer_draw.c126
-rw-r--r--source/blender/editors/space_sequencer/sequencer_edit.c323
-rw-r--r--source/blender/editors/space_sequencer/sequencer_modifier.c15
-rw-r--r--source/blender/editors/space_sequencer/sequencer_scopes.c18
-rw-r--r--source/blender/editors/space_sequencer/sequencer_select.c103
-rw-r--r--source/blender/editors/space_sequencer/sequencer_view.c3
-rw-r--r--source/blender/editors/space_sequencer/space_sequencer.c99
9 files changed, 510 insertions, 240 deletions
diff --git a/source/blender/editors/space_sequencer/sequencer_add.c b/source/blender/editors/space_sequencer/sequencer_add.c
index c21d1f6f57e..5e36ad9e8bc 100644
--- a/source/blender/editors/space_sequencer/sequencer_add.c
+++ b/source/blender/editors/space_sequencer/sequencer_add.c
@@ -166,8 +166,9 @@ static void sequencer_generic_invoke_xy__internal(bContext *C, wmOperator *op, i
RNA_int_set(op->ptr, "frame_start", cfra);
- if ((flag & SEQPROP_ENDFRAME) && RNA_struct_property_is_set(op->ptr, "frame_end") == 0)
+ if ((flag & SEQPROP_ENDFRAME) && RNA_struct_property_is_set(op->ptr, "frame_end") == 0) {
RNA_int_set(op->ptr, "frame_end", cfra + 25); // XXX arbitrary but ok for now.
+ }
if (!(flag & SEQPROP_NOPATHS)) {
sequencer_generic_invoke_path__internal(C, op, "filepath");
@@ -201,28 +202,34 @@ static void seq_load_operator_info(SeqLoadInfo *seq_load, bContext *C, wmOperato
is_file = 0;
}
- if ((is_file != -1) && relative)
+ if ((is_file != -1) && relative) {
BLI_path_rel(seq_load->path, BKE_main_blendfile_path(bmain));
+ }
if ((prop = RNA_struct_find_property(op->ptr, "frame_end"))) {
seq_load->end_frame = RNA_property_int_get(op->ptr, prop);
}
- if ((prop = RNA_struct_find_property(op->ptr, "replace_sel")) && RNA_property_boolean_get(op->ptr, prop))
+ if ((prop = RNA_struct_find_property(op->ptr, "replace_sel")) && RNA_property_boolean_get(op->ptr, prop)) {
seq_load->flag |= SEQ_LOAD_REPLACE_SEL;
+ }
- if ((prop = RNA_struct_find_property(op->ptr, "cache")) && RNA_property_boolean_get(op->ptr, prop))
+ if ((prop = RNA_struct_find_property(op->ptr, "cache")) && RNA_property_boolean_get(op->ptr, prop)) {
seq_load->flag |= SEQ_LOAD_SOUND_CACHE;
+ }
- if ((prop = RNA_struct_find_property(op->ptr, "mono")) && RNA_property_boolean_get(op->ptr, prop))
+ if ((prop = RNA_struct_find_property(op->ptr, "mono")) && RNA_property_boolean_get(op->ptr, prop)) {
seq_load->flag |= SEQ_LOAD_SOUND_MONO;
+ }
- if ((prop = RNA_struct_find_property(op->ptr, "sound")) && RNA_property_boolean_get(op->ptr, prop))
+ if ((prop = RNA_struct_find_property(op->ptr, "sound")) && RNA_property_boolean_get(op->ptr, prop)) {
seq_load->flag |= SEQ_LOAD_MOVIE_SOUND;
+ }
- if ((prop = RNA_struct_find_property(op->ptr, "use_framerate")) && RNA_property_boolean_get(op->ptr, prop))
+ if ((prop = RNA_struct_find_property(op->ptr, "use_framerate")) && RNA_property_boolean_get(op->ptr, prop)) {
seq_load->flag |= SEQ_LOAD_SYNC_FPS;
+ }
/* always use this for ops */
seq_load->flag |= SEQ_LOAD_FRAME_ADVANCE;
@@ -338,8 +345,9 @@ static int sequencer_add_scene_strip_exec(bContext *C, wmOperator *op)
static int sequencer_add_scene_strip_invoke(bContext *C, wmOperator *op, const wmEvent *event)
{
- if (!RNA_struct_property_is_set(op->ptr, "scene"))
+ if (!RNA_struct_property_is_set(op->ptr, "scene")) {
return WM_enum_search_invoke(C, op, event);
+ }
sequencer_generic_invoke_xy__internal(C, op, 0, SEQ_TYPE_SCENE);
return sequencer_add_scene_strip_exec(C, op);
@@ -424,8 +432,9 @@ static int sequencer_add_movieclip_strip_exec(bContext *C, wmOperator *op)
static int sequencer_add_movieclip_strip_invoke(bContext *C, wmOperator *op, const wmEvent *event)
{
- if (!RNA_struct_property_is_set(op->ptr, "clip"))
+ if (!RNA_struct_property_is_set(op->ptr, "clip")) {
return WM_enum_search_invoke(C, op, event);
+ }
sequencer_generic_invoke_xy__internal(C, op, 0, SEQ_TYPE_MOVIECLIP);
return sequencer_add_movieclip_strip_exec(C, op);
@@ -509,8 +518,9 @@ static int sequencer_add_mask_strip_exec(bContext *C, wmOperator *op)
static int sequencer_add_mask_strip_invoke(bContext *C, wmOperator *op, const wmEvent *event)
{
- if (!RNA_struct_property_is_set(op->ptr, "mask"))
+ if (!RNA_struct_property_is_set(op->ptr, "mask")) {
return WM_enum_search_invoke(C, op, event);
+ }
sequencer_generic_invoke_xy__internal(C, op, 0, SEQ_TYPE_MASK);
return sequencer_add_mask_strip_exec(C, op);
@@ -554,13 +564,16 @@ static int sequencer_add_generic_strip_exec(bContext *C, wmOperator *op, SeqLoad
seq_load_operator_info(&seq_load, C, op);
- if (seq_load.flag & SEQ_LOAD_REPLACE_SEL)
+ if (seq_load.flag & SEQ_LOAD_REPLACE_SEL) {
ED_sequencer_deselect_all(scene);
+ }
- if (RNA_struct_property_is_set(op->ptr, "files"))
+ if (RNA_struct_property_is_set(op->ptr, "files")) {
tot_files = RNA_property_collection_length(op->ptr, RNA_struct_find_property(op->ptr, "files"));
- else
+ }
+ else {
tot_files = 0;
+ }
if (tot_files) {
/* multiple files */
@@ -607,8 +620,9 @@ static int sequencer_add_generic_strip_exec(bContext *C, wmOperator *op, SeqLoad
return OPERATOR_CANCELLED;
}
- if (op->customdata)
+ if (op->customdata) {
MEM_freeN(op->customdata);
+ }
BKE_sequencer_sort(scene);
BKE_sequencer_update_muting(ed);
@@ -626,8 +640,9 @@ static void sequencer_add_init(bContext *UNUSED(C), wmOperator *op)
static void sequencer_add_cancel(bContext *UNUSED(C), wmOperator *op)
{
- if (op->customdata)
+ if (op->customdata) {
MEM_freeN(op->customdata);
+ }
op->customdata = NULL;
}
@@ -703,8 +718,9 @@ static void sequencer_add_draw(bContext *UNUSED(C), wmOperator *op)
RNA_pointer_create(NULL, &RNA_ImageFormatSettings, imf, &imf_ptr);
/* multiview template */
- if (RNA_boolean_get(op->ptr, "show_multiview"))
+ if (RNA_boolean_get(op->ptr, "show_multiview")) {
uiTemplateImageFormatViews(layout, &imf_ptr, op->ptr);
+ }
}
void SEQUENCER_OT_movie_strip_add(struct wmOperatorType *ot)
@@ -872,11 +888,13 @@ static int sequencer_add_image_strip_exec(bContext *C, wmOperator *op)
seq_load.len = RNA_property_collection_length(op->ptr, RNA_struct_find_property(op->ptr, "files"));
}
- if (seq_load.len == 0)
+ if (seq_load.len == 0) {
return OPERATOR_CANCELLED;
+ }
- if (seq_load.flag & SEQ_LOAD_REPLACE_SEL)
+ if (seq_load.flag & SEQ_LOAD_REPLACE_SEL) {
ED_sequencer_deselect_all(scene);
+ }
/* main adding function */
seq = BKE_sequencer_add_image_strip(C, ed->seqbasep, &seq_load);
@@ -916,8 +934,9 @@ static int sequencer_add_image_strip_exec(bContext *C, wmOperator *op)
sequencer_add_apply_overlap(C, op, seq);
- if (op->customdata)
+ if (op->customdata) {
MEM_freeN(op->customdata);
+ }
WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene);
@@ -1057,8 +1076,9 @@ static int sequencer_add_effect_strip_exec(bContext *C, wmOperator *op)
int chan = max_iii(seq->seq1 ? seq->seq1->machine : 0,
seq->seq2 ? seq->seq2->machine : 0,
seq->seq3 ? seq->seq3->machine : 0);
- if (chan < MAXSEQ)
+ if (chan < MAXSEQ) {
seq->machine = chan;
+ }
}
}
diff --git a/source/blender/editors/space_sequencer/sequencer_buttons.c b/source/blender/editors/space_sequencer/sequencer_buttons.c
index c1b70a7f14a..7b7f6599404 100644
--- a/source/blender/editors/space_sequencer/sequencer_buttons.c
+++ b/source/blender/editors/space_sequencer/sequencer_buttons.c
@@ -132,8 +132,9 @@ static int sequencer_properties_toggle_exec(bContext *C, wmOperator *UNUSED(op))
ScrArea *sa = CTX_wm_area(C);
ARegion *ar = sequencer_has_buttons_region(sa);
- if (ar)
+ if (ar) {
ED_region_toggle_hidden(C, ar);
+ }
return OPERATOR_FINISHED;
}
diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c
index 2b2935157be..ea6d4cf69be 100644
--- a/source/blender/editors/space_sequencer/sequencer_draw.c
+++ b/source/blender/editors/space_sequencer/sequencer_draw.c
@@ -134,9 +134,9 @@ void color3ubv_from_seq(Scene *curscene, Sequence *seq, unsigned char col[3])
UI_GetThemeColor3ubv(TH_SEQ_TRANSITION, col);
/* slightly offset hue to distinguish different effects */
- if (seq->type == SEQ_TYPE_CROSS) rgb_byte_set_hue_float_offset(col, 0.04);
- if (seq->type == SEQ_TYPE_GAMCROSS) rgb_byte_set_hue_float_offset(col, 0.08);
- if (seq->type == SEQ_TYPE_WIPE) rgb_byte_set_hue_float_offset(col, 0.12);
+ if (seq->type == SEQ_TYPE_CROSS) { rgb_byte_set_hue_float_offset(col, 0.04); }
+ if (seq->type == SEQ_TYPE_GAMCROSS) { rgb_byte_set_hue_float_offset(col, 0.08); }
+ if (seq->type == SEQ_TYPE_WIPE) { rgb_byte_set_hue_float_offset(col, 0.12); }
break;
/* effects */
@@ -156,18 +156,18 @@ void color3ubv_from_seq(Scene *curscene, Sequence *seq, unsigned char col[3])
UI_GetThemeColor3ubv(TH_SEQ_EFFECT, col);
/* slightly offset hue to distinguish different effects */
- if (seq->type == SEQ_TYPE_ADD) rgb_byte_set_hue_float_offset(col, 0.04);
- else if (seq->type == SEQ_TYPE_SUB) rgb_byte_set_hue_float_offset(col, 0.08);
- else if (seq->type == SEQ_TYPE_MUL) rgb_byte_set_hue_float_offset(col, 0.12);
- else if (seq->type == SEQ_TYPE_ALPHAOVER) rgb_byte_set_hue_float_offset(col, 0.16);
- else if (seq->type == SEQ_TYPE_ALPHAUNDER) rgb_byte_set_hue_float_offset(col, 0.20);
- else if (seq->type == SEQ_TYPE_OVERDROP) rgb_byte_set_hue_float_offset(col, 0.24);
- else if (seq->type == SEQ_TYPE_GLOW) rgb_byte_set_hue_float_offset(col, 0.28);
- else if (seq->type == SEQ_TYPE_TRANSFORM) rgb_byte_set_hue_float_offset(col, 0.36);
- else if (seq->type == SEQ_TYPE_MULTICAM) rgb_byte_set_hue_float_offset(col, 0.32);
- else if (seq->type == SEQ_TYPE_ADJUSTMENT) rgb_byte_set_hue_float_offset(col, 0.40);
- else if (seq->type == SEQ_TYPE_GAUSSIAN_BLUR) rgb_byte_set_hue_float_offset(col, 0.42);
- else if (seq->type == SEQ_TYPE_COLORMIX) rgb_byte_set_hue_float_offset(col, 0.46);
+ if (seq->type == SEQ_TYPE_ADD) { rgb_byte_set_hue_float_offset(col, 0.04); }
+ else if (seq->type == SEQ_TYPE_SUB) { rgb_byte_set_hue_float_offset(col, 0.08); }
+ else if (seq->type == SEQ_TYPE_MUL) { rgb_byte_set_hue_float_offset(col, 0.12); }
+ else if (seq->type == SEQ_TYPE_ALPHAOVER) { rgb_byte_set_hue_float_offset(col, 0.16); }
+ else if (seq->type == SEQ_TYPE_ALPHAUNDER) { rgb_byte_set_hue_float_offset(col, 0.20); }
+ else if (seq->type == SEQ_TYPE_OVERDROP) { rgb_byte_set_hue_float_offset(col, 0.24); }
+ else if (seq->type == SEQ_TYPE_GLOW) { rgb_byte_set_hue_float_offset(col, 0.28); }
+ else if (seq->type == SEQ_TYPE_TRANSFORM) { rgb_byte_set_hue_float_offset(col, 0.36); }
+ else if (seq->type == SEQ_TYPE_MULTICAM) { rgb_byte_set_hue_float_offset(col, 0.32); }
+ else if (seq->type == SEQ_TYPE_ADJUSTMENT) { rgb_byte_set_hue_float_offset(col, 0.40); }
+ else if (seq->type == SEQ_TYPE_GAUSSIAN_BLUR) { rgb_byte_set_hue_float_offset(col, 0.42); }
+ else if (seq->type == SEQ_TYPE_COLORMIX) { rgb_byte_set_hue_float_offset(col, 0.46); }
break;
case SEQ_TYPE_COLOR:
@@ -177,7 +177,9 @@ void color3ubv_from_seq(Scene *curscene, Sequence *seq, unsigned char col[3])
case SEQ_TYPE_SOUND_RAM:
UI_GetThemeColor3ubv(TH_SEQ_AUDIO, col);
blendcol[0] = blendcol[1] = blendcol[2] = 128;
- if (seq->flag & SEQ_MUTE) UI_GetColorPtrBlendShade3ubv(col, blendcol, col, 0.5, 20);
+ if (seq->flag & SEQ_MUTE) {
+ UI_GetColorPtrBlendShade3ubv(col, blendcol, col, 0.5, 20);
+ }
break;
case SEQ_TYPE_TEXT:
@@ -273,11 +275,13 @@ static void drawseqwave(View2D *v2d, const bContext *C, SpaceSeq *sseq, Scene *s
if (samplestep > 1.0f) {
for (j = p + 1; (j < waveform->length) && (j < p + samplestep); j++) {
- if (value1 > waveform->data[j * 3])
+ if (value1 > waveform->data[j * 3]) {
value1 = waveform->data[j * 3];
+ }
- if (value2 < waveform->data[j * 3 + 1])
+ if (value2 < waveform->data[j * 3 + 1]) {
value2 = waveform->data[j * 3 + 1];
+ }
}
}
else if (p + 1 < waveform->length) {
@@ -377,8 +381,12 @@ static void drawmeta_contents(Scene *scene, Sequence *seqm, float x1, float y1,
immUniformColor4ubv(col);
/* clamp within parent sequence strip bounds */
- if (x1_chan < x1) x1_chan = x1;
- if (x2_chan > x2) x2_chan = x2;
+ if (x1_chan < x1) {
+ x1_chan = x1;
+ }
+ if (x2_chan > x2) {
+ x2_chan = x2;
+ }
y1_chan = y1 + y_chan + (draw_height * SEQ_STRIP_OFSBOTTOM);
y2_chan = y1 + y_chan + (draw_height * SEQ_STRIP_OFSTOP);
@@ -508,8 +516,9 @@ static void draw_seq_text(
char col[4];
/* note, all strings should include 'name' */
- if (name[0] == '\0')
+ if (name[0] == '\0') {
name = BKE_sequence_give_name(seq);
+ }
if (seq->type == SEQ_TYPE_META || seq->type == SEQ_TYPE_ADJUSTMENT) {
str_len = BLI_snprintf(str, sizeof(str), "%s | %d", name, seq->len);
@@ -628,7 +637,9 @@ static void draw_sequence_extensions(Scene *scene, ARegion *ar, Sequence *seq, u
pixely = BLI_rctf_size_y(&v2d->cur) / BLI_rcti_size_y(&v2d->mask);
- if (pixely <= 0) return; /* can happen when the view is split/resized */
+ if (pixely <= 0) {
+ return; /* can happen when the view is split/resized */
+ }
blendcol[0] = blendcol[1] = blendcol[2] = 120;
@@ -839,11 +850,13 @@ static void draw_seq_strip(
if (seq->flag & SEQ_OVERLAP) {
col[0] = 255; col[1] = col[2] = 40;
}
- else
+ else {
UI_GetColorPtrShade3ubv(col, col, 120 + outline_tint);
+ }
}
- else
+ else {
UI_GetColorPtrShade3ubv(col, col, outline_tint);
+ }
if ((seq->type == SEQ_TYPE_META) ||
((seq->type == SEQ_TYPE_SCENE) && (seq->flag & SEQ_SCENE_STRIPS)))
@@ -879,10 +892,18 @@ static void draw_seq_strip(
float scroller_vert_xoffs = (V2D_SCROLL_WIDTH_TEXT + SEQ_SCROLLER_TEXT_OFFSET) * pixelx;
/* info text on the strip */
- if (x1 < v2d->cur.xmin + scroller_vert_xoffs) x1 = v2d->cur.xmin + scroller_vert_xoffs;
- else if (x1 > v2d->cur.xmax) x1 = v2d->cur.xmax;
- if (x2 < v2d->cur.xmin) x2 = v2d->cur.xmin;
- else if (x2 > v2d->cur.xmax) x2 = v2d->cur.xmax;
+ if (x1 < v2d->cur.xmin + scroller_vert_xoffs) {
+ x1 = v2d->cur.xmin + scroller_vert_xoffs;
+ }
+ else if (x1 > v2d->cur.xmax) {
+ x1 = v2d->cur.xmax;
+ }
+ if (x2 < v2d->cur.xmin) {
+ x2 = v2d->cur.xmin;
+ }
+ else if (x2 > v2d->cur.xmax) {
+ x2 = v2d->cur.xmax;
+ }
/* nice text here would require changing the view matrix for texture text */
if ((x2 - x1) / pixelx > 32) {
@@ -956,12 +977,15 @@ ImBuf *sequencer_ibuf_get(
GPUFrameBuffer *fb = GPU_framebuffer_active_get();
GPU_framebuffer_restore();
- if (special_seq_update)
+ if (special_seq_update) {
ibuf = BKE_sequencer_give_ibuf_direct(&context, cfra + frame_ofs, special_seq_update);
- else if (!U.prefetchframes) // XXX || (G.f & G_PLAYANIM) == 0) {
+ }
+ else if (!U.prefetchframes) { // XXX || (G.f & G_PLAYANIM) == 0) {
ibuf = BKE_sequencer_give_ibuf(&context, cfra + frame_ofs, sseq->chanshown);
- else
+ }
+ else {
ibuf = BKE_sequencer_give_ibuf_threaded(&context, cfra + frame_ofs, sseq->chanshown);
+ }
GPU_framebuffer_bind(fb);
@@ -1176,8 +1200,9 @@ static void *sequencer_OCIO_transform_ibuf(const bContext *C, ImBuf *ibuf, bool
*format = GL_RGBA;
*type = GL_UNSIGNED_BYTE;
}
- if (cache_handle)
+ if (cache_handle) {
IMB_display_buffer_release(cache_handle);
+ }
return display_buffer;
}
@@ -1373,24 +1398,28 @@ static ImBuf *sequencer_get_scope(Scene *scene, SpaceSeq *sseq, ImBuf *ibuf, boo
break;
case SEQ_DRAW_IMG_WAVEFORM:
if ((sseq->flag & SEQ_DRAW_COLOR_SEPARATED) != 0) {
- if (!scopes->sep_waveform_ibuf)
+ if (!scopes->sep_waveform_ibuf) {
scopes->sep_waveform_ibuf = sequencer_make_scope(scene, ibuf, make_sep_waveform_view_from_ibuf);
+ }
scope = scopes->sep_waveform_ibuf;
}
else {
- if (!scopes->waveform_ibuf)
+ if (!scopes->waveform_ibuf) {
scopes->waveform_ibuf = sequencer_make_scope(scene, ibuf, make_waveform_view_from_ibuf);
+ }
scope = scopes->waveform_ibuf;
}
break;
case SEQ_DRAW_IMG_VECTORSCOPE:
- if (!scopes->vector_ibuf)
+ if (!scopes->vector_ibuf) {
scopes->vector_ibuf = sequencer_make_scope(scene, ibuf, make_vectorscope_view_from_ibuf);
+ }
scope = scopes->vector_ibuf;
break;
case SEQ_DRAW_IMG_HISTOGRAM:
- if (!scopes->histogram_ibuf)
+ if (!scopes->histogram_ibuf) {
scopes->histogram_ibuf = sequencer_make_scope(scene, ibuf, make_histogram_view_from_ibuf);
+ }
scope = scopes->histogram_ibuf;
break;
}
@@ -1564,12 +1593,12 @@ static void draw_seq_strips(const bContext *C, Editing *ed, ARegion *ar)
/* loop through strips, checking for those that are visible */
for (seq = ed->seqbasep->first; seq; seq = seq->next) {
/* boundbox and selection tests for NOT drawing the strip... */
- if ((seq->flag & SELECT) != sel) continue;
- else if (seq == last_seq) continue;
- else if (min_ii(seq->startdisp, seq->start) > v2d->cur.xmax) continue;
- else if (max_ii(seq->enddisp, seq->start + seq->len) < v2d->cur.xmin) continue;
- else if (seq->machine + 1.0f < v2d->cur.ymin) continue;
- else if (seq->machine > v2d->cur.ymax) continue;
+ if ((seq->flag & SELECT) != sel) { continue; }
+ else if (seq == last_seq) { continue; }
+ else if (min_ii(seq->startdisp, seq->start) > v2d->cur.xmax) { continue; }
+ else if (max_ii(seq->enddisp, seq->start + seq->len) < v2d->cur.xmin) { continue; }
+ else if (seq->machine + 1.0f < v2d->cur.ymin) { continue; }
+ else if (seq->machine > v2d->cur.ymax) { continue; }
/* strip passed all tests unscathed... so draw it now */
draw_seq_strip(C, sseq, scene, ar, seq, outline_tint, pixelx);
@@ -1581,8 +1610,9 @@ static void draw_seq_strips(const bContext *C, Editing *ed, ARegion *ar)
/* draw the last selected last (i.e. 'active' in other parts of Blender),
* removes some overlapping error */
- if (last_seq)
+ if (last_seq) {
draw_seq_strip(C, sseq, scene, ar, last_seq, 120, pixelx);
+ }
/* draw highlight when previewing a single strip */
if (special_seq_update) {
@@ -1674,10 +1704,12 @@ void draw_timeline_seq(const bContext *C, ARegion *ar)
/* clear and setup matrix */
UI_GetThemeColor3fv(TH_BACK, col);
- if (ed && ed->metastack.first)
+ if (ed && ed->metastack.first) {
GPU_clear_color(col[0], col[1], col[2] - 0.1f, 0.0f);
- else
+ }
+ else {
GPU_clear_color(col[0], col[1], col[2], 0.0f);
+ }
GPU_clear(GPU_COLOR_BIT);
UI_view2d_view_ortho(v2d);
@@ -1716,7 +1748,9 @@ void draw_timeline_seq(const bContext *C, ARegion *ar)
/* current frame */
UI_view2d_view_ortho(v2d);
- if ((sseq->flag & SEQ_DRAWFRAMES) == 0) cfra_flag |= DRAWCFRA_UNIT_SECONDS;
+ if ((sseq->flag & SEQ_DRAWFRAMES) == 0) {
+ cfra_flag |= DRAWCFRA_UNIT_SECONDS;
+ }
ANIM_draw_cfra(C, v2d, cfra_flag);
/* markers */
diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c
index 6e4ffd39edc..b7d3bec326a 100644
--- a/source/blender/editors/space_sequencer/sequencer_edit.c
+++ b/source/blender/editors/space_sequencer/sequencer_edit.c
@@ -229,11 +229,20 @@ static void seq_proxy_build_job(const bContext *C)
void seq_rectf(Sequence *seq, rctf *rectf)
{
- if (seq->startstill) rectf->xmin = seq->start;
- else rectf->xmin = seq->startdisp;
+ if (seq->startstill) {
+ rectf->xmin = seq->start;
+ }
+ else {
+ rectf->xmin = seq->startdisp;
+ }
+
rectf->ymin = seq->machine + SEQ_STRIP_OFSBOTTOM;
- if (seq->endstill) rectf->xmax = seq->start + seq->len;
- else rectf->xmax = seq->enddisp;
+ if (seq->endstill) {
+ rectf->xmax = seq->start + seq->len;
+ }
+ else {
+ rectf->xmax = seq->enddisp;
+ }
rectf->ymax = seq->machine + SEQ_STRIP_OFSTOP;
}
@@ -244,7 +253,9 @@ void boundbox_seq(Scene *scene, rctf *rect)
float min[2], max[2];
- if (ed == NULL) return;
+ if (ed == NULL) {
+ return;
+ }
min[0] = 0.0;
max[0] = EFRA + 1;
@@ -254,9 +265,15 @@ void boundbox_seq(Scene *scene, rctf *rect)
seq = ed->seqbasep->first;
while (seq) {
- if (min[0] > seq->startdisp - 1) min[0] = seq->startdisp - 1;
- if (max[0] < seq->enddisp + 1) max[0] = seq->enddisp + 1;
- if (max[1] < seq->machine + 2) max[1] = seq->machine + 2;
+ if (min[0] > seq->startdisp - 1) {
+ min[0] = seq->startdisp - 1;
+ }
+ if (max[0] < seq->enddisp + 1) {
+ max[0] = seq->enddisp + 1;
+ }
+ if (max[1] < seq->machine + 2) {
+ max[1] = seq->machine + 2;
+ }
seq = seq->next;
}
@@ -289,9 +306,13 @@ Sequence *find_neighboring_sequence(Scene *scene, Sequence *test, int lr, int se
Sequence *seq;
Editing *ed = BKE_sequencer_editing_get(scene, false);
- if (ed == NULL) return NULL;
+ if (ed == NULL) {
+ return NULL;
+ }
- if (sel > 0) sel = SELECT;
+ if (sel > 0) {
+ sel = SELECT;
+ }
for (seq = ed->seqbasep->first; seq; seq = seq->next) {
if ((seq != test) &&
@@ -325,7 +346,9 @@ static Sequence *find_next_prev_sequence(Scene *scene, Sequence *test, int lr, i
best_dist = MAXFRAME * 2;
- if (ed == NULL) return NULL;
+ if (ed == NULL) {
+ return NULL;
+ }
seq = ed->seqbasep->first;
while (seq) {
@@ -375,7 +398,9 @@ Sequence *find_nearest_seq(Scene *scene, View2D *v2d, int *hand, const int mval[
*hand = SEQ_SIDE_NONE;
- if (ed == NULL) return NULL;
+ if (ed == NULL) {
+ return NULL;
+ }
pixelx = BLI_rctf_size_x(&v2d->cur) / BLI_rcti_size_x(&v2d->mask);
@@ -409,10 +434,12 @@ Sequence *find_nearest_seq(Scene *scene, View2D *v2d, int *hand, const int mval[
CLAMP(handsize, 7 * pixelx, 30 * pixelx);
}
- if (handsize + seq->startdisp >= x)
+ if (handsize + seq->startdisp >= x) {
*hand = SEQ_SIDE_LEFT;
- else if (-handsize + seq->enddisp <= x)
+ }
+ else if (-handsize + seq->enddisp <= x) {
*hand = SEQ_SIDE_RIGHT;
+ }
}
}
return seq;
@@ -431,12 +458,12 @@ static bool seq_is_parent(Sequence *par, Sequence *seq)
static bool seq_is_predecessor(Sequence *pred, Sequence *seq)
{
- if (!pred) return 0;
- if (pred == seq) return 0;
- else if (seq_is_parent(pred, seq)) return 1;
- else if (pred->seq1 && seq_is_predecessor(pred->seq1, seq)) return 1;
- else if (pred->seq2 && seq_is_predecessor(pred->seq2, seq)) return 1;
- else if (pred->seq3 && seq_is_predecessor(pred->seq3, seq)) return 1;
+ if (!pred) { return 0; }
+ if (pred == seq) { return 0; }
+ else if (seq_is_parent(pred, seq)) { return 1; }
+ else if (pred->seq1 && seq_is_predecessor(pred->seq1, seq)) { return 1; }
+ else if (pred->seq2 && seq_is_predecessor(pred->seq2, seq)) { return 1; }
+ else if (pred->seq3 && seq_is_predecessor(pred->seq3, seq)) { return 1; }
return 0;
}
@@ -447,7 +474,9 @@ void ED_sequencer_deselect_all(Scene *scene)
Editing *ed = BKE_sequencer_editing_get(scene, false);
- if (ed == NULL) return;
+ if (ed == NULL) {
+ return;
+ }
SEQP_BEGIN (ed, seq)
{
@@ -463,11 +492,19 @@ void recurs_sel_seq(Sequence *seqm)
seq = seqm->seqbase.first;
while (seq) {
- if (seqm->flag & (SEQ_LEFTSEL + SEQ_RIGHTSEL)) seq->flag &= ~SEQ_ALLSEL;
- else if (seqm->flag & SELECT) seq->flag |= SELECT;
- else seq->flag &= ~SEQ_ALLSEL;
+ if (seqm->flag & (SEQ_LEFTSEL + SEQ_RIGHTSEL)) {
+ seq->flag &= ~SEQ_ALLSEL;
+ }
+ else if (seqm->flag & SELECT) {
+ seq->flag |= SELECT;
+ }
+ else {
+ seq->flag &= ~SEQ_ALLSEL;
+ }
- if (seq->seqbase.first) recurs_sel_seq(seq);
+ if (seq->seqbase.first) {
+ recurs_sel_seq(seq);
+ }
seq = seq->next;
}
@@ -521,8 +558,9 @@ int seq_effect_find_selected(Scene *scene, Sequence *activeseq, int type, Sequen
*error_str = NULL;
- if (!activeseq)
+ if (!activeseq) {
seq2 = BKE_sequencer_active_get(scene);
+ }
for (seq = ed->seqbasep->first; seq; seq = seq->next) {
if (seq->flag & SELECT) {
@@ -531,9 +569,15 @@ int seq_effect_find_selected(Scene *scene, Sequence *activeseq, int type, Sequen
return 0;
}
if ((seq != activeseq) && (seq != seq2)) {
- if (seq2 == NULL) seq2 = seq;
- else if (seq1 == NULL) seq1 = seq;
- else if (seq3 == NULL) seq3 = seq;
+ if (seq2 == NULL) {
+ seq2 = seq;
+ }
+ else if (seq1 == NULL) {
+ seq1 = seq;
+ }
+ else if (seq3 == NULL) {
+ seq3 = seq;
+ }
else {
*error_str = N_("Cannot apply effect to more than 3 sequence strips");
return 0;
@@ -560,15 +604,21 @@ int seq_effect_find_selected(Scene *scene, Sequence *activeseq, int type, Sequen
*error_str = N_("At least one selected sequence strip is needed");
return 0;
}
- if (seq1 == NULL) seq1 = seq2;
- if (seq3 == NULL) seq3 = seq2;
+ if (seq1 == NULL) {
+ seq1 = seq2;
+ }
+ if (seq3 == NULL) {
+ seq3 = seq2;
+ }
ATTR_FALLTHROUGH;
case 2:
if (seq1 == NULL || seq2 == NULL) {
*error_str = N_("2 selected sequence strips are needed");
return 0;
}
- if (seq3 == NULL) seq3 = seq2;
+ if (seq3 == NULL) {
+ seq3 = seq2;
+ }
break;
}
@@ -591,10 +641,12 @@ static Sequence *del_seq_find_replace_recurs(Scene *scene, Sequence *seq)
/* try to find a replacement input sequence, and flag for later deletion if
* no replacement can be found */
- if (!seq)
+ if (!seq) {
return NULL;
- else if (!(seq->type & SEQ_TYPE_EFFECT))
+ }
+ else if (!(seq->type & SEQ_TYPE_EFFECT)) {
return ((seq->flag & SELECT) ? NULL : seq);
+ }
else if (!(seq->flag & SELECT)) {
/* try to find replacement for effect inputs */
seq1 = del_seq_find_replace_recurs(scene, seq->seq1);
@@ -611,18 +663,22 @@ static Sequence *del_seq_find_replace_recurs(Scene *scene, Sequence *seq)
BKE_sequencer_update_changed_seq_and_deps(scene, seq, 1, 1);
}
- else
+ else {
seq->flag |= SELECT; /* mark for delete */
+ }
}
if (seq->flag & SELECT) {
- if ((seq1 = del_seq_find_replace_recurs(scene, seq->seq1))) return seq1;
- if ((seq2 = del_seq_find_replace_recurs(scene, seq->seq2))) return seq2;
- if ((seq3 = del_seq_find_replace_recurs(scene, seq->seq3))) return seq3;
- else return NULL;
+ if ((seq1 = del_seq_find_replace_recurs(scene, seq->seq1))) { return seq1; }
+ if ((seq2 = del_seq_find_replace_recurs(scene, seq->seq2))) { return seq2; }
+ if ((seq3 = del_seq_find_replace_recurs(scene, seq->seq3))) { return seq3; }
+ else {
+ return NULL;
+ }
}
- else
+ else {
return seq;
+ }
}
static void del_seq_clear_modifiers_recurs(Scene *scene, Sequence *deleting_sequence)
@@ -654,8 +710,12 @@ static void recurs_del_seq_flag(Scene *scene, ListBase *lb, short flag, short de
seqn = seq->next;
if ((seq->flag & flag) || deleteall) {
BLI_remlink(lb, seq);
- if (seq == last_seq) BKE_sequencer_active_set(scene, NULL);
- if (seq->type == SEQ_TYPE_META) recurs_del_seq_flag(scene, &seq->seqbase, flag, 1);
+ if (seq == last_seq) {
+ BKE_sequencer_active_set(scene, NULL);
+ }
+ if (seq->type == SEQ_TYPE_META) {
+ recurs_del_seq_flag(scene, &seq->seqbase, flag, 1);
+ }
BKE_sequence_free(scene, seq);
}
seq = seqn;
@@ -945,7 +1005,9 @@ static bool sequence_offset_after_frame(Scene *scene, const int delta, const int
/* all strips >= cfra are shifted */
- if (ed == NULL) return 0;
+ if (ed == NULL) {
+ return 0;
+ }
for (seq = ed->seqbasep->first; seq; seq = seq->next) {
if (seq->startdisp >= cfra) {
@@ -998,8 +1060,9 @@ static void UNUSED_FUNCTION(seq_remap_paths) (Scene *scene)
char from[FILE_MAX], to[FILE_MAX], stripped[FILE_MAX];
- if (last_seq == NULL)
+ if (last_seq == NULL) {
return;
+ }
BLI_strncpy(from, last_seq->strip->dir, sizeof(from));
// XXX if (0 == sbutton(from, 0, sizeof(from) - 1, "From: "))
@@ -1009,8 +1072,9 @@ static void UNUSED_FUNCTION(seq_remap_paths) (Scene *scene)
// XXX if (0 == sbutton(to, 0, sizeof(to) - 1, "To: "))
// return;
- if (STREQ(to, from))
+ if (STREQ(to, from)) {
return;
+ }
SEQP_BEGIN (ed, seq)
{
@@ -1056,15 +1120,21 @@ static int sequencer_gap_remove_exec(bContext *C, wmOperator *op)
for ( ; cfra < efra; cfra++) {
/* first == 0 means there's still no strip to remove a gap for */
if (first == false) {
- if (BKE_sequencer_evaluate_frame(scene, cfra) ) first = true;
+ if (BKE_sequencer_evaluate_frame(scene, cfra) ) {
+ first = true;
+ }
}
else if (BKE_sequencer_evaluate_frame(scene, cfra) == 0) {
done = true;
while (BKE_sequencer_evaluate_frame(scene, cfra) == 0) {
done = sequence_offset_after_frame(scene, -1, cfra);
- if (done == false) break;
+ if (done == false) {
+ break;
+ }
+ }
+ if (done == false || do_all == false) {
+ break;
}
- if (done == false || do_all == false) break;
}
}
@@ -1166,8 +1236,9 @@ bool sequencer_view_preview_poll(bContext *C)
{
SpaceSeq *sseq = CTX_wm_space_seq(C);
Editing *ed = BKE_sequencer_editing_get(CTX_data_scene(C), false);
- if (ed && sseq && (sseq->mainb == SEQ_DRAW_IMG_IMBUF))
+ if (ed && sseq && (sseq->mainb == SEQ_DRAW_IMG_IMBUF)) {
return 1;
+ }
return 0;
}
@@ -1175,8 +1246,9 @@ bool sequencer_view_preview_poll(bContext *C)
bool sequencer_view_strips_poll(bContext *C)
{
SpaceSeq *sseq = CTX_wm_space_seq(C);
- if (sseq && ED_space_sequencer_check_show_strip(sseq))
+ if (sseq && ED_space_sequencer_check_show_strip(sseq)) {
return 1;
+ }
return 0;
}
@@ -1227,12 +1299,15 @@ static int sequencer_snap_exec(bContext *C, wmOperator *op)
}
}
else if (seq->type & SEQ_TYPE_EFFECT) {
- if (seq->seq1 && (seq->seq1->flag & SELECT))
+ if (seq->seq1 && (seq->seq1->flag & SELECT)) {
BKE_sequence_calc(scene, seq);
- else if (seq->seq2 && (seq->seq2->flag & SELECT))
+ }
+ else if (seq->seq2 && (seq->seq2->flag & SELECT)) {
BKE_sequence_calc(scene, seq);
- else if (seq->seq3 && (seq->seq3->flag & SELECT))
+ }
+ else if (seq->seq3 && (seq->seq3->flag & SELECT)) {
BKE_sequence_calc(scene, seq);
+ }
}
}
@@ -1372,8 +1447,9 @@ static int sequencer_slip_invoke(bContext *C, wmOperator *op, const wmEvent *eve
/* first recursively count the trimmed elements */
num_seq = slip_count_sequences_rec(ed->seqbasep, true);
- if (num_seq == 0)
+ if (num_seq == 0) {
return OPERATOR_CANCELLED;
+ }
data = op->customdata = MEM_mallocN(sizeof(SlipData), "trimdata");
data->ts = MEM_mallocN(num_seq * sizeof(TransSeq), "trimdata_transform");
@@ -1457,8 +1533,9 @@ static bool sequencer_slip_recursively(Scene *scene, SlipData *data, int offset)
/* effects are only added if we they are in a metastrip. In this case, dependent strips will just be transformed and we can skip calculating for effects
* This way we can avoid an extra loop just for effects*/
- if (!(seq->type & SEQ_TYPE_EFFECT))
+ if (!(seq->type & SEQ_TYPE_EFFECT)) {
BKE_sequence_calc(scene, seq);
+ }
}
BKE_sequencer_free_imbuf(scene, &ed->seqbase, false);
@@ -1480,8 +1557,9 @@ static int sequencer_slip_exec(bContext *C, wmOperator *op)
/* first recursively count the trimmed elements */
num_seq = slip_count_sequences_rec(ed->seqbasep, true);
- if (num_seq == 0)
+ if (num_seq == 0) {
return OPERATOR_CANCELLED;
+ }
data = op->customdata = MEM_mallocN(sizeof(SlipData), "trimdata");
data->ts = MEM_mallocN(num_seq * sizeof(TransSeq), "trimdata_transform");
@@ -1874,8 +1952,9 @@ static int sequencer_reload_exec(bContext *C, wmOperator *op)
BKE_sequence_reload_new_file(scene, seq, !adjust_length);
if (adjust_length) {
- if (BKE_sequence_test_overlap(ed->seqbasep, seq))
+ if (BKE_sequence_test_overlap(ed->seqbasep, seq)) {
BKE_sequence_base_shuffle(ed->seqbasep, seq, scene);
+ }
}
}
}
@@ -2171,8 +2250,9 @@ static int sequencer_add_duplicate_exec(bContext *C, wmOperator *UNUSED(op))
ListBase nseqbase = {NULL, NULL};
- if (ed == NULL)
+ if (ed == NULL) {
return OPERATOR_CANCELLED;
+ }
BKE_sequence_base_dupli_recursive(scene, scene, &nseqbase, ed->seqbasep, SEQ_DUPE_CONTEXT, 0);
@@ -2181,8 +2261,9 @@ static int sequencer_add_duplicate_exec(bContext *C, wmOperator *UNUSED(op))
/* rely on the nseqbase list being added at the end */
BLI_movelisttolist(ed->seqbasep, &nseqbase);
- for (; seq; seq = seq->next)
+ for (; seq; seq = seq->next) {
BKE_sequencer_recursive_apply(seq, apply_unique_name_cb, scene);
+ }
WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene);
return OPERATOR_FINISHED;
@@ -2277,8 +2358,9 @@ static int sequencer_delete_invoke(bContext *C, wmOperator *op, const wmEvent *e
/* bounding box of 30 pixels is used for markers shortcuts,
* prevent conflict with markers shortcuts here
*/
- if (event->mval[1] <= 30)
+ if (event->mval[1] <= 30) {
return OPERATOR_PASS_THROUGH;
+ }
}
return WM_operator_confirm(C, op, event);
@@ -2483,8 +2565,9 @@ static int sequencer_meta_toggle_exec(bContext *C, wmOperator *UNUSED(op))
Sequence *seq;
- if (BLI_listbase_is_empty(&ed->metastack))
+ if (BLI_listbase_is_empty(&ed->metastack)) {
return OPERATOR_CANCELLED;
+ }
ms = ed->metastack.last;
BLI_remlink(&ed->metastack, ms);
@@ -2497,8 +2580,9 @@ static int sequencer_meta_toggle_exec(bContext *C, wmOperator *UNUSED(op))
}
/* recalc all: the meta can have effects connected to it */
- for (seq = ed->seqbasep->first; seq; seq = seq->next)
+ for (seq = ed->seqbasep->first; seq; seq = seq->next) {
BKE_sequence_calc(scene, seq);
+ }
/* 2.73+, keeping endpoings is important!
* moving them around means you can't usefully use metas in a complex edit */
@@ -2508,8 +2592,9 @@ static int sequencer_meta_toggle_exec(bContext *C, wmOperator *UNUSED(op))
BKE_sequence_single_fix(ms->parseq);
BKE_sequence_calc(scene, ms->parseq);
#else
- if (BKE_sequence_test_overlap(ed->seqbasep, ms->parseq))
+ if (BKE_sequence_test_overlap(ed->seqbasep, ms->parseq)) {
BKE_sequence_base_shuffle(ed->seqbasep, ms->parseq, scene);
+ }
#endif
BKE_sequencer_active_set(scene, ms->parseq);
@@ -2583,7 +2668,9 @@ static int sequencer_meta_make_exec(bContext *C, wmOperator *op)
BKE_sequencer_active_set(scene, seqm);
- if (BKE_sequence_test_overlap(ed->seqbasep, seqm) ) BKE_sequence_base_shuffle(ed->seqbasep, seqm, scene);
+ if (BKE_sequence_test_overlap(ed->seqbasep, seqm)) {
+ BKE_sequence_base_shuffle(ed->seqbasep, seqm, scene);
+ }
BKE_sequencer_update_muting(ed);
@@ -2612,11 +2699,21 @@ void SEQUENCER_OT_meta_make(wmOperatorType *ot)
static int seq_depends_on_meta(Sequence *seq, Sequence *seqm)
{
- if (seq == seqm) return 1;
- else if (seq->seq1 && seq_depends_on_meta(seq->seq1, seqm)) return 1;
- else if (seq->seq2 && seq_depends_on_meta(seq->seq2, seqm)) return 1;
- else if (seq->seq3 && seq_depends_on_meta(seq->seq3, seqm)) return 1;
- else return 0;
+ if (seq == seqm) {
+ return 1;
+ }
+ else if (seq->seq1 && seq_depends_on_meta(seq->seq1, seqm)) {
+ return 1;
+ }
+ else if (seq->seq2 && seq_depends_on_meta(seq->seq2, seqm)) {
+ return 1;
+ }
+ else if (seq->seq3 && seq_depends_on_meta(seq->seq3, seqm)) {
+ return 1;
+ }
+ else {
+ return 0;
+ }
}
/* separate_meta_make operator */
@@ -2627,8 +2724,9 @@ static int sequencer_meta_separate_exec(bContext *C, wmOperator *UNUSED(op))
Sequence *seq, *last_seq = BKE_sequencer_active_get(scene); /* last_seq checks (ed == NULL) */
- if (last_seq == NULL || last_seq->type != SEQ_TYPE_META)
+ if (last_seq == NULL || last_seq->type != SEQ_TYPE_META) {
return OPERATOR_CANCELLED;
+ }
for (seq = last_seq->seqbase.first; seq != NULL; seq = seq->next) {
BKE_sequence_invalidate_cache(scene, seq);
@@ -2642,9 +2740,11 @@ static int sequencer_meta_separate_exec(bContext *C, wmOperator *UNUSED(op))
BKE_sequence_free(scene, last_seq);
/* empty meta strip, delete all effects depending on it */
- for (seq = ed->seqbasep->first; seq; seq = seq->next)
- if ((seq->type & SEQ_TYPE_EFFECT) && seq_depends_on_meta(seq, last_seq))
+ for (seq = ed->seqbasep->first; seq; seq = seq->next) {
+ if ((seq->type & SEQ_TYPE_EFFECT) && seq_depends_on_meta(seq, last_seq)) {
seq->flag |= SEQ_FLAG_DELETE;
+ }
+ }
recurs_del_seq_flag(scene, ed->seqbasep, SEQ_FLAG_DELETE, 0);
@@ -2850,7 +2950,9 @@ static int sequencer_view_toggle_exec(bContext *C, wmOperator *UNUSED(op))
SpaceSeq *sseq = (SpaceSeq *)CTX_wm_space_data(C);
sseq->view++;
- if (sseq->view > SEQ_VIEW_SEQUENCE_PREVIEW) sseq->view = SEQ_VIEW_SEQUENCE;
+ if (sseq->view > SEQ_VIEW_SEQUENCE_PREVIEW) {
+ sseq->view = SEQ_VIEW_SEQUENCE;
+ }
ED_area_tag_refresh(CTX_wm_area(C));
@@ -2893,8 +2995,9 @@ static int sequencer_view_selected_exec(bContext *C, wmOperator *op)
int ymargin = 1;
int xmargin = FPS;
- if (ed == NULL)
+ if (ed == NULL) {
return OPERATOR_CANCELLED;
+ }
for (seq = ed->seqbasep->first; seq; seq = seq->next) {
if ((seq->flag & SELECT) || (seq == last_seq)) {
@@ -2974,8 +3077,9 @@ static bool strip_jump_internal(Scene *scene,
static bool sequencer_strip_jump_poll(bContext *C)
{
/* prevent changes during render */
- if (G.is_rendering)
+ if (G.is_rendering) {
return 0;
+ }
return sequencer_edit_poll(C);
}
@@ -3059,17 +3163,21 @@ static int sequencer_swap_exec(bContext *C, wmOperator *op)
Sequence *seq, *iseq;
int side = RNA_enum_get(op->ptr, "side");
- if (active_seq == NULL) return OPERATOR_CANCELLED;
+ if (active_seq == NULL) {
+ return OPERATOR_CANCELLED;
+ }
seq = find_next_prev_sequence(scene, active_seq, side, -1);
if (seq) {
/* disallow effect strips */
- if (BKE_sequence_effect_get_num_inputs(seq->type) >= 1 && (seq->effectdata || seq->seq1 || seq->seq2 || seq->seq3))
+ if (BKE_sequence_effect_get_num_inputs(seq->type) >= 1 && (seq->effectdata || seq->seq1 || seq->seq2 || seq->seq3)) {
return OPERATOR_CANCELLED;
- if ((BKE_sequence_effect_get_num_inputs(active_seq->type) >= 1) && (active_seq->effectdata || active_seq->seq1 || active_seq->seq2 || active_seq->seq3))
+ }
+ if ((BKE_sequence_effect_get_num_inputs(active_seq->type) >= 1) && (active_seq->effectdata || active_seq->seq1 || active_seq->seq2 || active_seq->seq3)) {
return OPERATOR_CANCELLED;
+ }
switch (side) {
case SEQ_SIDE_LEFT:
@@ -3134,8 +3242,9 @@ static int sequencer_rendersize_exec(bContext *C, wmOperator *UNUSED(op))
Sequence *active_seq = BKE_sequencer_active_get(scene);
StripElem *se = NULL;
- if (active_seq == NULL)
+ if (active_seq == NULL) {
return OPERATOR_CANCELLED;
+ }
if (active_seq->strip) {
@@ -3223,8 +3332,9 @@ static int sequencer_copy_exec(bContext *C, wmOperator *op)
Sequence *seq, *first_seq = nseqbase.first;
BLI_movelisttolist(ed->seqbasep, &nseqbase);
- for (seq = first_seq; seq; seq = seq->next)
+ for (seq = first_seq; seq; seq = seq->next) {
BKE_sequencer_recursive_apply(seq, apply_unique_name_cb, scene);
+ }
seqbase_clipboard.first = first_seq;
seqbase_clipboard.last = ed->seqbasep->last;
@@ -3350,11 +3460,13 @@ static int sequencer_swap_data_exec(bContext *C, wmOperator *op)
return OPERATOR_CANCELLED;
}
- if (seq_act->scene_sound)
+ if (seq_act->scene_sound) {
BKE_sound_remove_scene_sound(scene, seq_act->scene_sound);
+ }
- if (seq_other->scene_sound)
+ if (seq_other->scene_sound) {
BKE_sound_remove_scene_sound(scene, seq_other->scene_sound);
+ }
seq_act->scene_sound = NULL;
seq_other->scene_sound = NULL;
@@ -3362,8 +3474,12 @@ static int sequencer_swap_data_exec(bContext *C, wmOperator *op)
BKE_sequence_calc(scene, seq_act);
BKE_sequence_calc(scene, seq_other);
- if (seq_act->sound) BKE_sound_add_scene_sound_defaults(scene, seq_act);
- if (seq_other->sound) BKE_sound_add_scene_sound_defaults(scene, seq_other);
+ if (seq_act->sound) {
+ BKE_sound_add_scene_sound_defaults(scene, seq_act);
+ }
+ if (seq_other->sound) {
+ BKE_sound_add_scene_sound_defaults(scene, seq_other);
+ }
BKE_sequence_invalidate_cache(scene, seq_act);
BKE_sequence_invalidate_cache(scene, seq_other);
@@ -3541,30 +3657,40 @@ static int sequencer_enable_proxies_exec(bContext *C, wmOperator *op)
continue;
}
- if (proxy_25)
+ if (proxy_25) {
seq->strip->proxy->build_size_flags |= SEQ_PROXY_IMAGE_SIZE_25;
- else
+ }
+ else {
seq->strip->proxy->build_size_flags &= ~SEQ_PROXY_IMAGE_SIZE_25;
+ }
- if (proxy_50)
+ if (proxy_50) {
seq->strip->proxy->build_size_flags |= SEQ_PROXY_IMAGE_SIZE_50;
- else
+ }
+ else {
seq->strip->proxy->build_size_flags &= ~SEQ_PROXY_IMAGE_SIZE_50;
+ }
- if (proxy_75)
+ if (proxy_75) {
seq->strip->proxy->build_size_flags |= SEQ_PROXY_IMAGE_SIZE_75;
- else
+ }
+ else {
seq->strip->proxy->build_size_flags &= ~SEQ_PROXY_IMAGE_SIZE_75;
+ }
- if (proxy_100)
+ if (proxy_100) {
seq->strip->proxy->build_size_flags |= SEQ_PROXY_IMAGE_SIZE_100;
- else
+ }
+ else {
seq->strip->proxy->build_size_flags &= ~SEQ_PROXY_IMAGE_SIZE_100;
+ }
- if (!overwrite)
+ if (!overwrite) {
seq->strip->proxy->build_flags |= SEQ_PROXY_SKIP_EXISTING;
- else
+ }
+ else {
seq->strip->proxy->build_flags &= ~SEQ_PROXY_SKIP_EXISTING;
+ }
}
}
} SEQ_END;
@@ -3742,8 +3868,9 @@ static int sequencer_change_path_exec(bContext *C, wmOperator *op)
else {
len = RNA_property_collection_length(op->ptr, RNA_struct_find_property(op->ptr, "files"));
}
- if (len == 0)
+ if (len == 0) {
return OPERATOR_CANCELLED;
+ }
RNA_string_get(op->ptr, "directory", directory);
if (is_relative_path) {
@@ -3865,10 +3992,12 @@ static int sequencer_export_subtitles_invoke(bContext *C, wmOperator *op, const
if (!RNA_struct_property_is_set(op->ptr, "filepath")) {
char filepath[FILE_MAX];
- if (BKE_main_blendfile_path(bmain)[0] == '\0')
+ if (BKE_main_blendfile_path(bmain)[0] == '\0') {
BLI_strncpy(filepath, "untitled", sizeof(filepath));
- else
+ }
+ else {
BLI_strncpy(filepath, BKE_main_blendfile_path(bmain), sizeof(filepath));
+ }
BLI_path_extension_replace(filepath, sizeof(filepath), ".srt");
RNA_string_set(op->ptr, "filepath", filepath);
diff --git a/source/blender/editors/space_sequencer/sequencer_modifier.c b/source/blender/editors/space_sequencer/sequencer_modifier.c
index c3df5a0c5ee..41ca52e0431 100644
--- a/source/blender/editors/space_sequencer/sequencer_modifier.c
+++ b/source/blender/editors/space_sequencer/sequencer_modifier.c
@@ -51,8 +51,9 @@ static bool strip_modifier_active_poll(bContext *C)
if (ed) {
Sequence *seq = BKE_sequencer_active_get(scene);
- if (seq)
+ if (seq) {
return BKE_sequence_supports_modifiers(seq);
+ }
}
return false;
@@ -105,8 +106,9 @@ static int strip_modifier_remove_exec(bContext *C, wmOperator *op)
RNA_string_get(op->ptr, "name", name);
smd = BKE_sequence_modifier_find_by_name(seq, name);
- if (!smd)
+ if (!smd) {
return OPERATOR_CANCELLED;
+ }
BLI_remlink(&seq->modifiers, smd);
BKE_sequence_modifier_free(smd);
@@ -154,8 +156,9 @@ static int strip_modifier_move_exec(bContext *C, wmOperator *op)
direction = RNA_enum_get(op->ptr, "direction");
smd = BKE_sequence_modifier_find_by_name(seq, name);
- if (!smd)
+ if (!smd) {
return OPERATOR_CANCELLED;
+ }
if (direction == SEQ_MODIFIER_MOVE_UP) {
if (smd->prev) {
@@ -216,14 +219,16 @@ static int strip_modifier_copy_exec(bContext *C, wmOperator *op)
Sequence *seq_iter;
const int type = RNA_enum_get(op->ptr, "type");
- if (!seq || !seq->modifiers.first)
+ if (!seq || !seq->modifiers.first) {
return OPERATOR_CANCELLED;
+ }
SEQP_BEGIN(ed, seq_iter)
{
if (seq_iter->flag & SELECT) {
- if (seq_iter == seq)
+ if (seq_iter == seq) {
continue;
+ }
if (type == SEQ_MODIFIER_COPY_REPLACE) {
if (seq_iter->modifiers.first) {
diff --git a/source/blender/editors/space_sequencer/sequencer_scopes.c b/source/blender/editors/space_sequencer/sequencer_scopes.c
index f93eaa5bce5..5ccd9e86e12 100644
--- a/source/blender/editors/space_sequencer/sequencer_scopes.c
+++ b/source/blender/editors/space_sequencer/sequencer_scopes.c
@@ -513,12 +513,15 @@ static ImBuf *make_histogram_view_from_ibuf_byte(ImBuf *ibuf)
nr = nb = ng = 0;
for (x = 0; x < HIS_STEPS; x++) {
- if (bins[0][x] > nr)
+ if (bins[0][x] > nr) {
nr = bins[0][x];
- if (bins[1][x] > ng)
+ }
+ if (bins[1][x] > ng) {
ng = bins[1][x];
- if (bins[2][x] > nb)
+ }
+ if (bins[2][x] > nb) {
nb = bins[2][x];
+ }
}
for (x = 0; x < HIS_STEPS; x++) {
@@ -598,12 +601,15 @@ static ImBuf *make_histogram_view_from_ibuf_float(ImBuf *ibuf)
nr = nb = ng = 0;
for (x = 0; x < HIS_STEPS; x++) {
- if (bins[0][x] > nr)
+ if (bins[0][x] > nr) {
nr = bins[0][x];
- if (bins[1][x] > ng)
+ }
+ if (bins[1][x] > ng) {
ng = bins[1][x];
- if (bins[2][x] > nb)
+ }
+ if (bins[2][x] > nb) {
nb = bins[2][x];
+ }
}
for (x = 0; x < HIS_STEPS; x++) {
diff --git a/source/blender/editors/space_sequencer/sequencer_select.c b/source/blender/editors/space_sequencer/sequencer_select.c
index b87e0b185a4..7742d74d559 100644
--- a/source/blender/editors/space_sequencer/sequencer_select.c
+++ b/source/blender/editors/space_sequencer/sequencer_select.c
@@ -131,11 +131,13 @@ static void select_linked_time(ListBase *seqbase, Sequence *seq_link)
/* clear for reselection */
seq->flag &= ~(SEQ_LEFTSEL | SEQ_RIGHTSEL);
- if (left_match && seq_link->flag & SEQ_LEFTSEL)
+ if (left_match && seq_link->flag & SEQ_LEFTSEL) {
seq->flag |= SELECT | SEQ_LEFTSEL;
+ }
- if (right_match && seq_link->flag & SEQ_RIGHTSEL)
+ if (right_match && seq_link->flag & SEQ_RIGHTSEL) {
seq->flag |= SELECT | SEQ_RIGHTSEL;
+ }
recurs_sel_seq(seq);
}
@@ -159,18 +161,21 @@ void ED_sequencer_select_sequence_single(Scene *scene, Sequence *seq, bool desel
{
Editing *ed = BKE_sequencer_editing_get(scene, false);
- if (deselect_all)
+ if (deselect_all) {
ED_sequencer_deselect_all(scene);
+ }
BKE_sequencer_active_set(scene, seq);
if ((seq->type == SEQ_TYPE_IMAGE) || (seq->type == SEQ_TYPE_MOVIE)) {
- if (seq->strip)
+ if (seq->strip) {
BLI_strncpy(ed->act_imagedir, seq->strip->dir, FILE_MAXDIR);
+ }
}
else if (seq->type == SEQ_TYPE_SOUND_RAM) {
- if (seq->strip)
+ if (seq->strip) {
BLI_strncpy(ed->act_sounddir, seq->strip->dir, FILE_MAXDIR);
+ }
}
seq->flag |= SELECT;
recurs_sel_seq(seq);
@@ -322,16 +327,18 @@ static int sequencer_select_invoke(bContext *C, wmOperator *op, const wmEvent *e
int hand, sel_side;
TimeMarker *marker;
- if (ed == NULL)
+ if (ed == NULL) {
return OPERATOR_CANCELLED;
+ }
marker = find_nearest_marker(SCE_MARKERS, 1); //XXX - dummy function for now
seq = find_nearest_seq(scene, v2d, &hand, event->mval);
// XXX - not nice, Ctrl+RMB needs to do left_right only when not over a strip
- if (seq && linked_time && (left_right == SEQ_SELECT_LR_MOUSE))
+ if (seq && linked_time && (left_right == SEQ_SELECT_LR_MOUSE)) {
left_right = SEQ_SELECT_LR_NONE;
+ }
if (marker) {
@@ -339,10 +346,12 @@ static int sequencer_select_invoke(bContext *C, wmOperator *op, const wmEvent *e
/* select timeline marker */
if (extend) {
oldflag = marker->flag;
- if (oldflag & SELECT)
+ if (oldflag & SELECT) {
marker->flag &= ~SELECT;
- else
+ }
+ else {
marker->flag |= SELECT;
+ }
}
else {
/* XXX, in 2.4x, seq selection used to deselect all, need to re-thnik this for 2.5 */
@@ -402,8 +411,9 @@ static int sequencer_select_invoke(bContext *C, wmOperator *op, const wmEvent *e
act_orig = ed->act_seq;
- if (extend == 0 && linked_handle == 0)
+ if (extend == 0 && linked_handle == 0) {
ED_sequencer_deselect_all(scene);
+ }
if (seq) {
BKE_sequencer_active_set(scene, seq);
@@ -448,13 +458,17 @@ static int sequencer_select_invoke(bContext *C, wmOperator *op, const wmEvent *e
switch (sel_side) {
case SEQ_SIDE_LEFT:
if ((seq->flag & SEQ_LEFTSEL) && (neighbor->flag & SEQ_RIGHTSEL)) {
- if (extend == 0) ED_sequencer_deselect_all(scene);
+ if (extend == 0) {
+ ED_sequencer_deselect_all(scene);
+ }
seq->flag |= SELECT;
select_active_side(ed->seqbasep, SEQ_SIDE_LEFT, seq->machine, seq->startdisp);
}
else {
- if (extend == 0) ED_sequencer_deselect_all(scene);
+ if (extend == 0) {
+ ED_sequencer_deselect_all(scene);
+ }
seq->flag |= SELECT;
neighbor->flag |= SELECT;
@@ -465,13 +479,17 @@ static int sequencer_select_invoke(bContext *C, wmOperator *op, const wmEvent *e
break;
case SEQ_SIDE_RIGHT:
if ((seq->flag & SEQ_RIGHTSEL) && (neighbor->flag & SEQ_LEFTSEL)) {
- if (extend == 0) ED_sequencer_deselect_all(scene);
+ if (extend == 0) {
+ ED_sequencer_deselect_all(scene);
+ }
seq->flag |= SELECT;
select_active_side(ed->seqbasep, SEQ_SIDE_RIGHT, seq->machine, seq->startdisp);
}
else {
- if (extend == 0) ED_sequencer_deselect_all(scene);
+ if (extend == 0) {
+ ED_sequencer_deselect_all(scene);
+ }
seq->flag |= SELECT;
neighbor->flag |= SELECT;
@@ -483,7 +501,9 @@ static int sequencer_select_invoke(bContext *C, wmOperator *op, const wmEvent *e
}
}
else {
- if (extend == 0) ED_sequencer_deselect_all(scene);
+ if (extend == 0) {
+ ED_sequencer_deselect_all(scene);
+ }
select_active_side(ed->seqbasep, sel_side, seq->machine, seq->startdisp);
}
}
@@ -492,8 +512,9 @@ static int sequencer_select_invoke(bContext *C, wmOperator *op, const wmEvent *e
if (extend && (seq->flag & SELECT) && ed->act_seq == act_orig) {
switch (hand) {
case SEQ_SIDE_NONE:
- if (linked_handle == 0)
+ if (linked_handle == 0) {
seq->flag &= ~SEQ_ALLSEL;
+ }
break;
case SEQ_SIDE_LEFT:
seq->flag ^= SEQ_LEFTSEL;
@@ -505,8 +526,12 @@ static int sequencer_select_invoke(bContext *C, wmOperator *op, const wmEvent *e
}
else {
seq->flag |= SELECT;
- if (hand == SEQ_SIDE_LEFT) seq->flag |= SEQ_LEFTSEL;
- if (hand == SEQ_SIDE_RIGHT) seq->flag |= SEQ_RIGHTSEL;
+ if (hand == SEQ_SIDE_LEFT) {
+ seq->flag |= SEQ_LEFTSEL;
+ }
+ if (hand == SEQ_SIDE_RIGHT) {
+ seq->flag |= SEQ_RIGHTSEL;
+ }
}
}
@@ -581,8 +606,9 @@ static bool select_more_less_seq__internal(Scene *scene, bool sel, const bool li
bool changed = false;
int isel;
- if (ed == NULL)
+ if (ed == NULL) {
return changed;
+ }
if (sel) {
sel = SELECT;
@@ -646,8 +672,9 @@ static int sequencer_select_more_exec(bContext *C, wmOperator *UNUSED(op))
{
Scene *scene = CTX_data_scene(C);
- if (!select_more_less_seq__internal(scene, true, false))
+ if (!select_more_less_seq__internal(scene, true, false)) {
return OPERATOR_CANCELLED;
+ }
WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER | NA_SELECTED, scene);
@@ -677,8 +704,9 @@ static int sequencer_select_less_exec(bContext *C, wmOperator *UNUSED(op))
{
Scene *scene = CTX_data_scene(C);
- if (!select_more_less_seq__internal(scene, false, false))
+ if (!select_more_less_seq__internal(scene, false, false)) {
return OPERATOR_CANCELLED;
+ }
WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER | NA_SELECTED, scene);
@@ -716,11 +744,13 @@ static int sequencer_select_linked_pick_invoke(bContext *C, wmOperator *op, cons
/* this works like UV, not mesh */
mouse_seq = find_nearest_seq(scene, v2d, &hand, event->mval);
- if (!mouse_seq)
+ if (!mouse_seq) {
return OPERATOR_FINISHED; /* user error as with mesh?? */
+ }
- if (extend == 0)
+ if (extend == 0) {
ED_sequencer_deselect_all(scene);
+ }
mouse_seq->flag |= SELECT;
recurs_sel_seq(mouse_seq);
@@ -845,8 +875,9 @@ static int sequencer_select_active_side_exec(bContext *C, wmOperator *op)
Editing *ed = BKE_sequencer_editing_get(scene, false);
Sequence *seq_act = BKE_sequencer_active_get(scene);
- if (ed == NULL || seq_act == NULL)
+ if (ed == NULL || seq_act == NULL) {
return OPERATOR_CANCELLED;
+ }
seq_act->flag |= SELECT;
@@ -1028,8 +1059,9 @@ static bool select_grouped_data(Editing *ed, Sequence *actseq, const int channel
bool changed = false;
const char *dir = actseq->strip ? actseq->strip->dir : NULL;
- if (!SEQ_USE_DATA(actseq))
+ if (!SEQ_USE_DATA(actseq)) {
return changed;
+ }
if (SEQ_HAS_PATH(actseq) && dir) {
SEQP_BEGIN (ed, seq)
@@ -1085,8 +1117,9 @@ static bool select_grouped_effect(Editing *ed, Sequence *actseq, const int chann
bool effects[SEQ_TYPE_MAX + 1];
int i;
- for (i = 0; i <= SEQ_TYPE_MAX; i++)
+ for (i = 0; i <= SEQ_TYPE_MAX; i++) {
effects[i] = false;
+ }
SEQP_BEGIN (ed, seq)
{
@@ -1101,9 +1134,9 @@ static bool select_grouped_effect(Editing *ed, Sequence *actseq, const int chann
SEQP_BEGIN (ed, seq)
{
if (SEQ_CHANNEL_CHECK(seq, channel) && effects[seq->type]) {
- if (seq->seq1) seq->seq1->flag |= SELECT;
- if (seq->seq2) seq->seq2->flag |= SELECT;
- if (seq->seq3) seq->seq3->flag |= SELECT;
+ if (seq->seq1) { seq->seq1->flag |= SELECT; }
+ if (seq->seq2) { seq->seq2->flag |= SELECT; }
+ if (seq->seq3) { seq->seq3->flag |= SELECT; }
changed = true;
}
}
@@ -1166,9 +1199,15 @@ static bool select_grouped_effect_link(Editing *ed, Sequence *actseq, const int
(seq->seq2 && seq->seq2->tmp) ||
(seq->seq3 && seq->seq3->tmp)))
{
- if (startdisp > seq->startdisp) startdisp = seq->startdisp;
- if (enddisp < seq->enddisp) enddisp = seq->enddisp;
- if (machine < seq->machine) machine = seq->machine;
+ if (startdisp > seq->startdisp) {
+ startdisp = seq->startdisp;
+ }
+ if (enddisp < seq->enddisp) {
+ enddisp = seq->enddisp;
+ }
+ if (machine < seq->machine) {
+ machine = seq->machine;
+ }
seq->tmp = POINTER_FROM_INT(true);
diff --git a/source/blender/editors/space_sequencer/sequencer_view.c b/source/blender/editors/space_sequencer/sequencer_view.c
index d0e31dbbe79..30f526c0675 100644
--- a/source/blender/editors/space_sequencer/sequencer_view.c
+++ b/source/blender/editors/space_sequencer/sequencer_view.c
@@ -177,8 +177,9 @@ static int sample_invoke(bContext *C, wmOperator *op, const wmEvent *event)
SpaceSeq *sseq = CTX_wm_space_seq(C);
ImageSampleInfo *info;
- if (sseq->mainb != SEQ_DRAW_IMG_IMBUF)
+ if (sseq->mainb != SEQ_DRAW_IMG_IMBUF) {
return OPERATOR_CANCELLED;
+ }
info = MEM_callocN(sizeof(ImageSampleInfo), "ImageSampleInfo");
info->art = ar->type;
diff --git a/source/blender/editors/space_sequencer/space_sequencer.c b/source/blender/editors/space_sequencer/space_sequencer.c
index dec70c4bf43..561d603ab08 100644
--- a/source/blender/editors/space_sequencer/space_sequencer.c
+++ b/source/blender/editors/space_sequencer/space_sequencer.c
@@ -74,13 +74,17 @@ ARegion *sequencer_has_buttons_region(ScrArea *sa)
ARegion *ar, *arnew;
ar = BKE_area_find_region_type(sa, RGN_TYPE_UI);
- if (ar) return ar;
+ if (ar) {
+ return ar;
+ }
/* add subdiv level; after header */
ar = BKE_area_find_region_type(sa, RGN_TYPE_HEADER);
/* is error! */
- if (ar == NULL) return NULL;
+ if (ar == NULL) {
+ return NULL;
+ }
arnew = MEM_callocN(sizeof(ARegion), "buttons for sequencer");
@@ -97,9 +101,11 @@ static ARegion *sequencer_find_region(ScrArea *sa, short type)
{
ARegion *ar = NULL;
- for (ar = sa->regionbase.first; ar; ar = ar->next)
- if (ar->regiontype == type)
+ for (ar = sa->regionbase.first; ar; ar = ar->next) {
+ if (ar->regiontype == type) {
return ar;
+ }
+ }
return ar;
}
@@ -199,20 +205,25 @@ static void sequencer_free(SpaceLink *sl)
// XXX if (sseq->gpd) BKE_gpencil_free(sseq->gpd);
- if (scopes->zebra_ibuf)
+ if (scopes->zebra_ibuf) {
IMB_freeImBuf(scopes->zebra_ibuf);
+ }
- if (scopes->waveform_ibuf)
+ if (scopes->waveform_ibuf) {
IMB_freeImBuf(scopes->waveform_ibuf);
+ }
- if (scopes->sep_waveform_ibuf)
+ if (scopes->sep_waveform_ibuf) {
IMB_freeImBuf(scopes->sep_waveform_ibuf);
+ }
- if (scopes->vector_ibuf)
+ if (scopes->vector_ibuf) {
IMB_freeImBuf(scopes->vector_ibuf);
+ }
- if (scopes->histogram_ibuf)
+ if (scopes->histogram_ibuf) {
IMB_freeImBuf(scopes->histogram_ibuf);
+ }
}
@@ -347,12 +358,14 @@ static void sequencer_listener(
break;
case NC_WINDOW:
case NC_SPACE:
- if (wmn->data == ND_SPACE_SEQUENCER)
+ if (wmn->data == ND_SPACE_SEQUENCER) {
sequencer_scopes_tag_refresh(sa);
+ }
break;
case NC_GPENCIL:
- if (wmn->data & ND_GPENCIL_EDITMODE)
+ if (wmn->data & ND_GPENCIL_EDITMODE) {
ED_area_tag_redraw(sa);
+ }
break;
}
}
@@ -365,10 +378,13 @@ static bool image_drop_poll(bContext *C, wmDrag *drag, const wmEvent *event, con
Scene *scene = CTX_data_scene(C);
int hand;
- if (drag->type == WM_DRAG_PATH)
- if (ELEM(drag->icon, ICON_FILE_IMAGE, ICON_FILE_BLANK)) /* rule might not work? */
- if (find_nearest_seq(scene, &ar->v2d, &hand, event->mval) == NULL)
+ if (drag->type == WM_DRAG_PATH) {
+ if (ELEM(drag->icon, ICON_FILE_IMAGE, ICON_FILE_BLANK)) { /* rule might not work? */
+ if (find_nearest_seq(scene, &ar->v2d, &hand, event->mval) == NULL) {
return 1;
+ }
+ }
+ }
return 0;
}
@@ -379,10 +395,13 @@ static bool movie_drop_poll(bContext *C, wmDrag *drag, const wmEvent *event, con
Scene *scene = CTX_data_scene(C);
int hand;
- if (drag->type == WM_DRAG_PATH)
- if (ELEM(drag->icon, 0, ICON_FILE_MOVIE, ICON_FILE_BLANK)) /* rule might not work? */
- if (find_nearest_seq(scene, &ar->v2d, &hand, event->mval) == NULL)
+ if (drag->type == WM_DRAG_PATH) {
+ if (ELEM(drag->icon, 0, ICON_FILE_MOVIE, ICON_FILE_BLANK)) { /* rule might not work? */
+ if (find_nearest_seq(scene, &ar->v2d, &hand, event->mval) == NULL) {
return 1;
+ }
+ }
+ }
return 0;
}
@@ -392,18 +411,22 @@ static bool sound_drop_poll(bContext *C, wmDrag *drag, const wmEvent *event, con
Scene *scene = CTX_data_scene(C);
int hand;
- if (drag->type == WM_DRAG_PATH)
- if (ELEM(drag->icon, ICON_FILE_SOUND, ICON_FILE_BLANK)) /* rule might not work? */
- if (find_nearest_seq(scene, &ar->v2d, &hand, event->mval) == NULL)
+ if (drag->type == WM_DRAG_PATH) {
+ if (ELEM(drag->icon, ICON_FILE_SOUND, ICON_FILE_BLANK)) { /* rule might not work? */
+ if (find_nearest_seq(scene, &ar->v2d, &hand, event->mval) == NULL) {
return 1;
+ }
+ }
+ }
return 0;
}
static void sequencer_drop_copy(wmDrag *drag, wmDropBox *drop)
{
/* copy drag path to properties */
- if (RNA_struct_find_property(drop->ptr, "filepath"))
+ if (RNA_struct_find_property(drop->ptr, "filepath")) {
RNA_string_set(drop->ptr, "filepath", drag->path);
+ }
if (RNA_struct_find_property(drop->ptr, "directory")) {
PointerRNA itemptr;
@@ -514,16 +537,19 @@ static void sequencer_main_region_listener(
}
break;
case NC_SPACE:
- if (wmn->data == ND_SPACE_SEQUENCER)
+ if (wmn->data == ND_SPACE_SEQUENCER) {
ED_region_tag_redraw(ar);
+ }
break;
case NC_ID:
- if (wmn->action == NA_RENAME)
+ if (wmn->action == NA_RENAME) {
ED_region_tag_redraw(ar);
+ }
break;
case NC_SCREEN:
- if (ELEM(wmn->data, ND_ANIMPLAY))
+ if (ELEM(wmn->data, ND_ANIMPLAY)) {
ED_region_tag_redraw(ar);
+ }
break;
}
}
@@ -627,21 +653,27 @@ static void sequencer_preview_region_draw(const bContext *C, ARegion *ar)
(sseq->mainb == SEQ_DRAW_IMG_IMBUF));
/* XXX temp fix for wrong setting in sseq->mainb */
- if (sseq->mainb == SEQ_DRAW_SEQUENCE) sseq->mainb = SEQ_DRAW_IMG_IMBUF;
+ if (sseq->mainb == SEQ_DRAW_SEQUENCE) {
+ sseq->mainb = SEQ_DRAW_IMG_IMBUF;
+ }
- if (!show_split || sseq->overlay_type != SEQ_DRAW_OVERLAY_REFERENCE)
+ if (!show_split || sseq->overlay_type != SEQ_DRAW_OVERLAY_REFERENCE) {
sequencer_draw_preview(C, scene, ar, sseq, scene->r.cfra, 0, false, false);
+ }
if (show_split && sseq->overlay_type != SEQ_DRAW_OVERLAY_CURRENT) {
int over_cfra;
- if (scene->ed->over_flag & SEQ_EDIT_OVERLAY_ABS)
+ if (scene->ed->over_flag & SEQ_EDIT_OVERLAY_ABS) {
over_cfra = scene->ed->over_cfra;
- else
+ }
+ else {
over_cfra = scene->r.cfra + scene->ed->over_ofs;
+ }
- if (over_cfra != scene->r.cfra || sseq->overlay_type != SEQ_DRAW_OVERLAY_RECT)
+ if (over_cfra != scene->r.cfra || sseq->overlay_type != SEQ_DRAW_OVERLAY_RECT) {
sequencer_draw_preview(C, scene, ar, sseq, scene->r.cfra, over_cfra - scene->r.cfra, true, false);
+ }
}
if ((U.uiflag & USER_SHOW_FPS) && ED_screen_animation_no_scrub(wm)) {
@@ -685,8 +717,9 @@ static void sequencer_preview_region_listener(
}
break;
case NC_SPACE:
- if (wmn->data == ND_SPACE_SEQUENCER)
+ if (wmn->data == ND_SPACE_SEQUENCER) {
ED_region_tag_redraw(ar);
+ }
break;
case NC_ID:
switch (wmn->data) {
@@ -741,12 +774,14 @@ static void sequencer_buttons_region_listener(
}
break;
case NC_SPACE:
- if (wmn->data == ND_SPACE_SEQUENCER)
+ if (wmn->data == ND_SPACE_SEQUENCER) {
ED_region_tag_redraw(ar);
+ }
break;
case NC_ID:
- if (wmn->action == NA_RENAME)
+ if (wmn->action == NA_RENAME) {
ED_region_tag_redraw(ar);
+ }
break;
}
}