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:
Diffstat (limited to 'source/blender/editors/space_sequencer/sequencer_edit.c')
-rw-r--r--source/blender/editors/space_sequencer/sequencer_edit.c59
1 files changed, 29 insertions, 30 deletions
diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c
index 92fae3d4820..b7a7b6b5412 100644
--- a/source/blender/editors/space_sequencer/sequencer_edit.c
+++ b/source/blender/editors/space_sequencer/sequencer_edit.c
@@ -100,6 +100,7 @@ EnumPropertyItem sequencer_prop_effect_types[] = {
{SEQ_COLOR, "COLOR", 0, "Color", "Color effect strip type"},
{SEQ_SPEED, "SPEED", 0, "Speed", "Color effect strip type"},
{SEQ_MULTICAM, "MULTICAM", 0, "Multicam Selector", ""},
+ {SEQ_ADJUSTMENT, "ADJUSTMENT", 0, "Adjustment Layer", ""},
{0, NULL, 0, NULL, NULL}
};
@@ -123,7 +124,8 @@ typedef struct TransSeq {
int startstill, endstill;
int startdisp, enddisp;
int startofs, endofs;
- int final_left, final_right;
+ int anim_startofs, anim_endofs;
+ /* int final_left, final_right; */ /* UNUSED */
int len;
} TransSeq;
@@ -191,7 +193,7 @@ void boundbox_seq(Scene *scene, rctf *rect)
static int mouse_frame_side(View2D *v2d, short mouse_x, int frame )
{
- short mval[2];
+ int mval[2];
float mouseloc[2];
mval[0]= mouse_x;
@@ -284,7 +286,7 @@ static Sequence *find_next_prev_sequence(Scene *scene, Sequence *test, int lr, i
}
-Sequence *find_nearest_seq(Scene *scene, View2D *v2d, int *hand, const short mval[2])
+Sequence *find_nearest_seq(Scene *scene, View2D *v2d, int *hand, const int mval[2])
{
Sequence *seq;
Editing *ed= seq_give_editing(scene, FALSE);
@@ -406,6 +408,7 @@ int event_to_efftype(int event)
if(event==15) return SEQ_TRANSFORM;
if(event==16) return SEQ_COLOR;
if(event==17) return SEQ_SPEED;
+ if(event==18) return SEQ_ADJUSTMENT;
return 0;
}
@@ -517,7 +520,8 @@ static void change_sequence(Scene *scene)
"|Glow%x14"
"|Transform%x15"
"|Color Generator%x16"
- "|Speed Control%x17");
+ "|Speed Control%x17"
+ "|Adjustment Layer%x18");
if(event > 0) {
if(event==1) {
SWAP(Sequence *,last_seq->seq1,last_seq->seq2);
@@ -703,15 +707,9 @@ static void recurs_del_seq_flag(Scene *scene, ListBase *lb, short flag, short de
while(seq) {
seqn= seq->next;
if((seq->flag & flag) || deleteall) {
- if(seq->type==SEQ_SOUND && seq->sound) {
- ((ID *)seq->sound)->us--; /* TODO, could be moved into seq_free_sequence() */
- }
-
BLI_remlink(lb, seq);
if(seq==last_seq) seq_active_set(scene, NULL);
if(seq->type==SEQ_META) recurs_del_seq_flag(scene, &seq->seqbase, flag, 1);
- /* if(seq->ipo) seq->ipo->id.us--; */
- /* XXX, remove fcurve */
seq_free_sequence(scene, seq);
}
seq= seqn;
@@ -732,8 +730,10 @@ static Sequence *cut_seq_hard(Scene *scene, Sequence * seq, int cutframe)
ts.endstill= seq->endstill;
ts.startdisp= seq->startdisp;
ts.enddisp= seq->enddisp;
- ts.startofs= seq->anim_startofs;
- ts.endofs= seq->anim_endofs;
+ ts.startofs= seq->startofs;
+ ts.endofs= seq->endofs;
+ ts.anim_startofs= seq->anim_startofs;
+ ts.anim_endofs= seq->anim_endofs;
ts.len= seq->len;
/* First Strip! */
@@ -783,7 +783,7 @@ static Sequence *cut_seq_hard(Scene *scene, Sequence * seq, int cutframe)
if ((seqn->startstill) && (cutframe == seqn->start + 1)) {
seqn->start = ts.start;
seqn->startstill= ts.start- cutframe;
- seqn->anim_endofs = ts.endofs;
+ seqn->anim_endofs = ts.anim_endofs;
seqn->endstill = ts.endstill;
}
@@ -792,8 +792,9 @@ static Sequence *cut_seq_hard(Scene *scene, Sequence * seq, int cutframe)
seqn->start = cutframe;
seqn->startstill = 0;
seqn->startofs = 0;
+ seqn->endofs = ts.endofs;
seqn->anim_startofs += cutframe - ts.start;
- seqn->anim_endofs = ts.endofs;
+ seqn->anim_endofs = ts.anim_endofs;
seqn->endstill = ts.endstill;
}
@@ -828,6 +829,8 @@ static Sequence *cut_seq_soft(Scene *scene, Sequence * seq, int cutframe)
ts.enddisp= seq->enddisp;
ts.startofs= seq->startofs;
ts.endofs= seq->endofs;
+ ts.anim_startofs= seq->anim_startofs;
+ ts.anim_endofs= seq->anim_endofs;
ts.len= seq->len;
/* First Strip! */
@@ -1084,7 +1087,7 @@ static int seq_get_snaplimit(View2D *v2d)
/* fake mouse coords to get the snap value
a bit lazy but its only done once pre transform */
float xmouse, ymouse, x;
- short mval[2] = {24, 0}; /* 24 screen px snap */
+ int mval[2] = {24, 0}; /* 24 screen px snap */
UI_view2d_region_to_view(v2d, mval[0], mval[1], &xmouse, &ymouse);
x = xmouse;
@@ -1576,14 +1579,13 @@ static int sequencer_cut_exec(bContext *C, wmOperator *op)
static int sequencer_cut_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
Scene *scene = CTX_data_scene(C);
- ARegion *ar= CTX_wm_region(C);
View2D *v2d= UI_view2d_fromcontext(C);
int cut_side= SEQ_SIDE_BOTH;
int cut_frame= CFRA;
if (ED_operator_sequencer_active(C) && v2d)
- cut_side= mouse_frame_side(v2d, event->x - ar->winrct.xmin, cut_frame);
+ cut_side= mouse_frame_side(v2d, event->mval[0], cut_frame);
RNA_int_set(op->ptr, "frame", cut_frame);
RNA_enum_set(op->ptr, "side", cut_side);
@@ -1706,11 +1708,6 @@ static int sequencer_delete_exec(bContext *C, wmOperator *UNUSED(op))
if (nothingSelected)
return OPERATOR_FINISHED;
- /* free imbufs of all dependent strips */
- for(seq=ed->seqbasep->first; seq; seq=seq->next)
- if(seq->flag & SELECT)
- update_changed_seq_and_deps(scene, seq, 1, 0);
-
/* for effects, try to find a replacement input */
for(seq=ed->seqbasep->first; seq; seq=seq->next)
if((seq->type & SEQ_EFFECT) && !(seq->flag & SELECT))
@@ -1787,19 +1784,21 @@ static int sequencer_separate_images_exec(bContext *C, wmOperator *op)
/* new seq */
se = give_stripelem(seq, cfra);
- seq_new= alloc_sequence(ed->seqbasep, start_ofs, seq->machine);
+ seq_new= seq_dupli_recursive(scene, scene, seq, SEQ_DUPE_UNIQUE_NAME);
+ BLI_addtail(&ed->seqbase, seq_new);
+
+ seq_new->start= start_ofs;
seq_new->type= SEQ_IMAGE;
seq_new->len = 1;
seq_new->endstill = step-1;
/* new strip */
- seq_new->strip= strip_new= MEM_callocN(sizeof(Strip)*1, "strip");
+ strip_new= seq_new->strip;
strip_new->len= 1;
strip_new->us= 1;
- strncpy(strip_new->dir, seq->strip->dir, FILE_MAXDIR-1);
/* new stripdata */
- strip_new->stripdata= se_new= MEM_callocN(sizeof(StripElem)*1, "stripelem");
+ se_new= strip_new->stripdata;
BLI_strncpy(se_new->name, se->name, sizeof(se_new->name));
calc_sequence(scene, seq_new);
@@ -1811,8 +1810,6 @@ static int sequencer_separate_images_exec(bContext *C, wmOperator *op)
}
/* XXX, COPY FCURVES */
- strncpy(seq_new->name+2, seq->name+2, sizeof(seq->name)-2);
- seqbase_unique_name_recursive(&scene->ed->seqbase, seq_new);
cfra++;
start_ofs += step;
@@ -2728,14 +2725,15 @@ static int sequencer_swap_data_exec(bContext *C, wmOperator *op)
Scene *scene= CTX_data_scene(C);
Sequence *seq_act;
Sequence *seq_other;
+ const char *error_msg;
if(seq_active_pair_get(scene, &seq_act, &seq_other) == 0) {
BKE_report(op->reports, RPT_ERROR, "Must select 2 strips");
return OPERATOR_CANCELLED;
}
- if(seq_swap(seq_act, seq_other) == 0) {
- BKE_report(op->reports, RPT_ERROR, "Strips were not compatible");
+ if(seq_swap(seq_act, seq_other, &error_msg) == 0) {
+ BKE_report(op->reports, RPT_ERROR, error_msg);
return OPERATOR_CANCELLED;
}
@@ -2825,6 +2823,7 @@ void SEQUENCER_OT_view_ghost_border(wmOperatorType *ot)
ot->exec= view_ghost_border_exec;
ot->modal= WM_border_select_modal;
ot->poll= sequencer_view_poll;
+ ot->cancel= WM_border_select_cancel;
/* flags */
ot->flag= 0;