[Bf-blender-cvs] [f7c5a23] terrible_consequencer: Merge branch 'master' into terrible_consequencer
Antony Riakiotakis
noreply at git.blender.org
Mon Oct 20 15:50:53 CEST 2014
Commit: f7c5a231d5127f11c856d8ae53713451ebbab4aa
Author: Antony Riakiotakis
Date: Mon Oct 20 15:49:54 2014 +0200
Branches: terrible_consequencer
https://developer.blender.org/rBf7c5a231d5127f11c856d8ae53713451ebbab4aa
Merge branch 'master' into terrible_consequencer
Conflicts:
source/blender/editors/space_sequencer/sequencer_edit.c
source/blender/editors/space_sequencer/sequencer_ops.c
===================================================================
===================================================================
diff --cc source/blender/editors/space_sequencer/sequencer_edit.c
index be87b76,7f802f4..c09dbb4
--- a/source/blender/editors/space_sequencer/sequencer_edit.c
+++ b/source/blender/editors/space_sequencer/sequencer_edit.c
@@@ -1236,640 -1231,422 +1236,581 @@@ void SEQUENCER_OT_snap(struct wmOperato
RNA_def_int(ot->srna, "frame", 0, INT_MIN, INT_MAX, "Frame", "Frame where selected strips will be snapped", INT_MIN, INT_MAX);
}
+static int sequencer_parent_exec(bContext *C, wmOperator *UNUSED(op))
+{
+ Scene *scene = CTX_data_scene(C);
+
+ if (scene) {
+ Editing *ed = BKE_sequencer_editing_get(scene, false);
+ Sequence *seq, *active_seq = ed->act_seq;
+
+ for (seq = ed->seqbasep->first; seq; seq = seq->next) {
+ if (seq == active_seq)
+ continue;
+
+ if (seq->flag & SELECT) {
+ seq->parent = active_seq;
+ }
+ }
+ }
+
+ WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene);
+
+ return OPERATOR_FINISHED;
+}
+
+void SEQUENCER_OT_parent(struct wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name = "Parent Strips";
+ ot->idname = "SEQUENCER_OT_parent";
+ ot->description = "";
+
+ /* api callbacks */
+ ot->exec = sequencer_parent_exec;
+ ot->poll = sequencer_edit_poll;
+
+ /* flags */
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
-
+}
+
- /* mute operator */
- static int sequencer_mute_exec(bContext *C, wmOperator *op)
- {
- Scene *scene = CTX_data_scene(C);
- Editing *ed = BKE_sequencer_editing_get(scene, false);
- Sequence *seq;
- bool selected;
-
- selected = !RNA_boolean_get(op->ptr, "unselected");
-
- for (seq = ed->seqbasep->first; seq; seq = seq->next) {
- if ((seq->flag & SEQ_LOCK) == 0) {
- if (selected) { /* mute unselected */
- if (seq->flag & SELECT) {
- seq->flag |= SEQ_MUTE;
- BKE_sequence_invalidate_dependent(scene, seq);
- }
- }
- else {
- if ((seq->flag & SELECT) == 0) {
- seq->flag |= SEQ_MUTE;
- BKE_sequence_invalidate_dependent(scene, seq);
- }
- }
- }
- }
-
- BKE_sequencer_update_muting(ed);
- WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene);
-
- return OPERATOR_FINISHED;
- }
+ typedef struct TrimData {
- int init_mouse[2];
- float init_mouseloc[2];
- TransSeq *ts;
- Sequence **seq_array;
- bool *trim;
- int num_seq;
- bool slow;
- int slow_offset; /* offset at the point where offset was turned on */
++ int init_mouse[2];
++ float init_mouseloc[2];
++ TransSeq *ts;
++ Sequence **seq_array;
++ bool *trim;
++ int num_seq;
++ bool slow;
++ int slow_offset; /* offset at the point where offset was turned on */
++ void *draw_handle;
+ } TrimData;
- void SEQUENCER_OT_mute(struct wmOperatorType *ot)
+ static void transseq_backup(TransSeq *ts, Sequence *seq)
{
- /* identifiers */
- ot->name = "Mute Strips";
- ot->idname = "SEQUENCER_OT_mute";
- ot->description = "Mute selected strips";
-
- /* api callbacks */
- ot->exec = sequencer_mute_exec;
- ot->poll = sequencer_edit_poll;
-
- /* flags */
- ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
-
- RNA_def_boolean(ot->srna, "unselected", 0, "Unselected", "Mute unselected rather than selected strips");
+ ts->start = seq->start;
+ ts->machine = seq->machine;
+ ts->startstill = seq->startstill;
+ ts->endstill = seq->endstill;
+ ts->startdisp = seq->startdisp;
+ 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;
}
- /* unmute operator */
- static int sequencer_unmute_exec(bContext *C, wmOperator *op)
+ static void transseq_restore(TransSeq *ts, Sequence *seq)
{
- Scene *scene = CTX_data_scene(C);
- Editing *ed = BKE_sequencer_editing_get(scene, false);
- Sequence *seq;
- bool selected;
-
- selected = !RNA_boolean_get(op->ptr, "unselected");
-
- for (seq = ed->seqbasep->first; seq; seq = seq->next) {
- if ((seq->flag & SEQ_LOCK) == 0) {
- if (selected) { /* unmute unselected */
- if (seq->flag & SELECT) {
- seq->flag &= ~SEQ_MUTE;
- BKE_sequence_invalidate_dependent(scene, seq);
- }
- }
- else {
- if ((seq->flag & SELECT) == 0) {
- seq->flag &= ~SEQ_MUTE;
- BKE_sequence_invalidate_dependent(scene, seq);
- }
- }
- }
- }
-
- BKE_sequencer_update_muting(ed);
- WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene);
-
- return OPERATOR_FINISHED;
+ seq->start = ts->start;
+ seq->machine = ts->machine;
+ seq->startstill = ts->startstill;
+ seq->endstill = ts->endstill;
+ seq->startdisp = ts->startdisp;
+ seq->enddisp = ts->enddisp;
+ seq->startofs = ts->startofs;
+ seq->endofs = ts->endofs;
+ seq->anim_startofs = ts->anim_startofs;
+ seq->anim_endofs = ts->anim_endofs;
+ seq->len = ts->len;
}
- void SEQUENCER_OT_unmute(struct wmOperatorType *ot)
++static void draw_trim_extensions(const bContext *C, ARegion *ar, void *data)
+{
- /* identifiers */
- ot->name = "Un-Mute Strips";
- ot->idname = "SEQUENCER_OT_unmute";
- ot->description = "Un-Mute unselected rather than selected strips";
-
- /* api callbacks */
- ot->exec = sequencer_unmute_exec;
- ot->poll = sequencer_edit_poll;
-
- /* flags */
- ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
-
- RNA_def_boolean(ot->srna, "unselected", 0, "Unselected", "UnMute unselected rather than selected strips");
- }
++ Scene *scene = CTX_data_scene(C);
++ float x1, x2, y1, y2, pixely, a;
++ unsigned char col[3], blendcol[3];
++ View2D *v2d = &ar->v2d;
++ TrimData *td = data;
++ int i;
+
++ for (i = 0; i < td->num_seq; i++) {
++ Sequence *seq = td->seq_array[i];
+
- /* lock operator */
- static int sequencer_lock_exec(bContext *C, wmOperator *UNUSED(op))
- {
- Scene *scene = CTX_data_scene(C);
- Editing *ed = BKE_sequencer_editing_get(scene, false);
- Sequence *seq;
++ if ((seq->type != SEQ_TYPE_META) && td->trim[i]) {
+
- for (seq = ed->seqbasep->first; seq; seq = seq->next) {
- if (seq->flag & SELECT) {
- seq->flag |= SEQ_LOCK;
- }
- }
++ x1 = seq->startdisp;
++ x2 = seq->enddisp;
+
- WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene);
++ y1 = seq->machine + SEQ_STRIP_OFSBOTTOM;
++ y2 = seq->machine + SEQ_STRIP_OFSTOP;
+
- return OPERATOR_FINISHED;
- }
++ pixely = BLI_rctf_size_y(&v2d->cur) / BLI_rcti_size_y(&v2d->mask);
+
- void SEQUENCER_OT_lock(struct wmOperatorType *ot)
- {
- /* identifiers */
- ot->name = "Lock Strips";
- ot->idname = "SEQUENCER_OT_lock";
- ot->description = "Lock the active strip so that it can't be transformed";
-
- /* api callbacks */
- ot->exec = sequencer_lock_exec;
- ot->poll = sequencer_edit_poll;
-
- /* flags */
- ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
- }
++ if (pixely <= 0) return; /* can happen when the view is split/resized */
+
- /* unlock operator */
- static int sequencer_unlock_exec(bContext *C, wmOperator *UNUSED(op))
- {
- Scene *scene = CTX_data_scene(C);
- Editing *ed = BKE_sequencer_editing_get(scene, false);
- Sequence *seq;
++ blendcol[0] = blendcol[1] = blendcol[2] = 120;
+
- for (seq = ed->seqbasep->first; seq; seq = seq->next) {
- if (seq->flag & SELECT) {
- seq->flag &= ~SEQ_LOCK;
- }
- }
++ if (seq->startofs) {
++ glEnable(GL_BLEND);
++ glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+
- WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene);
++ get_seq_color3ubv(scene, seq, col);
+
- return OPERATOR_FINISHED;
- }
++ if (seq->flag & SELECT) {
++ UI_GetColorPtrBlendShade3ubv(col, blendcol, col, 0.3, -40);
++ glColor4ub(col[0], col[1], col[2], 170);
++ }
++ else {
++ UI_GetColorPtrBlendShade3ubv(col, blendcol, col, 0.6, 0);
++ glColor4ub(col[0], col[1], col[2], 110);
++ }
+
- void SEQUENCER_OT_unlock(struct wmOperatorType *ot)
- {
- /* identifiers */
- ot->name = "UnLock Strips";
- ot->idname = "SEQUENCER_OT_unlock";
- ot->description = "Unlock the active strip so that it can't be transformed";
-
- /* api callbacks */
- ot->exec = sequencer_unlock_exec;
- ot->poll = sequencer_edit_poll;
-
- /* flags */
- ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
- }
++ glRectf((float)(seq->start), y1 - SEQ_STRIP_OFSBOTTOM, x1, y1);
+
- /* reload operator */
- static int sequencer_reload_exec(bContext *C, wmOperator *op)
- {
- Scene *scene = CTX_data_scene(C);
- Editing *ed = BKE_sequencer_editing_get(scene, false);
- Sequence *seq;
- const bool adjust_length = RNA_boolean_get(op->ptr, "adjust_length");
++ if (seq->flag & SELECT) glColor4ub(col[0], col[1], col[2], 255);
++ else glColor4ub(col[0], col[1], col[2], 160);
+
- for (seq = ed->seqbasep->first; seq; seq = seq->next) {
- if (seq->flag & SELECT) {
- BKE_sequencer_update_changed_seq_and_deps(scene, seq, 0, 1);
- BKE_sequence_reload_new_file(scene, seq, !adjust_length);
++ fdrawbox((float)(seq->start), y1 - SEQ_STRIP_OFSBOTTOM, x1, y1); //outline
+
- if (adjust_length) {
- if (BKE_sequence_test_overlap(ed->seqbasep, seq))
- BKE_sequence_base_shuffle(ed->seqbasep, seq, scene);
++ glDisable(GL_BLEND);
+ }
- }
- }
++ if (seq->endofs) {
++ glEnable(GL_BLEND);
++ glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+
- WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene);
++ get_seq_color3ubv(scene, seq, col);
+
- return OPERATOR_FINISHED;
- }
++ if (seq->flag & SELECT) {
++ UI_GetColorPtrBlendShade3ubv(col, blendcol, col, 0.3, -40);
++ glColor4ub(col[0], col[1], col[2], 170);
++ }
++ else {
++ UI_GetColorPtrBlendShade3ubv(col, blendcol, col, 0.6, 0);
++ glColor4ub(col[0], col[1], col[2], 110);
++ }
+
- void SEQUENCER_OT_reload(struct wmOperatorType *ot)
- {
- PropertyRNA *prop;
++ glRectf(x2, y2, (float)(seq->start + seq->len), y2 + SEQ_STRIP_OFSBOTTOM);
+
- /* identifiers */
- ot->name = "Reload Strips";
- ot->idname = "SEQUENCER_OT_reload";
- ot->description = "Reload strips in the sequencer";
-
- /* api callbacks */
- ot->exec = sequencer_reload_exec;
- ot->poll = sequencer_edit_poll;
-
- /* flags */
- ot->flag = OPTYPE_REGISTER; /* no undo, the data changed is stored outside 'main' */
++ if (seq->flag & S
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list