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>2007-10-17 22:32:54 +0400
committerCampbell Barton <ideasman42@gmail.com>2007-10-17 22:32:54 +0400
commit2639404f34cd89e1eaebc3736d751938a801fcb9 (patch)
treea6b83ff9736dde1940a74b63ca013f387691dba4 /source/blender
parente844ee5e54b4a6764bdd692e09ceb64f91344283 (diff)
Sequencer
- Draw a verticle line for markers - Added an option to transform selected markers in the sequencer - useful for Extending time
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/include/BSE_time.h2
-rw-r--r--source/blender/makesdna/DNA_space_types.h1
-rw-r--r--source/blender/src/drawaction.c2
-rw-r--r--source/blender/src/drawipo.c2
-rw-r--r--source/blender/src/drawnla.c2
-rw-r--r--source/blender/src/drawseq.c13
-rw-r--r--source/blender/src/drawsound.c2
-rw-r--r--source/blender/src/drawtime.c33
-rw-r--r--source/blender/src/editseq.c68
-rw-r--r--source/blender/src/header_seq.c23
-rw-r--r--source/blender/src/space.c15
11 files changed, 132 insertions, 31 deletions
diff --git a/source/blender/include/BSE_time.h b/source/blender/include/BSE_time.h
index 459101f592d..c7f235bccbd 100644
--- a/source/blender/include/BSE_time.h
+++ b/source/blender/include/BSE_time.h
@@ -54,7 +54,7 @@ int find_nearest_marker_time(float dx);
void add_marker_to_cfra_elem(struct ListBase *lb, struct TimeMarker *marker, short only_sel);
void make_marker_cfra_list(struct ListBase *lb, short only_sel);
-void draw_markers_timespace(void);
+void draw_markers_timespace(int lines);
/* ******** Animation - Preview Range ************* */
void anim_previewrange_set(void);
diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h
index 13e35c3c1d5..10f488c9f61 100644
--- a/source/blender/makesdna/DNA_space_types.h
+++ b/source/blender/makesdna/DNA_space_types.h
@@ -621,6 +621,7 @@ typedef struct SpaceImaSel {
/* sseq->flag */
#define SEQ_DRAWFRAMES 1
+#define SEQ_MARKER_TRANS 2
/* space types, moved from DNA_screen_types.h */
enum {
diff --git a/source/blender/src/drawaction.c b/source/blender/src/drawaction.c
index 8a9841ce70d..183558b65bc 100644
--- a/source/blender/src/drawaction.c
+++ b/source/blender/src/drawaction.c
@@ -928,7 +928,7 @@ void drawactionspace(ScrArea *sa, void *spacedata)
draw_cfra_action();
/* Draw markers */
- draw_markers_timespace();
+ draw_markers_timespace(0);
/* Draw 'curtains' for preview */
draw_anim_preview_timespace();
diff --git a/source/blender/src/drawipo.c b/source/blender/src/drawipo.c
index cf9e8c2ea28..ee4c2cc3659 100644
--- a/source/blender/src/drawipo.c
+++ b/source/blender/src/drawipo.c
@@ -2240,7 +2240,7 @@ void drawipospace(ScrArea *sa, void *spacedata)
draw_anim_preview_timespace();
/* draw markers */
- draw_markers_timespace();
+ draw_markers_timespace(0);
/* restore viewport */
mywinset(sa->win);
diff --git a/source/blender/src/drawnla.c b/source/blender/src/drawnla.c
index c48cca702c2..0394fcce80b 100644
--- a/source/blender/src/drawnla.c
+++ b/source/blender/src/drawnla.c
@@ -754,7 +754,7 @@ void drawnlaspace(ScrArea *sa, void *spacedata)
draw_cfra_action();
/* draw markers */
- draw_markers_timespace();
+ draw_markers_timespace(0);
/* Draw preview 'curtains' */
draw_anim_preview_timespace();
diff --git a/source/blender/src/drawseq.c b/source/blender/src/drawseq.c
index 8159d0fb999..4d21418b7fa 100644
--- a/source/blender/src/drawseq.c
+++ b/source/blender/src/drawseq.c
@@ -76,6 +76,7 @@
#include "BSE_seqeffects.h"
#include "BSE_seqscopes.h"
#include "BSE_seqaudio.h"
+#include "BSE_time.h"
#include "IMB_imbuf_types.h"
#include "IMB_imbuf.h"
@@ -883,7 +884,7 @@ static void draw_extra_seqinfo(void)
yfac= G.v2d->cur.ymax - G.v2d->cur.ymin;
yfac/= (float)(G.v2d->mask.ymax-G.v2d->mask.ymin);
- yco= G.v2d->cur.ymin+10*yfac;
+ yco= G.v2d->cur.ymin+40*yfac;
BIF_ThemeColor(TH_TEXT_HI);
@@ -1230,10 +1231,10 @@ static void seq_panel_properties(short cntrl) // SEQ_HANDLER_PROPERTIES
uiDefButI(block, ROW, SEQ_BUT_EFFECT, "Percent", 10, 30, 150, 19, &transform->percent, 0.0, 1.0, 0.0, 0.0, "Percent Translate");
uiDefButI(block, ROW, SEQ_BUT_EFFECT, "Pixels", 160, 30, 150, 19, &transform->percent, 0.0, 0.0, 0.0, 0.0, "Pixels Translate");
if(transform->percent==1){
- uiDefButF(block, NUM, SEQ_BUT_EFFECT, "x Start:", 10,10,150,19, &transform->xIni, -100.0, 100.0, 0, 0, "X Position Start");
- uiDefButF(block, NUM, SEQ_BUT_EFFECT, "x End:", 160,10,150,19, &transform->xFin, -100.0, 100.0, 0, 0, "X Position End");
- uiDefButF(block, NUM, SEQ_BUT_EFFECT, "y Start:", 10,-10,150,19, &transform->yIni, -100.0, 100.0, 0, 0, "Y Position Start");
- uiDefButF(block, NUM, SEQ_BUT_EFFECT, "y End:", 160,-10,150,19, &transform->yFin, -100.0, 100.0, 0, 0, "Y Position End");
+ uiDefButF(block, NUM, SEQ_BUT_EFFECT, "x Start:", 10,10,150,19, &transform->xIni, -500.0, 500.0, 0, 0, "X Position Start");
+ uiDefButF(block, NUM, SEQ_BUT_EFFECT, "x End:", 160,10,150,19, &transform->xFin, -500.0, 500.0, 0, 0, "X Position End");
+ uiDefButF(block, NUM, SEQ_BUT_EFFECT, "y Start:", 10,-10,150,19, &transform->yIni, -500.0, 500.0, 0, 0, "Y Position Start");
+ uiDefButF(block, NUM, SEQ_BUT_EFFECT, "y End:", 160,-10,150,19, &transform->yFin, -500.0, 500.0, 0, 0, "Y Position End");
}else{
uiDefButF(block, NUM, SEQ_BUT_EFFECT, "x Start:", 10,10,150,19, &transform->xIni, -10000.0, 10000.0, 0, 0, "X Position Start");
uiDefButF(block, NUM, SEQ_BUT_EFFECT, "x End:", 160,10,150,19, &transform->xFin, -10000.0, 10000.0, 0, 0, "X Position End");
@@ -1444,7 +1445,7 @@ void drawseqspace(ScrArea *sa, void *spacedata)
draw_extra_seqinfo();
/* Draw markers */
- draw_markers_timespace();
+ draw_markers_timespace(1);
/* restore viewport */
mywinset(sa->win);
diff --git a/source/blender/src/drawsound.c b/source/blender/src/drawsound.c
index 1fe10bf2c17..e5b1026e72a 100644
--- a/source/blender/src/drawsound.c
+++ b/source/blender/src/drawsound.c
@@ -219,7 +219,7 @@ void drawsoundspace(ScrArea *sa, void *spacedata)
}
draw_cfra_sound(spacedata);
- draw_markers_timespace();
+ draw_markers_timespace(0);
/* restore viewport */
mywinset(curarea->win);
diff --git a/source/blender/src/drawtime.c b/source/blender/src/drawtime.c
index 62b568e6721..9ad24b54ad8 100644
--- a/source/blender/src/drawtime.c
+++ b/source/blender/src/drawtime.c
@@ -133,7 +133,7 @@ static void draw_cfra_time(SpaceTime *stime)
}
-static void draw_marker(TimeMarker *marker)
+static void draw_marker(TimeMarker *marker, int lines)
{
float xpos, ypixels, xscale, yscale;
@@ -145,10 +145,25 @@ static void draw_marker(TimeMarker *marker)
yscale = (G.v2d->mask.ymax-G.v2d->mask.ymin)/(G.v2d->cur.ymax-G.v2d->cur.ymin);
glScalef( 1.0/xscale, 1.0/yscale, 1.0);
-
+
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+ /* verticle line */
+ if (lines) {
+ setlinestyle(3);
+ if(marker->flag & SELECT)
+ glColor4ub(255,255,255, 96);
+ else
+ glColor4ub(0,0,0, 96);
+
+ glBegin(GL_LINES);
+ glVertex2f((xpos*xscale)+0.5, 12);
+ glVertex2f((xpos*xscale)+0.5, 34*yscale); /* a bit lazy but we know it cant be greater then 34 strips high*/
+ glEnd();
+ setlinestyle(0);
+ }
+
/* 5 px to offset icon to align properly, space / pixels corrects for zoom */
if(marker->flag & SELECT)
BIF_icon_draw(xpos*xscale-5.0, 12.0, ICON_MARKER_HLT);
@@ -176,24 +191,24 @@ static void draw_marker(TimeMarker *marker)
glScalef(xscale, yscale, 1.0);
}
-static void draw_markers_time(void)
+static void draw_markers_time(int lines)
{
TimeMarker *marker;
/* unselected markers are drawn at the first time */
for(marker= G.scene->markers.first; marker; marker= marker->next) {
- if(!(marker->flag & SELECT)) draw_marker(marker);
+ if(!(marker->flag & SELECT)) draw_marker(marker, lines);
}
/* selected markers are drawn later ... selected markers have to cover unselected
* markers laying at the same position as selected markers
* (jiri: it is hack, it could be solved better) */
for(marker= G.scene->markers.first; marker; marker= marker->next) {
- if(marker->flag & SELECT) draw_marker(marker);
+ if(marker->flag & SELECT) draw_marker(marker, lines);
}
}
-void draw_markers_timespace()
+void draw_markers_timespace(int lines)
{
TimeMarker *marker;
float yspace, ypixels;
@@ -208,13 +223,13 @@ void draw_markers_timespace()
/* unselected markers are drawn at the first time */
for(marker= G.scene->markers.first; marker; marker= marker->next) {
- if(!(marker->flag & SELECT)) draw_marker(marker);
+ if(!(marker->flag & SELECT)) draw_marker(marker, lines);
}
/* selected markers are drawn later ... selected markers have to cover unselected
* markers laying at the same position as selected markers */
for(marker= G.scene->markers.first; marker; marker= marker->next) {
- if(marker->flag & SELECT) draw_marker(marker);
+ if(marker->flag & SELECT) draw_marker(marker, lines);
}
glTranslatef(0.0f, -G.v2d->cur.ymin, 0.0f);
@@ -386,7 +401,7 @@ void drawtimespace(ScrArea *sa, void *spacedata)
draw_cfra_time(spacedata);
draw_ob_keys();
- draw_markers_time();
+ draw_markers_time(0);
/* restore viewport */
mywinset(curarea->win);
diff --git a/source/blender/src/editseq.c b/source/blender/src/editseq.c
index 9bf5ee7a611..193a0c8b62e 100644
--- a/source/blender/src/editseq.c
+++ b/source/blender/src/editseq.c
@@ -2625,6 +2625,7 @@ static void transform_grab_xlimits(Sequence *seq, int leftflag, int rightflag)
void transform_seq(int mode, int context)
{
+ SpaceSeq *sseq= curarea->spacedata.first;
Sequence *seq;
Editing *ed;
float dx, dy, dvec[2], div;
@@ -2636,6 +2637,11 @@ void transform_seq(int mode, int context)
char str[32];
char side; /* for extend mode only - use to know which side to extend on */
+ /* for markers */
+ int *oldframe, totmark, a;
+ TimeMarker *marker;
+
+
if(mode!='g' && mode!='e') return; /* from gesture */
/* which seqs are involved */
@@ -2672,7 +2678,7 @@ void transform_seq(int mode, int context)
}
}
END_SEQ
-
+
getmouseco_areawin(mval);
/* choose the side based on which side of the playhead the mouse is on */
@@ -2682,6 +2688,31 @@ void transform_seq(int mode, int context)
side = (xmouse > CFRA) ? 'R' : 'L';
}
+ /* Markers */
+ if (sseq->flag & SEQ_MARKER_TRANS) {
+ for(marker= G.scene->markers.first; marker; marker= marker->next) {
+ if(marker->flag & SELECT) totmark++;
+ }
+
+ oldframe= MEM_mallocN(totmark*sizeof(int), "marker array");
+ for(a=0, marker= G.scene->markers.first; marker; marker= marker->next) {
+ if(marker->flag & SELECT) {
+ if (mode=='e') {
+
+ /* when extending, invalidate markers on the other side by using an invalid frame value */
+ if ((side == 'L' && marker->frame > CFRA) || (side == 'R' && marker->frame < CFRA)) {
+ oldframe[a] = MAXFRAME+1;
+ } else {
+ oldframe[a]= marker->frame;
+ }
+ } else {
+ oldframe[a]= marker->frame;
+ }
+ a++;
+ }
+ }
+ }
+
xo=xn= mval[0];
yo=yn= mval[1];
dvec[0]= dvec[1]= 0.0;
@@ -2747,6 +2778,16 @@ void transform_seq(int mode, int context)
}
}
END_SEQ
+
+ /* Markers */
+ if (sseq->flag & SEQ_MARKER_TRANS) {
+ for(a=0, marker= G.scene->markers.first; marker; marker= marker->next) {
+ if(marker->flag & SELECT) {
+ marker->frame= oldframe[a] + ix;
+ a++;
+ }
+ }
+ }
/* Extend, grabs one side of the current frame */
} else if (mode=='e') {
int cfra = CFRA;
@@ -2840,6 +2881,16 @@ void transform_seq(int mode, int context)
}
}
END_SEQ
+
+ /* markers */
+ if (sseq->flag & SEQ_MARKER_TRANS) {
+ for(a=0, marker= G.scene->markers.first; marker; marker= marker->next) {
+ if(marker->flag & SELECT && (oldframe[a] != MAXFRAME+1)) {
+ marker->frame= oldframe[a] + ix;
+ }
+ a++;
+ }
+ }
}
sprintf(str, "X: %d Y: %d ", ix, iy);
@@ -2919,9 +2970,19 @@ void transform_seq(int mode, int context)
else if(seq->seq2 && seq->seq2->flag & SELECT) calc_sequence(seq);
else if(seq->seq3 && seq->seq3->flag & SELECT) calc_sequence(seq);
}
-
}
END_SEQ
+
+
+ /* Markers */
+ if (sseq->flag & SEQ_MARKER_TRANS) {
+ for(a=0, marker= G.scene->markers.first; marker; marker= marker->next) {
+ if(marker->flag & SELECT && (oldframe[a] != MAXFRAME+1)) {
+ marker->frame= oldframe[a];
+ }
+ a++;
+ }
+ }
} else {
/* images, effects and overlap */
@@ -2953,6 +3014,9 @@ void transform_seq(int mode, int context)
G.moving= 0;
MEM_freeN(transmain);
+ if (sseq->flag & SEQ_MARKER_TRANS)
+ MEM_freeN(transmain);
+
if (mode=='g')
BIF_undo_push("Transform Grab, Sequencer");
else if (mode=='e')
diff --git a/source/blender/src/header_seq.c b/source/blender/src/header_seq.c
index 6864268ffa8..0c7c59999cf 100644
--- a/source/blender/src/header_seq.c
+++ b/source/blender/src/header_seq.c
@@ -138,12 +138,12 @@ static uiBlock *seq_viewmenu(void *arg_unused)
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "View Selected|NumPad .", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, "");
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-
+
/* Lock Time */
uiDefIconTextBut(block, BUTM, 1, (G.v2d->flag & V2D_VIEWLOCK)?ICON_CHECKBOX_HLT:ICON_CHECKBOX_DEHLT,
"Lock Time to Other Windows|", 0, yco-=20,
menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
-
+
/* Draw time or frames.*/
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
@@ -509,6 +509,8 @@ static uiBlock *seq_editmenu(void *arg_unused)
static void do_seq_markermenu(void *arg, int event)
{
+ SpaceSeq *sseq= curarea->spacedata.first;
+
switch(event)
{
case 1:
@@ -526,6 +528,10 @@ static void do_seq_markermenu(void *arg, int event)
case 5:
transform_markers('g', 0);
break;
+ case 6:
+ sseq->flag ^= SEQ_MARKER_TRANS;
+ break;
+
}
allqueue(REDRAWMARKER, 0);
@@ -535,6 +541,8 @@ static uiBlock *seq_markermenu(void *arg_unused)
{
uiBlock *block;
short yco= 0, menuwidth=120;
+
+ SpaceSeq *sseq= curarea->spacedata.first;
block= uiNewBlock(&curarea->uiblocks, "ipo_markermenu",
UI_EMBOSSP, UI_HELV, curarea->headwin);
@@ -554,10 +562,15 @@ static uiBlock *seq_markermenu(void *arg_unused)
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Grab/Move Marker|Ctrl G", 0, yco-=20,
menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
+ uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
+
+ uiDefIconTextBut(block, BUTM, 1, (sseq->flag & SEQ_MARKER_TRANS)?ICON_CHECKBOX_HLT:ICON_CHECKBOX_DEHLT,
+ "Transform Markers", 0, yco-=20,
+ menuwidth, 19, NULL, 0.0, 0.0, 1, 6, "");
+
if(curarea->headertype==HEADERTOP) {
uiBlockSetDirection(block, UI_DOWN);
- }
- else {
+ } else {
uiBlockSetDirection(block, UI_TOP);
uiBlockFlipOrder(block);
}
@@ -693,6 +706,8 @@ void seq_buttons()
uiDefIconBut(block, BUT, B_IPOBORDER, ICON_BORDERMOVE, xco+=XIC,0,XIC,YIC, 0, 0, 0, 0, 0, "Zooms view to fit area");
uiBlockEndAlign(block);
+ /* CLEAR MEM */
+ xco+= 8;
/* CLEAR MEM */
xco+= 8;
diff --git a/source/blender/src/space.c b/source/blender/src/space.c
index 9ccbf169cea..b24fa7eaa9b 100644
--- a/source/blender/src/space.c
+++ b/source/blender/src/space.c
@@ -4506,12 +4506,17 @@ static void winqreadseqspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
break;
case AKEY:
- if(sseq->mainb) break;
- if((G.qual==LR_SHIFTKEY)) {
- add_sequence(-1);
+ if (G.qual == LR_CTRLKEY) {
+ deselect_markers(1, 0);
+ allqueue(REDRAWMARKER, 0);
+ } else {
+ if(sseq->mainb) break;
+ if((G.qual==LR_SHIFTKEY)) {
+ add_sequence(-1);
+ } else if((G.qual==0)) {
+ swap_select_seq();
+ }
}
- else if((G.qual==0))
- swap_select_seq();
break;
case SPACEKEY:
if (G.qual==0) {