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:
authorJason Wilkins <Jason.A.Wilkins@gmail.com>2012-08-21 15:35:40 +0400
committerJason Wilkins <Jason.A.Wilkins@gmail.com>2012-08-21 15:35:40 +0400
commitc57b398ff9a93cc9d12011844efdc68ef0b5fb62 (patch)
treef0c39318e3483df3c7a58d0e4af929cf4de84bdb /source/blender/editors/space_sequencer
parent4b458a8467843dca68dcbcbb2278068b596cb582 (diff)
parent77f47799ddff99da672aa58e5d989237403e7707 (diff)
"Pens Down" merge /w trunk r49015-r50064. Make clean patches for Google Summer of Code against trunk revision 50064.
Note: The new flag LIB_LOAD_ASYNC in the GE conflicted with trunks new LIB_LOAD_SCRIPTS, so I changed the value of ASYNC. So, heads up if these values has been saved in any .blend files! Once again (see last merge note) it seems like node_draw.c had a bunch of wierd conflicts that make it look like it missed a merge or update. Not sure what is going on with that file. Other parts of the merge had some difficulty resolving proper bracket nesting in places where it seems like the merge should have gone smoothly. Maybe that was KDiff3's fault? This reduces my confidence on if bugs were not introduced.
Diffstat (limited to 'source/blender/editors/space_sequencer')
-rw-r--r--source/blender/editors/space_sequencer/CMakeLists.txt1
-rw-r--r--source/blender/editors/space_sequencer/sequencer_add.c72
-rw-r--r--source/blender/editors/space_sequencer/sequencer_draw.c134
-rw-r--r--source/blender/editors/space_sequencer/sequencer_edit.c312
-rw-r--r--source/blender/editors/space_sequencer/sequencer_intern.h6
-rw-r--r--source/blender/editors/space_sequencer/sequencer_modifier.c156
-rw-r--r--source/blender/editors/space_sequencer/sequencer_ops.c4
-rw-r--r--source/blender/editors/space_sequencer/sequencer_select.c13
-rw-r--r--source/blender/editors/space_sequencer/space_sequencer.c24
9 files changed, 458 insertions, 264 deletions
diff --git a/source/blender/editors/space_sequencer/CMakeLists.txt b/source/blender/editors/space_sequencer/CMakeLists.txt
index 6d17cb76b46..91ed9da17bc 100644
--- a/source/blender/editors/space_sequencer/CMakeLists.txt
+++ b/source/blender/editors/space_sequencer/CMakeLists.txt
@@ -41,6 +41,7 @@ set(SRC
sequencer_buttons.c
sequencer_draw.c
sequencer_edit.c
+ sequencer_modifier.c
sequencer_ops.c
sequencer_scopes.c
sequencer_select.c
diff --git a/source/blender/editors/space_sequencer/sequencer_add.c b/source/blender/editors/space_sequencer/sequencer_add.c
index 26bedd14d6e..7b7170d99e0 100644
--- a/source/blender/editors/space_sequencer/sequencer_add.c
+++ b/source/blender/editors/space_sequencer/sequencer_add.c
@@ -230,7 +230,7 @@ static int sequencer_add_scene_strip_exec(bContext *C, wmOperator *op)
return OPERATOR_CANCELLED;
}
- seq = alloc_sequence(ed->seqbasep, start_frame, channel);
+ seq = BKE_sequence_alloc(ed->seqbasep, start_frame, channel);
seq->type = SEQ_TYPE_SCENE;
seq->blend_mode = SEQ_TYPE_CROSS; /* so alpha adjustment fade to the strip below */
@@ -242,11 +242,11 @@ static int sequencer_add_scene_strip_exec(bContext *C, wmOperator *op)
strip->us = 1;
BLI_strncpy(seq->name + 2, sce_seq->id.name + 2, sizeof(seq->name) - 2);
- seqbase_unique_name_recursive(&ed->seqbase, seq);
+ BKE_seqence_base_unique_name_recursive(&ed->seqbase, seq);
seq->scene_sound = sound_scene_add_scene_sound(scene, seq, start_frame, start_frame + seq->len, 0);
- calc_sequence_disp(scene, seq);
+ BKE_sequence_calc_disp(scene, seq);
BKE_sequencer_sort(scene);
if (RNA_boolean_get(op->ptr, "replace_sel")) {
@@ -256,7 +256,7 @@ static int sequencer_add_scene_strip_exec(bContext *C, wmOperator *op)
}
if (RNA_boolean_get(op->ptr, "overlap") == FALSE) {
- if (seq_test_overlap(ed->seqbasep, seq)) shuffle_seq(ed->seqbasep, seq, scene);
+ if (BKE_sequence_test_overlap(ed->seqbasep, seq)) BKE_sequence_base_shuffle(ed->seqbasep, seq, scene);
}
WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene);
@@ -329,7 +329,7 @@ static int sequencer_add_movieclip_strip_exec(bContext *C, wmOperator *op)
return OPERATOR_CANCELLED;
}
- seq = alloc_sequence(ed->seqbasep, start_frame, channel);
+ seq = BKE_sequence_alloc(ed->seqbasep, start_frame, channel);
seq->type = SEQ_TYPE_MOVIECLIP;
seq->blend_mode = SEQ_TYPE_CROSS;
seq->clip = clip;
@@ -343,9 +343,9 @@ static int sequencer_add_movieclip_strip_exec(bContext *C, wmOperator *op)
strip->us = 1;
BLI_strncpy(seq->name + 2, clip->id.name + 2, sizeof(seq->name) - 2);
- seqbase_unique_name_recursive(&ed->seqbase, seq);
+ BKE_seqence_base_unique_name_recursive(&ed->seqbase, seq);
- calc_sequence_disp(scene, seq);
+ BKE_sequence_calc_disp(scene, seq);
BKE_sequencer_sort(scene);
if (RNA_boolean_get(op->ptr, "replace_sel")) {
@@ -355,7 +355,7 @@ static int sequencer_add_movieclip_strip_exec(bContext *C, wmOperator *op)
}
if (RNA_boolean_get(op->ptr, "overlap") == FALSE) {
- if (seq_test_overlap(ed->seqbasep, seq)) shuffle_seq(ed->seqbasep, seq, scene);
+ if (BKE_sequence_test_overlap(ed->seqbasep, seq)) BKE_sequence_base_shuffle(ed->seqbasep, seq, scene);
}
WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene);
@@ -425,7 +425,7 @@ static int sequencer_add_mask_strip_exec(bContext *C, wmOperator *op)
return OPERATOR_CANCELLED;
}
- seq = alloc_sequence(ed->seqbasep, start_frame, channel);
+ seq = BKE_sequence_alloc(ed->seqbasep, start_frame, channel);
seq->type = SEQ_TYPE_MASK;
seq->blend_mode = SEQ_TYPE_CROSS;
seq->mask = mask;
@@ -439,9 +439,9 @@ static int sequencer_add_mask_strip_exec(bContext *C, wmOperator *op)
strip->us = 1;
BLI_strncpy(seq->name + 2, mask->id.name + 2, sizeof(seq->name) - 2);
- seqbase_unique_name_recursive(&ed->seqbase, seq);
+ BKE_seqence_base_unique_name_recursive(&ed->seqbase, seq);
- calc_sequence_disp(scene, seq);
+ BKE_sequence_calc_disp(scene, seq);
BKE_sequencer_sort(scene);
if (RNA_boolean_get(op->ptr, "replace_sel")) {
@@ -451,7 +451,7 @@ static int sequencer_add_mask_strip_exec(bContext *C, wmOperator *op)
}
if (RNA_boolean_get(op->ptr, "overlap") == FALSE) {
- if (seq_test_overlap(ed->seqbasep, seq)) shuffle_seq(ed->seqbasep, seq, scene);
+ if (BKE_sequence_test_overlap(ed->seqbasep, seq)) BKE_sequence_base_shuffle(ed->seqbasep, seq, scene);
}
WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene);
@@ -535,7 +535,7 @@ static int sequencer_add_generic_strip_exec(bContext *C, wmOperator *op, SeqLoad
seq = seq_load_func(C, ed->seqbasep, &seq_load);
if (seq) {
if (overlap == FALSE) {
- if (seq_test_overlap(ed->seqbasep, seq)) shuffle_seq(ed->seqbasep, seq, scene);
+ if (BKE_sequence_test_overlap(ed->seqbasep, seq)) BKE_sequence_base_shuffle(ed->seqbasep, seq, scene);
}
}
}
@@ -546,7 +546,8 @@ static int sequencer_add_generic_strip_exec(bContext *C, wmOperator *op, SeqLoad
seq = seq_load_func(C, ed->seqbasep, &seq_load);
if (seq) {
if (overlap == FALSE) {
- if (seq_test_overlap(ed->seqbasep, seq)) shuffle_seq(ed->seqbasep, seq, scene);
+ if (BKE_sequence_test_overlap(ed->seqbasep, seq))
+ BKE_sequence_base_shuffle(ed->seqbasep, seq, scene);
}
}
}
@@ -557,7 +558,7 @@ static int sequencer_add_generic_strip_exec(bContext *C, wmOperator *op, SeqLoad
}
BKE_sequencer_sort(scene);
- seq_update_muting(ed);
+ BKE_sequencer_update_muting(ed);
WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene);
@@ -567,7 +568,7 @@ static int sequencer_add_generic_strip_exec(bContext *C, wmOperator *op, SeqLoad
/* add movie operator */
static int sequencer_add_movie_strip_exec(bContext *C, wmOperator *op)
{
- return sequencer_add_generic_strip_exec(C, op, sequencer_add_movie_strip);
+ return sequencer_add_generic_strip_exec(C, op, BKE_sequencer_add_movie_strip);
}
@@ -613,7 +614,8 @@ void SEQUENCER_OT_movie_strip_add(struct wmOperatorType *ot)
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
- WM_operator_properties_filesel(ot, FOLDERFILE | MOVIEFILE, FILE_SPECIAL, FILE_OPENFILE, WM_FILESEL_FILEPATH | WM_FILESEL_RELPATH | WM_FILESEL_FILES, FILE_DEFAULTDISPLAY);
+ WM_operator_properties_filesel(ot, FOLDERFILE | MOVIEFILE, FILE_SPECIAL, FILE_OPENFILE,
+ WM_FILESEL_FILEPATH | WM_FILESEL_RELPATH | WM_FILESEL_FILES, FILE_DEFAULTDISPLAY);
sequencer_generic_props__internal(ot, SEQPROP_STARTFRAME);
RNA_def_boolean(ot->srna, "sound", TRUE, "Sound", "Load sound with the movie");
}
@@ -622,7 +624,7 @@ void SEQUENCER_OT_movie_strip_add(struct wmOperatorType *ot)
static int sequencer_add_sound_strip_exec(bContext *C, wmOperator *op)
{
- return sequencer_add_generic_strip_exec(C, op, sequencer_add_sound_strip);
+ return sequencer_add_generic_strip_exec(C, op, BKE_sequencer_add_sound_strip);
}
static int sequencer_add_sound_strip_invoke(bContext *C, wmOperator *op, wmEvent *event)
@@ -667,7 +669,8 @@ void SEQUENCER_OT_sound_strip_add(struct wmOperatorType *ot)
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
- WM_operator_properties_filesel(ot, FOLDERFILE | SOUNDFILE, FILE_SPECIAL, FILE_OPENFILE, WM_FILESEL_FILEPATH | WM_FILESEL_RELPATH | WM_FILESEL_FILES, FILE_DEFAULTDISPLAY);
+ WM_operator_properties_filesel(ot, FOLDERFILE | SOUNDFILE, FILE_SPECIAL, FILE_OPENFILE,
+ WM_FILESEL_FILEPATH | WM_FILESEL_RELPATH | WM_FILESEL_FILES, FILE_DEFAULTDISPLAY);
sequencer_generic_props__internal(ot, SEQPROP_STARTFRAME);
RNA_def_boolean(ot->srna, "cache", FALSE, "Cache", "Cache the sound in memory");
}
@@ -698,7 +701,7 @@ static int sequencer_add_image_strip_exec(bContext *C, wmOperator *op)
/* main adding function */
- seq = sequencer_add_image_strip(C, ed->seqbasep, &seq_load);
+ seq = BKE_sequencer_add_image_strip(C, ed->seqbasep, &seq_load);
strip = seq->strip;
se = strip->stripdata;
@@ -717,7 +720,7 @@ static int sequencer_add_image_strip_exec(bContext *C, wmOperator *op)
}
}
- calc_sequence_disp(scene, seq);
+ BKE_sequence_calc_disp(scene, seq);
BKE_sequencer_sort(scene);
@@ -725,7 +728,8 @@ static int sequencer_add_image_strip_exec(bContext *C, wmOperator *op)
strncpy(ed->act_imagedir, strip->dir, FILE_MAXDIR - 1);
if (RNA_boolean_get(op->ptr, "overlap") == FALSE) {
- if (seq_test_overlap(ed->seqbasep, seq)) shuffle_seq(ed->seqbasep, seq, scene);
+ if (BKE_sequence_test_overlap(ed->seqbasep, seq))
+ BKE_sequence_base_shuffle(ed->seqbasep, seq, scene);
}
WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene);
@@ -772,7 +776,8 @@ void SEQUENCER_OT_image_strip_add(struct wmOperatorType *ot)
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
- WM_operator_properties_filesel(ot, FOLDERFILE | IMAGEFILE, FILE_SPECIAL, FILE_OPENFILE, WM_FILESEL_DIRECTORY | WM_FILESEL_RELPATH | WM_FILESEL_FILES, FILE_DEFAULTDISPLAY);
+ WM_operator_properties_filesel(ot, FOLDERFILE | IMAGEFILE, FILE_SPECIAL, FILE_OPENFILE,
+ WM_FILESEL_DIRECTORY | WM_FILESEL_RELPATH | WM_FILESEL_FILES, FILE_DEFAULTDISPLAY);
sequencer_generic_props__internal(ot, SEQPROP_STARTFRAME | SEQPROP_ENDFRAME);
}
@@ -811,13 +816,13 @@ static int sequencer_add_effect_strip_exec(bContext *C, wmOperator *op)
return OPERATOR_CANCELLED;
}
- seq = alloc_sequence(ed->seqbasep, start_frame, channel);
+ seq = BKE_sequence_alloc(ed->seqbasep, start_frame, channel);
seq->type = type;
- BLI_strncpy(seq->name + 2, give_seqname(seq), sizeof(seq->name) - 2);
- seqbase_unique_name_recursive(&ed->seqbase, seq);
+ BLI_strncpy(seq->name + 2, BKE_sequence_give_name(seq), sizeof(seq->name) - 2);
+ BKE_seqence_base_unique_name_recursive(&ed->seqbase, seq);
- sh = get_sequence_effect(seq);
+ sh = BKE_sequence_get_effect(seq);
seq->seq1 = seq1;
seq->seq2 = seq2;
@@ -827,12 +832,12 @@ static int sequencer_add_effect_strip_exec(bContext *C, wmOperator *op)
if (!seq1) { /* effect has no deps */
seq->len = 1;
- seq_tx_set_final_right(seq, end_frame);
+ BKE_sequence_tx_set_final_right(seq, end_frame);
}
seq->flag |= SEQ_USE_EFFECT_DEFAULT_FADE;
- calc_sequence(scene, seq);
+ BKE_sequence_calc(scene, seq);
/* basic defaults */
seq->strip = strip = MEM_callocN(sizeof(Strip), "strip");
@@ -861,10 +866,10 @@ static int sequencer_add_effect_strip_exec(bContext *C, wmOperator *op)
}
if (RNA_boolean_get(op->ptr, "overlap") == FALSE) {
- if (seq_test_overlap(ed->seqbasep, seq)) shuffle_seq(ed->seqbasep, seq, scene);
+ if (BKE_sequence_test_overlap(ed->seqbasep, seq)) BKE_sequence_base_shuffle(ed->seqbasep, seq, scene);
}
- update_changed_seq_and_deps(scene, seq, 1, 1); /* runs calc_sequence */
+ BKE_sequencer_update_changed_seq_and_deps(scene, seq, 1, 1); /* runs calc_sequence */
/* not sure if this is needed with update_changed_seq_and_deps.
@@ -902,7 +907,7 @@ static int sequencer_add_effect_strip_invoke(bContext *C, wmOperator *op, wmEven
* skip initializing the channel from the mouse.
* Instead leave the property unset so exec() initializes it to be
* above the strips its applied to. */
- if (get_sequence_effect_num_inputs(type) != 0) {
+ if (BKE_sequence_effect_get_num_inputs(type) != 0) {
prop_flag |= SEQPROP_NOCHAN;
}
}
@@ -928,7 +933,8 @@ void SEQUENCER_OT_effect_strip_add(struct wmOperatorType *ot)
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
- WM_operator_properties_filesel(ot, 0, FILE_SPECIAL, FILE_OPENFILE, WM_FILESEL_FILEPATH | WM_FILESEL_RELPATH, FILE_DEFAULTDISPLAY);
+ WM_operator_properties_filesel(ot, 0, FILE_SPECIAL, FILE_OPENFILE,
+ WM_FILESEL_FILEPATH | WM_FILESEL_RELPATH, FILE_DEFAULTDISPLAY);
sequencer_generic_props__internal(ot, SEQPROP_STARTFRAME | SEQPROP_ENDFRAME);
RNA_def_enum(ot->srna, "type", sequencer_prop_effect_types, SEQ_TYPE_CROSS, "Type", "Sequencer effect type");
RNA_def_float_vector(ot->srna, "color", 3, NULL, 0.0f, 1.0f, "Color", "Initialize the strip with this color (only used when type='COLOR')", 0.0f, 1.0f);
diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c
index eae22858536..c3d74667349 100644
--- a/source/blender/editors/space_sequencer/sequencer_draw.c
+++ b/source/blender/editors/space_sequencer/sequencer_draw.c
@@ -375,7 +375,7 @@ static void draw_seq_handle(View2D *v2d, Sequence *seq, const float handsize_cla
/* draw! */
if (seq->type < SEQ_TYPE_EFFECT ||
- get_sequence_effect_num_inputs(seq->type) == 0)
+ BKE_sequence_effect_get_num_inputs(seq->type) == 0)
{
glEnable(GL_BLEND);
@@ -437,7 +437,7 @@ static void draw_seq_extensions(Scene *scene, ARegion *ar, Sequence *seq)
y1 = seq->machine + SEQ_STRIP_OFSBOTTOM;
y2 = seq->machine + SEQ_STRIP_OFSTOP;
- pixely = (v2d->cur.ymax - v2d->cur.ymin) / (v2d->mask.ymax - v2d->mask.ymin);
+ pixely = BLI_RCT_SIZE_Y(&v2d->cur) / BLI_RCT_SIZE_Y(&v2d->mask);
if (pixely <= 0) return; /* can happen when the view is split/resized */
@@ -545,7 +545,7 @@ static void draw_seq_text(View2D *v2d, Sequence *seq, float x1, float x2, float
/* note, all strings should include 'name' */
if (name[0] == '\0')
- name = give_seqname(seq);
+ name = BKE_sequence_give_name(seq);
if (seq->type == SEQ_TYPE_META || seq->type == SEQ_TYPE_ADJUSTMENT) {
BLI_snprintf(str, sizeof(str), "%s | %d", name, seq->len);
@@ -700,7 +700,7 @@ static void draw_seq_strip(Scene *scene, ARegion *ar, Sequence *seq, int outline
const float handsize_clamped = draw_seq_handle_size_get_clamped(seq, pixelx);
/* we need to know if this is a single image/color or not for drawing */
- is_single_image = (char)seq_single_check(seq);
+ is_single_image = (char)BKE_sequence_single_check(seq);
/* body */
x1 = (seq->startstill) ? seq->start : seq->startdisp;
@@ -715,7 +715,9 @@ static void draw_seq_strip(Scene *scene, ARegion *ar, Sequence *seq, int outline
/* draw the main strip body */
if (is_single_image) { /* single image */
- draw_shadedstrip(seq, background_col, seq_tx_get_final_left(seq, 0), y1, seq_tx_get_final_right(seq, 0), y2);
+ draw_shadedstrip(seq, background_col,
+ BKE_sequence_tx_get_final_left(seq, 0), y1,
+ BKE_sequence_tx_get_final_right(seq, 0), y2);
}
else { /* normal operation */
draw_shadedstrip(seq, background_col, x1, y1, x2, y2);
@@ -734,7 +736,7 @@ static void draw_seq_strip(Scene *scene, ARegion *ar, Sequence *seq, int outline
/* draw sound wave */
if (seq->type == SEQ_TYPE_SOUND_RAM) {
- drawseqwave(scene, seq, x1, y1, x2, y2, (ar->v2d.cur.xmax - ar->v2d.cur.xmin) / ar->winx);
+ drawseqwave(scene, seq, x1, y1, x2, y2, BLI_RCT_SIZE_X(&ar->v2d.cur) / ar->winx);
}
/* draw lock */
@@ -756,6 +758,17 @@ static void draw_seq_strip(Scene *scene, ARegion *ar, Sequence *seq, int outline
glDisable(GL_BLEND);
}
+ if (!BKE_seqence_is_valid_check(seq)) {
+ glEnable(GL_POLYGON_STIPPLE);
+
+ /* panic! */
+ gpuCurrentColor4ub(255, 0, 0, 255);
+ glPolygonStipple(stipple_diag_stripes_pos);
+ glRectf(x1, y1, x2, y2);
+
+ glDisable(GL_POLYGON_STIPPLE);
+ }
+
get_seq_color3ubv(scene, seq, col);
if (G.moving && (seq->flag & SELECT)) {
if (seq->flag & SEQ_OVERLAP) {
@@ -813,7 +826,7 @@ static void UNUSED_FUNCTION(set_special_seq_update) (int val)
else special_seq_update = NULL;
}
-void draw_image_seq(const bContext *C, Scene *scene, ARegion *ar, SpaceSeq *sseq, int cfra, int frame_ofs)
+void draw_image_seq(const bContext *C, Scene *scene, ARegion *ar, SpaceSeq *sseq, int cfra, int frame_ofs, int draw_overlay)
{
struct Main *bmain = CTX_data_main(C);
struct ImBuf *ibuf = NULL;
@@ -851,7 +864,7 @@ void draw_image_seq(const bContext *C, Scene *scene, ARegion *ar, SpaceSeq *sseq
viewrecty /= proxy_size / 100.0f;
}
- if (frame_ofs == 0) {
+ if (!draw_overlay || sseq->overlay_type == SEQ_DRAW_OVERLAY_REFERENCE) {
UI_GetThemeColor3fv(TH_SEQ_PREVIEW, col);
gpuColorAndClearvf(col, 0.0);
}
@@ -863,17 +876,17 @@ void draw_image_seq(const bContext *C, Scene *scene, ARegion *ar, SpaceSeq *sseq
UI_view2d_curRect_validate(v2d);
/* only initialize the preview if a render is in progress */
- if (G.rendering)
+ if (G.is_rendering)
return;
- context = seq_new_render_data(bmain, scene, rectx, recty, proxy_size);
+ context = BKE_sequencer_new_render_data(bmain, scene, rectx, recty, proxy_size);
if (special_seq_update)
- ibuf = give_ibuf_seq_direct(context, cfra + frame_ofs, 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) {
- ibuf = give_ibuf_seq(context, cfra + frame_ofs, sseq->chanshown);
+ ibuf = BKE_sequencer_give_ibuf(context, cfra + frame_ofs, sseq->chanshown);
else
- ibuf = give_ibuf_seq_threaded(context, cfra + frame_ofs, sseq->chanshown);
+ ibuf = BKE_sequencer_give_ibuf_threaded(context, cfra + frame_ofs, sseq->chanshown);
if (ibuf == NULL)
return;
@@ -927,17 +940,25 @@ void draw_image_seq(const bContext *C, Scene *scene, ARegion *ar, SpaceSeq *sseq
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, ibuf->x, ibuf->y, 0, GL_RGBA, GL_UNSIGNED_BYTE, ibuf->rect);
gpuBegin(GL_QUADS);
- if (frame_ofs) {
- rctf tot_clip;
- tot_clip.xmin = v2d->tot.xmin + (ABS(v2d->tot.xmax - v2d->tot.xmin) * scene->ed->over_border.xmin);
- tot_clip.ymin = v2d->tot.ymin + (ABS(v2d->tot.ymax - v2d->tot.ymin) * scene->ed->over_border.ymin);
- tot_clip.xmax = v2d->tot.xmin + (ABS(v2d->tot.xmax - v2d->tot.xmin) * scene->ed->over_border.xmax);
- tot_clip.ymax = v2d->tot.ymin + (ABS(v2d->tot.ymax - v2d->tot.ymin) * scene->ed->over_border.ymax);
-
- gpuTexCoord2f(scene->ed->over_border.xmin, scene->ed->over_border.ymin); gpuVertex2f(tot_clip.xmin, tot_clip.ymin);
- gpuTexCoord2f(scene->ed->over_border.xmin, scene->ed->over_border.ymax); gpuVertex2f(tot_clip.xmin, tot_clip.ymax);
- gpuTexCoord2f(scene->ed->over_border.xmax, scene->ed->over_border.ymax); gpuVertex2f(tot_clip.xmax, tot_clip.ymax);
- gpuTexCoord2f(scene->ed->over_border.xmax, scene->ed->over_border.ymin); gpuVertex2f(tot_clip.xmax, tot_clip.ymin);
+ if (draw_overlay) {
+ if (sseq->overlay_type == SEQ_DRAW_OVERLAY_RECT) {
+ rctf tot_clip;
+ tot_clip.xmin = v2d->tot.xmin + (ABS(BLI_RCT_SIZE_X(&v2d->tot)) * scene->ed->over_border.xmin);
+ tot_clip.ymin = v2d->tot.ymin + (ABS(BLI_RCT_SIZE_Y(&v2d->tot)) * scene->ed->over_border.ymin);
+ tot_clip.xmax = v2d->tot.xmin + (ABS(BLI_RCT_SIZE_X(&v2d->tot)) * scene->ed->over_border.xmax);
+ tot_clip.ymax = v2d->tot.ymin + (ABS(BLI_RCT_SIZE_Y(&v2d->tot)) * scene->ed->over_border.ymax);
+
+ gpuTexCoord2f(scene->ed->over_border.xmin, scene->ed->over_border.ymin); gpuVertex2f(tot_clip.xmin, tot_clip.ymin);
+ gpuTexCoord2f(scene->ed->over_border.xmin, scene->ed->over_border.ymax); gpuVertex2f(tot_clip.xmin, tot_clip.ymax);
+ gpuTexCoord2f(scene->ed->over_border.xmax, scene->ed->over_border.ymax); gpuVertex2f(tot_clip.xmax, tot_clip.ymax);
+ gpuTexCoord2f(scene->ed->over_border.xmax, scene->ed->over_border.ymin); gpuVertex2f(tot_clip.xmax, tot_clip.ymin);
+ }
+ else if (sseq->overlay_type == SEQ_DRAW_OVERLAY_REFERENCE) {
+ gpuTexCoord2f(0.0f, 0.0f); gpuVertex2f(v2d->tot.xmin, v2d->tot.ymin);
+ gpuTexCoord2f(0.0f, 1.0f); gpuVertex2f(v2d->tot.xmin, v2d->tot.ymax);
+ gpuTexCoord2f(1.0f, 1.0f); gpuVertex2f(v2d->tot.xmax, v2d->tot.ymax);
+ gpuTexCoord2f(1.0f, 0.0f); gpuVertex2f(v2d->tot.xmax, v2d->tot.ymin);
+ }
}
else {
gpuTexCoord2f(0.0f, 0.0f); gpuVertex2f(v2d->tot.xmin, v2d->tot.ymin);
@@ -1004,55 +1025,28 @@ void draw_image_seq(const bContext *C, Scene *scene, ARegion *ar, SpaceSeq *sseq
/* draw grease-pencil (screen aligned) */
draw_gpencil_view2d(C, 0);
- //if (sc->mode == SC_MODE_MASKEDIT) {
- if (sseq->mainb == SEQ_DRAW_IMG_IMBUF) {
- Sequence *seq_act = BKE_sequencer_active_get(scene);
-
- if (seq_act && seq_act->type == SEQ_TYPE_MASK && seq_act->mask) {
- int x, y;
- int width, height;
- float zoomx, zoomy;
-
- /* frame image */
- float maxdim;
- float xofs, yofs;
- /* find window pixel coordinates of origin */
- UI_view2d_to_region_no_clip(&ar->v2d, 0.0f, 0.0f, &x, &y);
- width = v2d->tot.xmax - v2d->tot.xmin;
- height = v2d->tot.ymax - v2d->tot.ymin;
+ /* NOTE: sequencer mask editing isnt finished, the draw code is working but editing not,
+ * for now just disable drawing since the strip frame will likely be offset */
- zoomx = (float)(ar->winrct.xmax - ar->winrct.xmin + 1) / (float)((ar->v2d.cur.xmax - ar->v2d.cur.xmin));
- zoomy = (float)(ar->winrct.ymax - ar->winrct.ymin + 1) / (float)((ar->v2d.cur.ymax - ar->v2d.cur.ymin));
-
- x += v2d->tot.xmin * zoomx;
- y += v2d->tot.ymin * zoomy;
-
- /* frame the image */
- maxdim = maxf(width, height);
- if (width == height) {
- xofs = yofs = 0;
- }
- else if (width < height) {
- xofs = ((height - width) / -2.0f) * zoomx;
- yofs = 0.0f;
- }
- else { /* (width > height) */
- xofs = 0.0f;
- yofs = ((width - height) / -2.0f) * zoomy;
- }
-
- /* apply transformation so mask editing tools will assume drawing from the origin in normalized space */
- gpuPushMatrix();
- gpuTranslate(x + xofs, y + yofs, 0);
- gpuScale(maxdim * zoomx, maxdim * zoomy, 0);
+ //if (sc->mode == SC_MODE_MASKEDIT) {
+ if (0 && sseq->mainb == SEQ_DRAW_IMG_IMBUF) {
+ Mask *mask = BKE_sequencer_mask_get(scene);
- ED_mask_draw((bContext *)C, 0, 0); // sc->mask_draw_flag, sc->mask_draw_type
+ if (mask) {
+ int width, height;
+ // ED_mask_get_size(C, &width, &height);
- ED_region_draw_cb_draw(C, ar, REGION_DRAW_POST_VIEW);
+ //Scene *scene = CTX_data_scene(C);
+ width = (scene->r.size * scene->r.xsch) / 100;
+ height = (scene->r.size * scene->r.ysch) / 100;
- gpuPopMatrix();
+ ED_mask_draw_region(mask, ar,
+ 0, 0, /* TODO */
+ width, height,
+ FALSE, TRUE,
+ NULL, C);
}
}
@@ -1097,7 +1091,7 @@ static void draw_seq_backdrop(View2D *v2d)
gpuDrawFilledRectf(v2d->cur.xmin, -1.0, v2d->cur.xmax, 1.0);
/* Alternating horizontal stripes */
- i = MAX2(1, ((int)v2d->cur.ymin) - 1);
+ i = maxi(1, ((int)v2d->cur.ymin) - 1);
gpuBegin(GL_QUADS);
while (i < v2d->cur.ymax) {
@@ -1116,7 +1110,7 @@ static void draw_seq_backdrop(View2D *v2d)
gpuEnd();
/* Darker lines separating the horizontal bands */
- i = MAX2(1, ((int)v2d->cur.ymin) - 1);
+ i = maxi(1, ((int)v2d->cur.ymin) - 1);
UI_ThemeColor(TH_GRID);
gpuBegin(GL_LINES);
@@ -1138,7 +1132,7 @@ static void draw_seq_strips(const bContext *C, Editing *ed, ARegion *ar)
View2D *v2d = &ar->v2d;
Sequence *last_seq = BKE_sequencer_active_get(scene);
int sel = 0, j;
- float pixelx = (v2d->cur.xmax - v2d->cur.xmin) / (v2d->mask.xmax - v2d->mask.xmin);
+ float pixelx = BLI_RCT_SIZE_X(&v2d->cur) / BLI_RCT_SIZE_X(&v2d->mask);
/* loop through twice, first unselected, then selected */
for (j = 0; j < 2; j++) {
diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c
index 82e2730c59e..2dc26a9d5b8 100644
--- a/source/blender/editors/space_sequencer/sequencer_edit.c
+++ b/source/blender/editors/space_sequencer/sequencer_edit.c
@@ -151,7 +151,7 @@ static void proxy_startjob(void *pjv, short *stop, short *do_update, float *prog
for (link = pj->queue.first; link; link = link->next) {
struct SeqIndexBuildContext *context = link->data;
- seq_proxy_rebuild(context, stop, do_update, progress);
+ BKE_sequencer_proxy_rebuild(context, stop, do_update, progress);
}
if (*stop) {
@@ -167,17 +167,17 @@ static void proxy_endjob(void *pjv)
LinkData *link;
for (link = pj->queue.first; link; link = link->next) {
- seq_proxy_rebuild_finish(link->data, pj->stop);
+ BKE_sequencer_proxy_rebuild_finish(link->data, pj->stop);
}
- free_imbuf_seq(pj->scene, &ed->seqbase, FALSE, FALSE);
+ BKE_sequencer_free_imbuf(pj->scene, &ed->seqbase, FALSE, FALSE);
WM_main_add_notifier(NC_SCENE | ND_SEQUENCER, pj->scene);
}
static void seq_proxy_build_job(const bContext *C)
{
- wmJob *steve;
+ wmJob *wm_job;
ProxyJob *pj;
Scene *scene = CTX_data_scene(C);
Editing *ed = BKE_sequencer_editing_get(scene, FALSE);
@@ -186,9 +186,10 @@ static void seq_proxy_build_job(const bContext *C)
LinkData *link;
Sequence *seq;
- steve = WM_jobs_get(CTX_wm_manager(C), CTX_wm_window(C), sa, "Building Proxies", WM_JOB_PROGRESS);
+ wm_job = WM_jobs_get(CTX_wm_manager(C), CTX_wm_window(C), sa, "Building Proxies",
+ WM_JOB_PROGRESS, WM_JOB_TYPE_SEQ_BUILD_PROXY);
- pj = WM_jobs_get_customdata(steve);
+ pj = WM_jobs_customdata_get(wm_job);
if (!pj) {
pj = MEM_callocN(sizeof(ProxyJob), "proxy rebuild job");
@@ -196,24 +197,24 @@ static void seq_proxy_build_job(const bContext *C)
pj->scene = scene;
pj->main = CTX_data_main(C);
- WM_jobs_customdata(steve, pj, proxy_freejob);
- WM_jobs_timer(steve, 0.1, NC_SCENE | ND_SEQUENCER, NC_SCENE | ND_SEQUENCER);
- WM_jobs_callbacks(steve, proxy_startjob, NULL, NULL, proxy_endjob);
+ WM_jobs_customdata_set(wm_job, pj, proxy_freejob);
+ WM_jobs_timer(wm_job, 0.1, NC_SCENE | ND_SEQUENCER, NC_SCENE | ND_SEQUENCER);
+ WM_jobs_callbacks(wm_job, proxy_startjob, NULL, NULL, proxy_endjob);
}
SEQP_BEGIN (ed, seq)
{
if ((seq->flag & SELECT)) {
- context = seq_proxy_rebuild_context(pj->main, pj->scene, seq);
+ context = BKE_sequencer_proxy_rebuild_context(pj->main, pj->scene, seq);
link = BLI_genericNodeN(context);
BLI_addtail(&pj->queue, link);
}
}
SEQ_END
- if (!WM_jobs_is_running(steve)) {
- G.afbreek = 0;
- WM_jobs_start(CTX_wm_manager(C), steve);
+ if (!WM_jobs_is_running(wm_job)) {
+ G.is_break = FALSE;
+ WM_jobs_start(CTX_wm_manager(C), wm_job);
}
ED_area_tag_redraw(CTX_wm_area(C));
@@ -371,7 +372,7 @@ Sequence *find_nearest_seq(Scene *scene, View2D *v2d, int *hand, const int mval[
if (ed == NULL) return NULL;
- pixelx = (v2d->cur.xmax - v2d->cur.xmin) / (v2d->mask.xmax - v2d->mask.xmin);
+ pixelx = BLI_RCT_SIZE_X(&v2d->cur) / BLI_RCT_SIZE_X(&v2d->mask);
UI_view2d_region_to_view(v2d, mval[0], mval[1], &x, &y);
@@ -383,7 +384,7 @@ Sequence *find_nearest_seq(Scene *scene, View2D *v2d, int *hand, const int mval[
if ( ((seq->startdisp < seq->enddisp) && (seq->startdisp <= x && seq->enddisp >= x)) ||
((seq->startdisp > seq->enddisp) && (seq->startdisp >= x && seq->enddisp <= x)) )
{
- if (seq_tx_test(seq)) {
+ if (BKE_sequence_tx_test(seq)) {
/* clamp handles to defined size in pixel space */
@@ -466,6 +467,33 @@ void recurs_sel_seq(Sequence *seqm)
}
}
+int ED_space_sequencer_maskedit_mask_poll(bContext *C)
+{
+ /* in this case both funcs are the same, for clip editor not */
+ return ED_space_sequencer_maskedit_poll(C);
+}
+
+int ED_space_sequencer_check_show_maskedit(SpaceSeq *sseq, Scene *scene)
+{
+ if (sseq && sseq->mainb == SEQ_DRAW_IMG_IMBUF) {
+ return (BKE_sequencer_mask_get(scene) != NULL);
+ }
+
+ return FALSE;
+}
+
+int ED_space_sequencer_maskedit_poll(bContext *C)
+{
+ SpaceSeq *sseq = CTX_wm_space_seq(C);
+
+ if (sseq) {
+ Scene *scene = CTX_data_scene(C);
+ return ED_space_sequencer_check_show_maskedit(sseq, scene);
+ }
+
+ return FALSE;
+}
+
int seq_effect_find_selected(Scene *scene, Sequence *activeseq, int type, Sequence **selseq1, Sequence **selseq2, Sequence **selseq3, const char **error_str)
{
Editing *ed = BKE_sequencer_editing_get(scene, FALSE);
@@ -478,7 +506,7 @@ int seq_effect_find_selected(Scene *scene, Sequence *activeseq, int type, Sequen
for (seq = ed->seqbasep->first; seq; seq = seq->next) {
if (seq->flag & SELECT) {
- if (seq->type == SEQ_TYPE_SOUND_RAM && get_sequence_effect_num_inputs(type) != 0) {
+ if (seq->type == SEQ_TYPE_SOUND_RAM && BKE_sequence_effect_get_num_inputs(type) != 0) {
*error_str = "Can't apply effects to audio sequence strips";
return 0;
}
@@ -503,7 +531,7 @@ int seq_effect_find_selected(Scene *scene, Sequence *activeseq, int type, Sequen
}
- switch (get_sequence_effect_num_inputs(type)) {
+ switch (BKE_sequence_effect_get_num_inputs(type)) {
case 0:
*selseq1 = *selseq2 = *selseq3 = NULL;
return 1; /* succsess */
@@ -557,7 +585,7 @@ static Sequence *del_seq_find_replace_recurs(Scene *scene, Sequence *seq)
seq->seq2 = (seq2) ? seq2 : (seq1) ? seq1 : seq3;
seq->seq3 = (seq3) ? seq3 : (seq1) ? seq1 : seq2;
- update_changed_seq_and_deps(scene, seq, 1, 1);
+ BKE_sequencer_update_changed_seq_and_deps(scene, seq, 1, 1);
}
else
seq->flag |= SELECT; /* mark for delete */
@@ -585,7 +613,7 @@ static void recurs_del_seq_flag(Scene *scene, ListBase *lb, short flag, short de
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);
- seq_free_sequence(scene, seq);
+ BKE_sequence_free(scene, seq);
}
seq = seqn;
}
@@ -642,12 +670,12 @@ static Sequence *cut_seq_hard(Scene *scene, Sequence *seq, int cutframe)
}
}
- reload_sequence_new_file(scene, seq, FALSE);
- calc_sequence(scene, seq);
+ BKE_sequence_reload_new_file(scene, seq, FALSE);
+ BKE_sequence_calc(scene, seq);
if (!skip_dup) {
/* Duplicate AFTER the first change */
- seqn = seq_dupli_recursive(scene, NULL, seq, SEQ_DUPE_UNIQUE_NAME | SEQ_DUPE_ANIM);
+ seqn = BKE_sequence_dupli_recursive(scene, NULL, seq, SEQ_DUPE_UNIQUE_NAME | SEQ_DUPE_ANIM);
}
if (seqn) {
@@ -682,8 +710,8 @@ static Sequence *cut_seq_hard(Scene *scene, Sequence *seq, int cutframe)
seqn->startstill = 0;
}
- reload_sequence_new_file(scene, seqn, FALSE);
- calc_sequence(scene, seqn);
+ BKE_sequence_reload_new_file(scene, seqn, FALSE);
+ BKE_sequence_calc(scene, seqn);
}
return seqn;
}
@@ -736,11 +764,11 @@ static Sequence *cut_seq_soft(Scene *scene, Sequence *seq, int cutframe)
}
}
- calc_sequence(scene, seq);
+ BKE_sequence_calc(scene, seq);
if (!skip_dup) {
/* Duplicate AFTER the first change */
- seqn = seq_dupli_recursive(scene, NULL, seq, SEQ_DUPE_UNIQUE_NAME | SEQ_DUPE_ANIM);
+ seqn = BKE_sequence_dupli_recursive(scene, NULL, seq, SEQ_DUPE_UNIQUE_NAME | SEQ_DUPE_ANIM);
}
if (seqn) {
@@ -771,7 +799,7 @@ static Sequence *cut_seq_soft(Scene *scene, Sequence *seq, int cutframe)
seqn->startstill = 0;
}
- calc_sequence(scene, seqn);
+ BKE_sequence_calc(scene, seqn);
}
return seqn;
}
@@ -829,7 +857,7 @@ static int insert_gap(Scene *scene, int gap, int cfra)
{
if (seq->startdisp >= cfra) {
seq->start += gap;
- calc_sequence(scene, seq);
+ BKE_sequence_calc(scene, seq);
done = TRUE;
}
}
@@ -947,11 +975,11 @@ static void UNUSED_FUNCTION(no_gaps) (Scene * scene)
for (cfra = CFRA; cfra <= EFRA; cfra++) {
if (first == 0) {
- if (evaluate_seq_frame(scene, cfra) ) first = 1;
+ if (BKE_sequencer_evaluate_frame(scene, cfra) ) first = 1;
}
else {
done = TRUE;
- while (evaluate_seq_frame(scene, cfra) == 0) {
+ while (BKE_sequencer_evaluate_frame(scene, cfra) == 0) {
done = insert_gap(scene, -1, cfra);
if (done == 0) break;
}
@@ -1022,24 +1050,24 @@ static int sequencer_snap_exec(bContext *C, wmOperator *op)
/* also check metas */
for (seq = ed->seqbasep->first; seq; seq = seq->next) {
if (seq->flag & SELECT && !(seq->depth == 0 && seq->flag & SEQ_LOCK) &&
- seq_tx_test(seq))
+ BKE_sequence_tx_test(seq))
{
if ((seq->flag & (SEQ_LEFTSEL + SEQ_RIGHTSEL)) == 0) {
/* simple but no anim update */
/* seq->start= snap_frame-seq->startofs+seq->startstill; */
- seq_translate(scene, seq, (snap_frame - seq->startofs + seq->startstill) - seq->start);
+ BKE_sequence_translate(scene, seq, (snap_frame - seq->startofs + seq->startstill) - seq->start);
}
else {
if (seq->flag & SEQ_LEFTSEL) {
- seq_tx_set_final_left(seq, snap_frame);
+ BKE_sequence_tx_set_final_left(seq, snap_frame);
}
else { /* SEQ_RIGHTSEL */
- seq_tx_set_final_right(seq, snap_frame);
+ BKE_sequence_tx_set_final_right(seq, snap_frame);
}
- seq_tx_handle_xlimits(seq, seq->flag & SEQ_LEFTSEL, seq->flag & SEQ_RIGHTSEL);
+ BKE_sequence_tx_handle_xlimits(seq, seq->flag & SEQ_LEFTSEL, seq->flag & SEQ_RIGHTSEL);
}
- calc_sequence(scene, seq);
+ BKE_sequence_calc(scene, seq);
}
}
@@ -1048,17 +1076,17 @@ static int sequencer_snap_exec(bContext *C, wmOperator *op)
for (seq = ed->seqbasep->first; seq; seq = seq->next) {
if (seq->flag & SELECT && !(seq->depth == 0 && seq->flag & SEQ_LOCK)) {
seq->flag &= ~SEQ_OVERLAP;
- if (seq_test_overlap(ed->seqbasep, seq) ) {
- shuffle_seq(ed->seqbasep, seq, scene);
+ if (BKE_sequence_test_overlap(ed->seqbasep, seq) ) {
+ BKE_sequence_base_shuffle(ed->seqbasep, seq, scene);
}
}
else if (seq->type & SEQ_TYPE_EFFECT) {
if (seq->seq1 && (seq->seq1->flag & SELECT))
- calc_sequence(scene, seq);
+ BKE_sequence_calc(scene, seq);
else if (seq->seq2 && (seq->seq2->flag & SELECT))
- calc_sequence(scene, seq);
+ BKE_sequence_calc(scene, seq);
else if (seq->seq3 && (seq->seq3->flag & SELECT))
- calc_sequence(scene, seq);
+ BKE_sequence_calc(scene, seq);
}
}
@@ -1123,7 +1151,7 @@ static int sequencer_mute_exec(bContext *C, wmOperator *op)
}
}
- seq_update_muting(ed);
+ BKE_sequencer_update_muting(ed);
WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene);
return OPERATOR_FINISHED;
@@ -1170,7 +1198,7 @@ static int sequencer_unmute_exec(bContext *C, wmOperator *op)
}
}
- seq_update_muting(ed);
+ BKE_sequencer_update_muting(ed);
WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene);
return OPERATOR_FINISHED;
@@ -1270,12 +1298,12 @@ static int sequencer_reload_exec(bContext *C, wmOperator *op)
for (seq = ed->seqbasep->first; seq; seq = seq->next) {
if (seq->flag & SELECT) {
- update_changed_seq_and_deps(scene, seq, 0, 1);
- reload_sequence_new_file(scene, seq, !adjust_length);
+ BKE_sequencer_update_changed_seq_and_deps(scene, seq, 0, 1);
+ BKE_sequence_reload_new_file(scene, seq, !adjust_length);
if (adjust_length) {
- if (seq_test_overlap(ed->seqbasep, seq))
- shuffle_seq(ed->seqbasep, seq, scene);
+ if (BKE_sequence_test_overlap(ed->seqbasep, seq))
+ BKE_sequence_base_shuffle(ed->seqbasep, seq, scene);
}
}
}
@@ -1312,7 +1340,7 @@ static int sequencer_refresh_all_exec(bContext *C, wmOperator *UNUSED(op))
Scene *scene = CTX_data_scene(C);
Editing *ed = BKE_sequencer_editing_get(scene, FALSE);
- free_imbuf_seq(scene, &ed->seqbase, FALSE, FALSE);
+ BKE_sequencer_free_imbuf(scene, &ed->seqbase, FALSE, FALSE);
WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene);
@@ -1354,7 +1382,7 @@ static int sequencer_reassign_inputs_exec(bContext *C, wmOperator *op)
last_seq->seq2 = seq2;
last_seq->seq3 = seq3;
- update_changed_seq_and_deps(scene, last_seq, 1, 1);
+ BKE_sequencer_update_changed_seq_and_deps(scene, last_seq, 1, 1);
WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene);
@@ -1406,7 +1434,7 @@ static int sequencer_swap_inputs_exec(bContext *C, wmOperator *op)
last_seq->seq1 = last_seq->seq2;
last_seq->seq2 = seq;
- update_changed_seq_and_deps(scene, last_seq, 1, 1);
+ BKE_sequencer_update_changed_seq_and_deps(scene, last_seq, 1, 1);
WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene);
@@ -1537,8 +1565,8 @@ static int apply_unique_name_cb(Sequence *seq, void *arg_pt)
char name[sizeof(seq->name) - 2];
strcpy(name, seq->name + 2);
- seqbase_unique_name_recursive(&scene->ed->seqbase, seq);
- seq_dupe_animdata(scene, name, seq->name + 2);
+ BKE_seqence_base_unique_name_recursive(&scene->ed->seqbase, seq);
+ BKE_sequencer_dupe_animdata(scene, name, seq->name + 2);
return 1;
}
@@ -1553,7 +1581,7 @@ static int sequencer_add_duplicate_exec(bContext *C, wmOperator *UNUSED(op))
if (ed == NULL)
return OPERATOR_CANCELLED;
- seqbase_dupli_recursive(scene, NULL, &nseqbase, ed->seqbasep, SEQ_DUPE_CONTEXT);
+ BKE_sequence_base_dupli_recursive(scene, NULL, &nseqbase, ed->seqbasep, SEQ_DUPE_CONTEXT);
if (nseqbase.first) {
Sequence *seq = nseqbase.first;
@@ -1561,7 +1589,7 @@ static int sequencer_add_duplicate_exec(bContext *C, wmOperator *UNUSED(op))
BLI_movelisttolist(ed->seqbasep, &nseqbase);
for (; seq; seq = seq->next)
- seq_recursive_apply(seq, apply_unique_name_cb, scene);
+ BKE_sequencer_recursive_apply(seq, apply_unique_name_cb, scene);
WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene);
return OPERATOR_FINISHED;
@@ -1624,14 +1652,14 @@ static int sequencer_delete_exec(bContext *C, wmOperator *UNUSED(op))
/* updates lengths etc */
seq = ed->seqbasep->first;
while (seq) {
- calc_sequence(scene, seq);
+ BKE_sequence_calc(scene, seq);
seq = seq->next;
}
/* free parent metas */
ms = ed->metastack.last;
while (ms) {
- calc_sequence(scene, ms->parseq);
+ BKE_sequence_calc(scene, ms->parseq);
ms = ms->prev;
}
@@ -1676,14 +1704,14 @@ static int sequencer_offset_clear_exec(bContext *C, wmOperator *UNUSED(op))
/* updates lengths etc */
seq = ed->seqbasep->first;
while (seq) {
- calc_sequence(scene, seq);
+ BKE_sequence_calc(scene, seq);
seq = seq->next;
}
for (seq = ed->seqbasep->first; seq; seq = seq->next) {
if ((seq->type & SEQ_TYPE_EFFECT) == 0 && (seq->flag & SELECT)) {
- if (seq_test_overlap(ed->seqbasep, seq)) {
- shuffle_seq(ed->seqbasep, seq, scene);
+ if (BKE_sequence_test_overlap(ed->seqbasep, seq)) {
+ BKE_sequence_base_shuffle(ed->seqbasep, seq, scene);
}
}
}
@@ -1733,14 +1761,14 @@ static int sequencer_separate_images_exec(bContext *C, wmOperator *op)
/* if (seq->ipo) seq->ipo->id.us--; */
/* XXX, remove fcurve and assign to split image strips */
- start_ofs = cfra = seq_tx_get_final_left(seq, 0);
- frame_end = seq_tx_get_final_right(seq, 0);
+ start_ofs = cfra = BKE_sequence_tx_get_final_left(seq, 0);
+ frame_end = BKE_sequence_tx_get_final_right(seq, 0);
while (cfra < frame_end) {
/* new seq */
- se = give_stripelem(seq, cfra);
+ se = BKE_sequencer_give_stripelem(seq, cfra);
- seq_new = seq_dupli_recursive(scene, scene, seq, SEQ_DUPE_UNIQUE_NAME);
+ seq_new = BKE_sequence_dupli_recursive(scene, scene, seq, SEQ_DUPE_UNIQUE_NAME);
BLI_addtail(ed->seqbasep, seq_new);
seq_new->start = start_ofs;
@@ -1755,12 +1783,12 @@ static int sequencer_separate_images_exec(bContext *C, wmOperator *op)
/* new stripdata */
se_new = strip_new->stripdata;
BLI_strncpy(se_new->name, se->name, sizeof(se_new->name));
- calc_sequence(scene, seq_new);
+ BKE_sequence_calc(scene, seq_new);
if (step > 1) {
seq_new->flag &= ~SEQ_OVERLAP;
- if (seq_test_overlap(ed->seqbasep, seq_new)) {
- shuffle_seq(ed->seqbasep, seq_new, scene);
+ if (BKE_sequence_test_overlap(ed->seqbasep, seq_new)) {
+ BKE_sequence_base_shuffle(ed->seqbasep, seq_new, scene);
}
}
@@ -1770,7 +1798,7 @@ static int sequencer_separate_images_exec(bContext *C, wmOperator *op)
start_ofs += step;
}
- seq_free_sequence(scene, seq);
+ BKE_sequence_free(scene, seq);
seq = seq->next;
}
else {
@@ -1842,7 +1870,7 @@ 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)
- calc_sequence(scene, seq);
+ BKE_sequence_calc(scene, seq);
BKE_sequencer_active_set(scene, ms->parseq);
@@ -1853,7 +1881,7 @@ static int sequencer_meta_toggle_exec(bContext *C, wmOperator *UNUSED(op))
}
- seq_update_muting(ed);
+ BKE_sequencer_update_muting(ed);
WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene);
return OPERATOR_FINISHED;
@@ -1884,14 +1912,14 @@ static int sequencer_meta_make_exec(bContext *C, wmOperator *op)
Sequence *seq, *seqm, *next, *last_seq = BKE_sequencer_active_get(scene);
int channel_max = 1;
- if (seqbase_isolated_sel_check(ed->seqbasep) == FALSE) {
+ if (BKE_sequence_base_isolated_sel_check(ed->seqbasep) == FALSE) {
BKE_report(op->reports, RPT_ERROR, "Please select all related strips");
return OPERATOR_CANCELLED;
}
/* remove all selected from main list, and put in meta */
- seqm = alloc_sequence(ed->seqbasep, 1, 1); /* channel number set later */
+ seqm = BKE_sequence_alloc(ed->seqbasep, 1, 1); /* channel number set later */
strcpy(seqm->name + 2, "MetaStrip");
seqm->type = SEQ_TYPE_META;
seqm->flag = SELECT;
@@ -1907,18 +1935,18 @@ static int sequencer_meta_make_exec(bContext *C, wmOperator *op)
seq = next;
}
seqm->machine = last_seq ? last_seq->machine : channel_max;
- calc_sequence(scene, seqm);
+ BKE_sequence_calc(scene, seqm);
seqm->strip = MEM_callocN(sizeof(Strip), "metastrip");
seqm->strip->us = 1;
BKE_sequencer_active_set(scene, seqm);
- if (seq_test_overlap(ed->seqbasep, seqm) ) shuffle_seq(ed->seqbasep, seqm, scene);
+ if (BKE_sequence_test_overlap(ed->seqbasep, seqm) ) BKE_sequence_base_shuffle(ed->seqbasep, seqm, scene);
- seq_update_muting(ed);
+ BKE_sequencer_update_muting(ed);
- seqbase_unique_name_recursive(&scene->ed->seqbase, seqm);
+ BKE_seqence_base_unique_name_recursive(&scene->ed->seqbase, seqm);
WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene);
@@ -1968,7 +1996,7 @@ static int sequencer_meta_separate_exec(bContext *C, wmOperator *UNUSED(op))
last_seq->seqbase.last = NULL;
BLI_remlink(ed->seqbasep, last_seq);
- seq_free_sequence(scene, last_seq);
+ BKE_sequence_free(scene, last_seq);
/* emtpy meta strip, delete all effects depending on it */
for (seq = ed->seqbasep->first; seq; seq = seq->next)
@@ -1982,14 +2010,14 @@ static int sequencer_meta_separate_exec(bContext *C, wmOperator *UNUSED(op))
for (seq = ed->seqbasep->first; seq; seq = seq->next) {
if (seq->flag & SELECT) {
seq->flag &= ~SEQ_OVERLAP;
- if (seq_test_overlap(ed->seqbasep, seq)) {
- shuffle_seq(ed->seqbasep, seq, scene);
+ if (BKE_sequence_test_overlap(ed->seqbasep, seq)) {
+ BKE_sequence_base_shuffle(ed->seqbasep, seq, scene);
}
}
}
BKE_sequencer_sort(scene);
- seq_update_muting(ed);
+ BKE_sequencer_update_muting(ed);
WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene);
@@ -2015,17 +2043,10 @@ void SEQUENCER_OT_meta_separate(wmOperatorType *ot)
/* view_all operator */
static int sequencer_view_all_exec(bContext *C, wmOperator *UNUSED(op))
{
- //Scene *scene= CTX_data_scene(C);
- bScreen *sc = CTX_wm_screen(C);
- ScrArea *area = CTX_wm_area(C);
- //ARegion *ar= CTX_wm_region(C);
+ ARegion *ar = CTX_wm_region(C);
View2D *v2d = UI_view2d_fromcontext(C);
- v2d->cur = v2d->tot;
- UI_view2d_curRect_validate(v2d);
- UI_view2d_sync(sc, area, v2d, V2D_LOCK_COPY);
-
- ED_area_tag_redraw(CTX_wm_area(C));
+ UI_view2d_smooth_view(C, ar, &v2d->tot);
return OPERATOR_FINISHED;
}
@@ -2084,7 +2105,7 @@ static int sequencer_view_all_preview_exec(bContext *C, wmOperator *UNUSED(op))
zoomY = ((float)height) / ((float)imgheight);
sseq->zoom = (zoomX < zoomY) ? zoomX : zoomY;
- sseq->zoom = 1.0f / power_of_2(1 / MIN2(zoomX, zoomY) );
+ sseq->zoom = 1.0f / power_of_2(1 / minf(zoomX, zoomY));
}
else {
sseq->zoom = 1.0f;
@@ -2113,16 +2134,16 @@ void SEQUENCER_OT_view_all_preview(wmOperatorType *ot)
static int sequencer_view_zoom_ratio_exec(bContext *C, wmOperator *op)
{
- RenderData *r = &CTX_data_scene(C)->r;
+ RenderData *rd = &CTX_data_scene(C)->r;
View2D *v2d = UI_view2d_fromcontext(C);
float ratio = RNA_float_get(op->ptr, "ratio");
- float winx = (int)(r->size * r->xsch) / 100;
- float winy = (int)(r->size * r->ysch) / 100;
+ float winx = (int)(rd->size * rd->xsch) / 100;
+ float winy = (int)(rd->size * rd->ysch) / 100;
- float facx = (v2d->mask.xmax - v2d->mask.xmin) / winx;
- float facy = (v2d->mask.ymax - v2d->mask.ymin) / winy;
+ float facx = BLI_RCT_SIZE_X(&v2d->mask) / winx;
+ float facy = BLI_RCT_SIZE_Y(&v2d->mask) / winy;
BLI_rctf_resize(&v2d->cur, (int)(winx * facx * ratio) + 1, (int)(winy * facy * ratio) + 1);
@@ -2191,10 +2212,10 @@ static int sequencer_view_selected_exec(bContext *C, wmOperator *UNUSED(op))
{
Scene *scene = CTX_data_scene(C);
View2D *v2d = UI_view2d_fromcontext(C);
- ScrArea *area = CTX_wm_area(C);
- bScreen *sc = CTX_wm_screen(C);
+ ARegion *ar = CTX_wm_region(C);
Editing *ed = BKE_sequencer_editing_get(scene, FALSE);
Sequence *seq;
+ rctf cur_new = v2d->cur;
int xmin = MAXFRAME * 2;
int xmax = -MAXFRAME * 2;
@@ -2225,29 +2246,30 @@ static int sequencer_view_selected_exec(bContext *C, wmOperator *UNUSED(op))
ymax += ymargin;
ymin -= ymargin;
- orig_height = v2d->cur.ymax - v2d->cur.ymin;
+ orig_height = cur_new.ymax - cur_new.ymin;
- v2d->cur.xmin = xmin;
- v2d->cur.xmax = xmax;
+ cur_new.xmin = xmin;
+ cur_new.xmax = xmax;
- v2d->cur.ymin = ymin;
- v2d->cur.ymax = ymax;
+ cur_new.ymin = ymin;
+ cur_new.ymax = ymax;
/* only zoom out vertically */
- if (orig_height > v2d->cur.ymax - v2d->cur.ymin) {
- ymid = (v2d->cur.ymax + v2d->cur.ymin) / 2;
+ if (orig_height > cur_new.ymax - cur_new.ymin) {
+ ymid = BLI_RCT_CENTER_Y(&cur_new);
- v2d->cur.ymin = ymid - (orig_height / 2);
- v2d->cur.ymax = ymid + (orig_height / 2);
+ cur_new.ymin = ymid - (orig_height / 2);
+ cur_new.ymax = ymid + (orig_height / 2);
}
- UI_view2d_curRect_validate(v2d);
- UI_view2d_sync(sc, area, v2d, V2D_LOCK_COPY);
+ UI_view2d_smooth_view(C, ar, &cur_new);
- ED_area_tag_redraw(CTX_wm_area(C));
+ return OPERATOR_FINISHED;
+ }
+ else {
+ return OPERATOR_CANCELLED;
}
- return OPERATOR_FINISHED;
}
void SEQUENCER_OT_view_selected(wmOperatorType *ot)
@@ -2387,9 +2409,9 @@ static void swap_sequence(Scene *scene, Sequence *seqa, Sequence *seqb)
{
int gap = seqb->startdisp - seqa->enddisp;
seqb->start = (seqb->start - seqb->startdisp) + seqa->startdisp;
- calc_sequence(scene, seqb);
+ BKE_sequence_calc(scene, seqb);
seqa->start = (seqa->start - seqa->startdisp) + seqb->enddisp + gap;
- calc_sequence(scene, seqa);
+ BKE_sequence_calc(scene, seqa);
}
#if 0
@@ -2427,9 +2449,9 @@ static int sequencer_swap_exec(bContext *C, wmOperator *op)
if (seq) {
/* disallow effect strips */
- if (get_sequence_effect_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 ((get_sequence_effect_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) {
@@ -2444,7 +2466,7 @@ static int sequencer_swap_exec(bContext *C, wmOperator *op)
// XXX - should be a generic function
for (iseq = scene->ed->seqbasep->first; iseq; iseq = iseq->next) {
if ((iseq->type & SEQ_TYPE_EFFECT) && (seq_is_parent(iseq, active_seq) || seq_is_parent(iseq, seq))) {
- calc_sequence(scene, iseq);
+ BKE_sequence_calc(scene, iseq);
}
}
@@ -2452,8 +2474,8 @@ static int sequencer_swap_exec(bContext *C, wmOperator *op)
for (iseq = scene->ed->seqbasep->first; iseq; iseq = iseq->next) {
if ((iseq->type & SEQ_TYPE_EFFECT) && (seq_is_parent(iseq, active_seq) || seq_is_parent(iseq, seq))) {
/* this may now overlap */
- if (seq_test_overlap(ed->seqbasep, iseq) ) {
- shuffle_seq(ed->seqbasep, iseq, scene);
+ if (BKE_sequence_test_overlap(ed->seqbasep, iseq) ) {
+ BKE_sequence_base_shuffle(ed->seqbasep, iseq, scene);
}
}
}
@@ -2502,7 +2524,7 @@ static int sequencer_rendersize_exec(bContext *C, wmOperator *UNUSED(op))
if (active_seq->strip) {
switch (active_seq->type) {
case SEQ_TYPE_IMAGE:
- se = give_stripelem(active_seq, scene->r.cfra);
+ se = BKE_sequencer_give_stripelem(active_seq, scene->r.cfra);
break;
case SEQ_TYPE_MOVIE:
se = active_seq->strip->stripdata;
@@ -2569,14 +2591,14 @@ static int sequencer_copy_exec(bContext *C, wmOperator *op)
ListBase nseqbase = {NULL, NULL};
- seq_free_clipboard();
+ BKE_sequencer_free_clipboard();
- if (seqbase_isolated_sel_check(ed->seqbasep) == FALSE) {
+ if (BKE_sequence_base_isolated_sel_check(ed->seqbasep) == FALSE) {
BKE_report(op->reports, RPT_ERROR, "Please select all related strips");
return OPERATOR_CANCELLED;
}
- seqbase_dupli_recursive(scene, NULL, &nseqbase, ed->seqbasep, SEQ_DUPE_UNIQUE_NAME);
+ BKE_sequence_base_dupli_recursive(scene, NULL, &nseqbase, ed->seqbasep, SEQ_DUPE_UNIQUE_NAME);
/* To make sure the copied strips have unique names between each other add
* them temporarily to the end of the original seqbase. (bug 25932)
@@ -2586,7 +2608,7 @@ static int sequencer_copy_exec(bContext *C, wmOperator *op)
BLI_movelisttolist(ed->seqbasep, &nseqbase);
for (seq = first_seq; seq; seq = seq->next)
- seq_recursive_apply(seq, apply_unique_name_cb, scene);
+ BKE_sequencer_recursive_apply(seq, apply_unique_name_cb, scene);
seqbase_clipboard.first = first_seq;
seqbase_clipboard.last = ed->seqbasep->last;
@@ -2636,13 +2658,13 @@ static int sequencer_paste_exec(bContext *C, wmOperator *UNUSED(op))
ED_sequencer_deselect_all(scene);
ofs = scene->r.cfra - seqbase_clipboard_frame;
- seqbase_dupli_recursive(scene, NULL, &nseqbase, &seqbase_clipboard, SEQ_DUPE_UNIQUE_NAME);
+ BKE_sequence_base_dupli_recursive(scene, NULL, &nseqbase, &seqbase_clipboard, SEQ_DUPE_UNIQUE_NAME);
/* transform pasted strips before adding */
if (ofs) {
for (iseq = nseqbase.first; iseq; iseq = iseq->next) {
- seq_translate(scene, iseq, ofs);
- seq_sound_init(scene, iseq);
+ BKE_sequence_translate(scene, iseq, ofs);
+ BKE_sequence_sound_init(scene, iseq);
}
}
@@ -2652,7 +2674,7 @@ static int sequencer_paste_exec(bContext *C, wmOperator *UNUSED(op))
/* make sure the pasted strips have unique names between them */
for (; iseq; iseq = iseq->next) {
- seq_recursive_apply(iseq, apply_unique_name_cb, scene);
+ BKE_sequencer_recursive_apply(iseq, apply_unique_name_cb, scene);
}
WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene);
@@ -2689,7 +2711,7 @@ static int sequencer_swap_data_exec(bContext *C, wmOperator *op)
return OPERATOR_CANCELLED;
}
- if (seq_swap(seq_act, seq_other, &error_msg) == 0) {
+ if (BKE_sequence_swap(seq_act, seq_other, &error_msg) == 0) {
BKE_report(op->reports, RPT_ERROR, error_msg);
return OPERATOR_CANCELLED;
}
@@ -2703,8 +2725,8 @@ static int sequencer_swap_data_exec(bContext *C, wmOperator *op)
seq_act->scene_sound = NULL;
seq_other->scene_sound = NULL;
- calc_sequence(scene, seq_act);
- calc_sequence(scene, seq_other);
+ BKE_sequence_calc(scene, seq_act);
+ BKE_sequence_calc(scene, seq_other);
if (seq_act->sound) sound_add_scene_sound_defaults(scene, seq_act);
if (seq_other->sound) sound_add_scene_sound_defaults(scene, seq_other);
@@ -2747,11 +2769,11 @@ static int view_ghost_border_exec(bContext *C, wmOperator *op)
if (ed == NULL)
return OPERATOR_CANCELLED;
- rect.xmin /= (float)(ABS(v2d->tot.xmax - v2d->tot.xmin));
- rect.ymin /= (float)(ABS(v2d->tot.ymax - v2d->tot.ymin));
+ rect.xmin /= (float)(ABS(BLI_RCT_SIZE_X(&v2d->tot)));
+ rect.ymin /= (float)(ABS(BLI_RCT_SIZE_Y(&v2d->tot)));
- rect.xmax /= (float)(ABS(v2d->tot.xmax - v2d->tot.xmin));
- rect.ymax /= (float)(ABS(v2d->tot.ymax - v2d->tot.ymin));
+ rect.xmax /= (float)(ABS(BLI_RCT_SIZE_X(&v2d->tot)));
+ rect.ymax /= (float)(ABS(BLI_RCT_SIZE_Y(&v2d->tot)));
rect.xmin += 0.5f;
rect.xmax += 0.5f;
@@ -2855,10 +2877,10 @@ static int sequencer_change_effect_input_exec(bContext *C, wmOperator *op)
SWAP(Sequence *, *seq_1, *seq_2);
}
- update_changed_seq_and_deps(scene, seq, 0, 1);
+ BKE_sequencer_update_changed_seq_and_deps(scene, seq, 0, 1);
/* important else we don't get the imbuf cache flushed */
- free_imbuf_seq(scene, &ed->seqbase, FALSE, FALSE);
+ BKE_sequencer_free_imbuf(scene, &ed->seqbase, FALSE, FALSE);
WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene);
@@ -2898,27 +2920,27 @@ static int sequencer_change_effect_type_exec(bContext *C, wmOperator *op)
/* can someone explain the logic behind only allowing to increase this,
* copied from 2.4x - campbell */
- if (get_sequence_effect_num_inputs(seq->type) <
- get_sequence_effect_num_inputs(new_type))
+ if (BKE_sequence_effect_get_num_inputs(seq->type) <
+ BKE_sequence_effect_get_num_inputs(new_type))
{
BKE_report(op->reports, RPT_ERROR, "New effect needs more input strips");
return OPERATOR_CANCELLED;
}
else {
- sh = get_sequence_effect(seq);
+ sh = BKE_sequence_get_effect(seq);
sh.free(seq);
seq->type = new_type;
- sh = get_sequence_effect(seq);
+ sh = BKE_sequence_get_effect(seq);
sh.init(seq);
}
/* update */
- update_changed_seq_and_deps(scene, seq, 0, 1);
+ BKE_sequencer_update_changed_seq_and_deps(scene, seq, 0, 1);
/* important else we don't get the imbuf cache flushed */
- free_imbuf_seq(scene, &ed->seqbase, FALSE, FALSE);
+ BKE_sequencer_free_imbuf(scene, &ed->seqbase, FALSE, FALSE);
WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene);
@@ -2986,12 +3008,12 @@ static int sequencer_change_path_exec(bContext *C, wmOperator *op)
/* correct start/end frames so we don't move
* important not to set seq->len= len; allow the function to handle it */
- reload_sequence_new_file(scene, seq, TRUE);
+ BKE_sequence_reload_new_file(scene, seq, TRUE);
- calc_sequence(scene, seq);
+ BKE_sequence_calc(scene, seq);
/* important else we don't get the imbuf cache flushed */
- free_imbuf_seq(scene, &ed->seqbase, FALSE, FALSE);
+ BKE_sequencer_free_imbuf(scene, &ed->seqbase, FALSE, FALSE);
}
else {
/* lame, set rna filepath */
@@ -3047,6 +3069,8 @@ void SEQUENCER_OT_change_path(struct wmOperatorType *ot)
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
- WM_operator_properties_filesel(ot, FOLDERFILE | IMAGEFILE | MOVIEFILE, FILE_SPECIAL, FILE_OPENFILE, WM_FILESEL_DIRECTORY | WM_FILESEL_RELPATH | WM_FILESEL_FILEPATH | WM_FILESEL_FILES, FILE_DEFAULTDISPLAY);
+ WM_operator_properties_filesel(ot, FOLDERFILE | IMAGEFILE | MOVIEFILE, FILE_SPECIAL, FILE_OPENFILE,
+ WM_FILESEL_DIRECTORY | WM_FILESEL_RELPATH | WM_FILESEL_FILEPATH | WM_FILESEL_FILES,
+ FILE_DEFAULTDISPLAY);
}
diff --git a/source/blender/editors/space_sequencer/sequencer_intern.h b/source/blender/editors/space_sequencer/sequencer_intern.h
index 14d2ccdbbbe..bad4fcf9135 100644
--- a/source/blender/editors/space_sequencer/sequencer_intern.h
+++ b/source/blender/editors/space_sequencer/sequencer_intern.h
@@ -51,7 +51,7 @@ struct ARegion *sequencer_has_buttons_region(struct ScrArea *sa);
/* sequencer_draw.c */
void draw_timeline_seq(const struct bContext *C, struct ARegion *ar);
-void draw_image_seq(const struct bContext* C, struct Scene *scene, struct ARegion *ar, struct SpaceSeq *sseq, int cfra, int offset);
+void draw_image_seq(const struct bContext* C, struct Scene *scene, struct ARegion *ar, struct SpaceSeq *sseq, int cfra, int offset, int draw_overlay);
void seq_reset_imageofs(struct SpaceSeq *sseq);
@@ -177,5 +177,9 @@ struct ImBuf *make_histogram_view_from_ibuf(struct ImBuf * ibuf);
void sequencer_buttons_register(struct ARegionType *art);
void SEQUENCER_OT_properties(struct wmOperatorType *ot);
+/* sequencer_modifiers.c */
+void SEQUENCER_OT_strip_modifier_add(struct wmOperatorType *ot);
+void SEQUENCER_OT_strip_modifier_remove(struct wmOperatorType *ot);
+
#endif /* __SEQUENCER_INTERN_H__ */
diff --git a/source/blender/editors/space_sequencer/sequencer_modifier.c b/source/blender/editors/space_sequencer/sequencer_modifier.c
new file mode 100644
index 00000000000..b19d92d67a0
--- /dev/null
+++ b/source/blender/editors/space_sequencer/sequencer_modifier.c
@@ -0,0 +1,156 @@
+/*
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * The Original Code is Copyright (C) 2012 Blender Foundation.
+ * All rights reserved.
+ *
+ * Contributor(s): Blender Foundation,
+ * Sergey Sharybin
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+
+/** \file blender/editors/space_sequencer/sequencer_modifier.c
+ * \ingroup spseq
+ */
+
+#include "MEM_guardedalloc.h"
+
+#include "BLI_blenlib.h"
+#include "BLI_math.h"
+#include "BLI_utildefines.h"
+
+#include "DNA_scene_types.h"
+#include "DNA_mask_types.h"
+#include "DNA_userdef_types.h"
+
+#include "BKE_context.h"
+#include "BKE_global.h"
+#include "BKE_library.h"
+#include "BKE_main.h"
+#include "BKE_sequencer.h"
+#include "BKE_movieclip.h"
+#include "BKE_sequencer.h"
+#include "BKE_mask.h"
+#include "BKE_report.h"
+
+#include "WM_api.h"
+#include "WM_types.h"
+
+#include "RNA_define.h"
+#include "RNA_enum_types.h"
+
+#include "UI_interface.h"
+#include "UI_resources.h"
+
+/* own include */
+#include "sequencer_intern.h"
+
+/*********************** Add modifier operator *************************/
+
+static int strip_modifier_active_poll(bContext *C)
+{
+ Scene *scene = CTX_data_scene(C);
+ Editing *ed = BKE_sequencer_editing_get(scene, FALSE);
+
+ if (ed) {
+ Sequence *seq = BKE_sequencer_active_get(scene);
+
+ if (seq)
+ return BKE_sequence_supports_modifiers(seq);
+ }
+
+ return FALSE;
+}
+
+static int strip_modifier_add_exec(bContext *C, wmOperator *op)
+{
+ Scene *scene = CTX_data_scene(C);
+ Sequence *seq = BKE_sequencer_active_get(scene);
+ int type = RNA_enum_get(op->ptr, "type");
+
+ BKE_sequence_modifier_new(seq, NULL, type);
+
+ BKE_sequence_invalidate_cache(scene, seq);
+ WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene);
+
+ return OPERATOR_FINISHED;
+}
+
+void SEQUENCER_OT_strip_modifier_add(wmOperatorType *ot)
+{
+ PropertyRNA *prop;
+
+ /* identifiers */
+ ot->name = "Add Strip Modifier";
+ ot->idname = "SEQUENCER_OT_strip_modifier_add";
+ ot->description = "Add a modifier to strip";
+
+ /* api callbacks */
+ ot->exec = strip_modifier_add_exec;
+ ot->poll = strip_modifier_active_poll;
+
+ /* flags */
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
+
+ /* properties */
+ prop = RNA_def_enum(ot->srna, "type", sequence_modifier_type_items, seqModifierType_ColorBalance, "Type", "");
+ ot->prop = prop;
+}
+
+/*********************** Remove modifier operator *************************/
+
+static int strip_modifier_remove_exec(bContext *C, wmOperator *op)
+{
+ Scene *scene = CTX_data_scene(C);
+ Sequence *seq = BKE_sequencer_active_get(scene);
+ char name[MAX_NAME];
+ SequenceModifierData *smd;
+
+ RNA_string_get(op->ptr, "name", name);
+
+ smd = BKE_sequence_modifier_find_by_name(seq, name);
+ if (!smd)
+ return OPERATOR_CANCELLED;
+
+ BLI_remlink(&seq->modifiers, smd);
+ BKE_sequence_modifier_free(smd);
+
+ BKE_sequence_invalidate_cache(scene, seq);
+ WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene);
+
+ return OPERATOR_FINISHED;
+}
+
+void SEQUENCER_OT_strip_modifier_remove(wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name = "Remove Strip Modifier";
+ ot->idname = "SEQUENCER_OT_strip_modifier_remove";
+ ot->description = "Add a modifier to strip";
+
+ /* api callbacks */
+ ot->exec = strip_modifier_remove_exec;
+ ot->poll = strip_modifier_active_poll;
+
+ /* flags */
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
+
+ /* properties */
+ RNA_def_string(ot->srna, "name", "Name", MAX_NAME, "Name", "Name of modifier to remove");
+}
diff --git a/source/blender/editors/space_sequencer/sequencer_ops.c b/source/blender/editors/space_sequencer/sequencer_ops.c
index 4a1c8f0c006..45ffc997172 100644
--- a/source/blender/editors/space_sequencer/sequencer_ops.c
+++ b/source/blender/editors/space_sequencer/sequencer_ops.c
@@ -114,6 +114,10 @@ void sequencer_operatortypes(void)
WM_operatortype_append(SEQUENCER_OT_copy);
WM_operatortype_append(SEQUENCER_OT_paste);
+
+ /* sequencer_modifiers.c */
+ WM_operatortype_append(SEQUENCER_OT_strip_modifier_add);
+ WM_operatortype_append(SEQUENCER_OT_strip_modifier_remove);
}
diff --git a/source/blender/editors/space_sequencer/sequencer_select.c b/source/blender/editors/space_sequencer/sequencer_select.c
index 7849f84e777..3d57f2f88ed 100644
--- a/source/blender/editors/space_sequencer/sequencer_select.c
+++ b/source/blender/editors/space_sequencer/sequencer_select.c
@@ -860,10 +860,7 @@ static int sequencer_borderselect_exec(bContext *C, wmOperator *op)
if (ed == NULL)
return OPERATOR_CANCELLED;
- rect.xmin = RNA_int_get(op->ptr, "xmin");
- rect.ymin = RNA_int_get(op->ptr, "ymin");
- rect.xmax = RNA_int_get(op->ptr, "xmax");
- rect.ymax = RNA_int_get(op->ptr, "ymax");
+ WM_operator_properties_border_to_rcti(op, &rect);
mval[0] = rect.xmin;
mval[1] = rect.ymin;
@@ -1112,7 +1109,7 @@ static short select_grouped_effect_link(Editing *ed, Sequence *actseq)
actseq->tmp = SET_INT_IN_POINTER(TRUE);
- for (seq_begin(ed, &iter, TRUE); iter.valid; seq_next(&iter)) {
+ for (BKE_seqence_iterator_begin(ed, &iter, TRUE); iter.valid; BKE_seqence_iterator_next(&iter)) {
seq = iter.seq;
/* Ignore all seqs already selected! */
@@ -1140,8 +1137,8 @@ static short select_grouped_effect_link(Editing *ed, Sequence *actseq)
changed = TRUE;
/* Unfortunately, we must restart checks from the beginning. */
- seq_end(&iter);
- seq_begin(ed, &iter, TRUE);
+ BKE_seqence_iterator_end(&iter);
+ BKE_seqence_iterator_begin(ed, &iter, TRUE);
}
/* Video strips bellow active one, or any strip for audio (order do no matters here!). */
@@ -1150,7 +1147,7 @@ static short select_grouped_effect_link(Editing *ed, Sequence *actseq)
changed = TRUE;
}
}
- seq_end(&iter);
+ BKE_seqence_iterator_end(&iter);
return changed;
}
diff --git a/source/blender/editors/space_sequencer/space_sequencer.c b/source/blender/editors/space_sequencer/space_sequencer.c
index cabc761161e..f7362aab7aa 100644
--- a/source/blender/editors/space_sequencer/space_sequencer.c
+++ b/source/blender/editors/space_sequencer/space_sequencer.c
@@ -300,7 +300,10 @@ static void sequencer_main_area_init(wmWindowManager *wm, ARegion *ar)
ListBase *lb;
UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_CUSTOM, ar->winx, ar->winy);
-
+
+// keymap = WM_keymap_find(wm->defaultconf, "Mask Editing", 0, 0);
+// WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
+
keymap = WM_keymap_find(wm->defaultconf, "SequencerCommon", SPACE_SEQ, 0);
WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
@@ -409,9 +412,9 @@ static int sequencer_context(const bContext *C, const char *member, bContextData
return TRUE;
}
else if (CTX_data_equals(member, "edit_mask")) {
- Sequence *seq_act = BKE_sequencer_active_get(scene);
- if (seq_act && seq_act->type == SEQ_TYPE_MASK && seq_act->mask) {
- CTX_data_id_pointer_set(result, &seq_act->mask->id);
+ Mask *mask = BKE_sequencer_mask_get(scene);
+ if (mask) {
+ CTX_data_id_pointer_set(result, &mask->id);
}
return TRUE;
}
@@ -468,6 +471,9 @@ static void sequencer_preview_area_init(wmWindowManager *wm, ARegion *ar)
UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_CUSTOM, ar->winx, ar->winy);
+// keymap = WM_keymap_find(wm->defaultconf, "Mask Editing", 0, 0);
+// WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
+
keymap = WM_keymap_find(wm->defaultconf, "SequencerCommon", SPACE_SEQ, 0);
WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
@@ -481,13 +487,15 @@ static void sequencer_preview_area_draw(const bContext *C, ARegion *ar)
ScrArea *sa = CTX_wm_area(C);
SpaceSeq *sseq = sa->spacedata.first;
Scene *scene = CTX_data_scene(C);
+ int show_split = scene->ed && scene->ed->over_flag & SEQ_EDIT_OVERLAY_SHOW && 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;
- draw_image_seq(C, scene, ar, sseq, scene->r.cfra, 0);
+ if (!show_split || sseq->overlay_type != SEQ_DRAW_OVERLAY_REFERENCE)
+ draw_image_seq(C, scene, ar, sseq, scene->r.cfra, 0, FALSE);
- if (scene->ed && scene->ed->over_flag & SEQ_EDIT_OVERLAY_SHOW && sseq->mainb == SEQ_DRAW_IMG_IMBUF) {
+ if (show_split && sseq->overlay_type != SEQ_DRAW_OVERLAY_CURRENT) {
int over_cfra;
if (scene->ed->over_flag & SEQ_EDIT_OVERLAY_ABS)
@@ -495,8 +503,8 @@ static void sequencer_preview_area_draw(const bContext *C, ARegion *ar)
else
over_cfra = scene->r.cfra + scene->ed->over_ofs;
- if (over_cfra != scene->r.cfra)
- draw_image_seq(C, scene, ar, sseq, scene->r.cfra, over_cfra - scene->r.cfra);
+ if (over_cfra != scene->r.cfra || sseq->overlay_type != SEQ_DRAW_OVERLAY_RECT)
+ draw_image_seq(C, scene, ar, sseq, scene->r.cfra, over_cfra - scene->r.cfra, TRUE);
}
}