Patch #4870, by Roland Hess

NLA window now follows visibility for scene layers, cleaning up complex
files quite some. Only note we could make is if this could be optional,
sometimes it's also nice to see the entire scene.

Note for Roland: this is a recoded version, with about 10% of code :)
This commit is contained in:
2006-11-05 20:09:19 +00:00
parent 0d64b4a9f5
commit 2d0c6040da
2 changed files with 39 additions and 35 deletions

View File

@@ -245,35 +245,36 @@ static void draw_nla_strips_keys(SpaceNla *snla)
bActionStrip *strip; bActionStrip *strip;
int frame1_x, channel_y; int frame1_x, channel_y;
if (nla_filter(base)) { if (nla_filter(base)==0)
continue;
/* Draw the field */ /* Draw the field */
glEnable (GL_BLEND); glEnable (GL_BLEND);
if (TESTBASE_SAFE(base)) if (TESTBASE_SAFE(base))
glColor4ub (col1[0], col1[1], col1[2], 0x22); glColor4ub (col1[0], col1[1], col1[2], 0x22);
else else
glColor4ub (col2[0], col2[1], col2[2], 0x22); glColor4ub (col2[0], col2[1], col2[2], 0x22);
gla2DDrawTranslatePt(di, 1, y, &frame1_x, &channel_y); gla2DDrawTranslatePt(di, 1, y, &frame1_x, &channel_y);
glRectf(0, channel_y-NLACHANNELHEIGHT/2, frame1_x, channel_y+NLACHANNELHEIGHT/2); glRectf(0, channel_y-NLACHANNELHEIGHT/2, frame1_x, channel_y+NLACHANNELHEIGHT/2);
if (TESTBASE_SAFE(base)) if (TESTBASE_SAFE(base))
glColor4ub (col1[0], col1[1], col1[2], 0x44); glColor4ub (col1[0], col1[1], col1[2], 0x44);
else else
glColor4ub (col2[0], col2[1], col2[2], 0x44); glColor4ub (col2[0], col2[1], col2[2], 0x44);
glRectf(frame1_x, channel_y-NLACHANNELHEIGHT/2, G.v2d->hor.xmax, channel_y+NLACHANNELHEIGHT/2); glRectf(frame1_x, channel_y-NLACHANNELHEIGHT/2, G.v2d->hor.xmax, channel_y+NLACHANNELHEIGHT/2);
glDisable (GL_BLEND); glDisable (GL_BLEND);
/* Draw the ipo keys */ /* Draw the ipo keys */
draw_object_channel(di, ob, 0, y); draw_object_channel(di, ob, 0, y);
y-=NLACHANNELHEIGHT+NLACHANNELSKIP; y-=NLACHANNELHEIGHT+NLACHANNELSKIP;
}
/* Draw the action strip */ /* Draw the action strip */
if (ob->action){ if (ob->action) {
/* Draw the field */ /* Draw the field */
glEnable (GL_BLEND); glEnable (GL_BLEND);
@@ -733,16 +734,17 @@ int nla_filter (Base *base)
{ {
Object *ob = base->object; Object *ob = base->object;
if(ob->action || ob->nlastrips.first) if(base->lay & G.scene->lay) {
return 1; if(ob->action || ob->nlastrips.first)
return 1;
/* should become option */ /* should become option */
if (ob->ipo) if (ob->ipo)
return 1; return 1;
if (ob->constraintChannels.first)
return 1;
if (ob->constraintChannels.first)
return 1;
}
return 0; return 0;
} }

View File

@@ -185,7 +185,8 @@ void do_layer_buttons(short event)
scrarea_queue_headredraw(curarea); scrarea_queue_headredraw(curarea);
if(curarea->spacetype==SPACE_OOPS) allqueue(REDRAWVIEW3D, 1); /* 1==also do headwin */ if(curarea->spacetype==SPACE_OOPS) allqueue(REDRAWVIEW3D, 1); /* 1==also do headwin */
if(G.vd->drawtype == OB_SHADED) reshadeall_displist(); if(G.vd->drawtype == OB_SHADED) reshadeall_displist();
allqueue(REDRAWNLA, 0);
} }
static void do_view3d_view_cameracontrolsmenu(void *arg, int event) static void do_view3d_view_cameracontrolsmenu(void *arg, int event)
@@ -4484,6 +4485,7 @@ void do_view3d_buttons(short event)
DAG_scene_update_flags(G.scene, G.vd->lay); /* tags all that moves and flushes */ DAG_scene_update_flags(G.scene, G.vd->lay); /* tags all that moves and flushes */
allqueue(REDRAWOOPS, 0); allqueue(REDRAWOOPS, 0);
allqueue(REDRAWNLA, 0);
} }
break; break;
} }