forked from bartvdbraak/blender
draw muted strips faded. hkey added alt+hkey to mute and un-mute strips, Mkey is used for metastrips. would be nice to make this similar to object mode restrict render option.
This commit is contained in:
parent
053dca1fa9
commit
c11fce1a9f
@ -62,6 +62,7 @@ void mouse_select_seq(void);
|
||||
void no_gaps(void);
|
||||
void seq_snap(short event);
|
||||
void seq_snap_menu(void);
|
||||
void seq_mute_sel( int mute );
|
||||
void set_filter_seq(void);
|
||||
void swap_select_seq(void);
|
||||
void touch_seq_files(void);
|
||||
|
@ -92,6 +92,24 @@
|
||||
#define SEQ_STRIP_OFSBOTTOM 0.2
|
||||
#define SEQ_STRIP_OFSTOP 0.8
|
||||
|
||||
static GLubyte halftone[] = {
|
||||
0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55,
|
||||
0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55,
|
||||
0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55,
|
||||
0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55,
|
||||
0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55,
|
||||
0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55,
|
||||
0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55,
|
||||
0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55,
|
||||
0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55,
|
||||
0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55,
|
||||
0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55,
|
||||
0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55,
|
||||
0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55,
|
||||
0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55,
|
||||
0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55,
|
||||
0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55};
|
||||
|
||||
/* Note, Dont use WHILE_SEQ while drawing! - it messes up transform, - Campbell */
|
||||
|
||||
int no_rightbox=0, no_leftbox= 0;
|
||||
@ -220,6 +238,14 @@ static void drawmeta_contents(Sequence *seqm, float x1, float y1, float x2, floa
|
||||
|
||||
dx= (x2-x1)/nr;
|
||||
|
||||
if (seqm->flag & SEQ_MUTE) {
|
||||
glEnable(GL_POLYGON_STIPPLE);
|
||||
glPolygonStipple(halftone);
|
||||
|
||||
glEnable(GL_LINE_STIPPLE);
|
||||
glLineStipple(1, 0x8888);
|
||||
}
|
||||
|
||||
for (seq= seqm->seqbase.first; seq; seq= seq->next) {
|
||||
get_seq_color3ubv(seq, col);
|
||||
|
||||
@ -234,6 +260,11 @@ static void drawmeta_contents(Sequence *seqm, float x1, float y1, float x2, floa
|
||||
|
||||
x1+= dx;
|
||||
}
|
||||
|
||||
if (seqm->flag & SEQ_MUTE) {
|
||||
glDisable(GL_POLYGON_STIPPLE);
|
||||
glDisable(GL_LINE_STIPPLE);
|
||||
}
|
||||
}
|
||||
|
||||
static void drawseqwave(Sequence *seq, float x1, float y1, float x2, float y2, int winx)
|
||||
@ -603,6 +634,11 @@ static void draw_shadedstrip(Sequence *seq, char *col, float x1, float y1, float
|
||||
{
|
||||
float ymid1, ymid2;
|
||||
|
||||
if (seq->flag & SEQ_MUTE) {
|
||||
glEnable(GL_POLYGON_STIPPLE);
|
||||
glPolygonStipple(halftone);
|
||||
}
|
||||
|
||||
ymid1 = (y2-y1)*0.25 + y1;
|
||||
ymid2 = (y2-y1)*0.65 + y1;
|
||||
|
||||
@ -644,6 +680,9 @@ static void draw_shadedstrip(Sequence *seq, char *col, float x1, float y1, float
|
||||
|
||||
glEnd();
|
||||
|
||||
if (seq->flag & SEQ_MUTE) {
|
||||
glDisable(GL_POLYGON_STIPPLE);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@ -701,8 +740,17 @@ static void draw_seq_strip(Sequence *seq, ScrArea *sa, SpaceSeq *sseq, int outli
|
||||
BIF_GetColorPtrBlendShade3ubv(col, col, col, 0.0, outline_tint);
|
||||
|
||||
glColor3ubv((GLubyte *)col);
|
||||
|
||||
if (seq->flag & SEQ_MUTE) {
|
||||
glEnable(GL_LINE_STIPPLE);
|
||||
glLineStipple(1, 0x8888);
|
||||
}
|
||||
|
||||
gl_round_box_shade(GL_LINE_LOOP, x1, y1, x2, y2, 0.0, 0.1, 0.0);
|
||||
|
||||
|
||||
if (seq->flag & SEQ_MUTE) {
|
||||
glDisable(GL_LINE_STIPPLE);
|
||||
}
|
||||
|
||||
/* calculate if seq is long enough to print a name */
|
||||
x1= seq->startdisp+seq->handsize;
|
||||
|
@ -3685,6 +3685,23 @@ void seq_snap(short event)
|
||||
allqueue(REDRAWSEQ, 0);
|
||||
}
|
||||
|
||||
void seq_mute_sel(int mute) {
|
||||
Editing *ed;
|
||||
Sequence *seq;
|
||||
|
||||
ed= G.scene->ed;
|
||||
if(!ed) return NULL;
|
||||
|
||||
for(seq= ed->seqbasep->first; seq; seq= seq->next) {
|
||||
if ((seq->flag & SELECT) && (seq->flag & SEQ_LOCK)==0) {
|
||||
if (mute) seq->flag |= SEQ_MUTE;
|
||||
else seq->flag &= ~SEQ_MUTE;
|
||||
}
|
||||
}
|
||||
BIF_undo_push(mute?"Mute Strips, Sequencer":"UnMute Strips, Sequencer");
|
||||
allqueue(REDRAWSEQ, 0);
|
||||
}
|
||||
|
||||
void borderselect_seq(void)
|
||||
{
|
||||
Sequence *seq;
|
||||
|
@ -4798,6 +4798,13 @@ static void winqreadseqspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
|
||||
doredraw= 1;
|
||||
}
|
||||
break;
|
||||
case HKEY: /* hide==mute? - not that nice but MKey us used for meta :/ */
|
||||
if((G.qual==0)) {
|
||||
seq_mute_sel(1);
|
||||
} else if((G.qual==LR_ALTKEY)) {
|
||||
seq_mute_sel(0);
|
||||
}
|
||||
break;
|
||||
case XKEY:
|
||||
case DELKEY:
|
||||
if(G.qual==0) {
|
||||
|
Loading…
Reference in New Issue
Block a user