Bugfix #3304
Actually nice feature too: when using Scene "Set" option, that scene draws its transparent and x-ray stuff independent of the 'foreground' scene. That means that x-ray in a set will be always over the set objects, but stays behind the current scene. For transparent it works the same though... meaning that solid objects from the foreground scene will always draw over transparent from the "Set". Note; this only is true for the 3d window, or the OpenGL render, not for actual rendering of course.
This commit is contained in:
@@ -2154,9 +2154,6 @@ void drawview3dspace(ScrArea *sa, void *spacedata)
|
||||
/* draw set first */
|
||||
if(G.scene->set) {
|
||||
|
||||
/* patch: color remains constant */
|
||||
G.f |= G_PICKSEL;
|
||||
|
||||
base= G.scene->set->base.first;
|
||||
while(base) {
|
||||
|
||||
@@ -2164,6 +2161,12 @@ void drawview3dspace(ScrArea *sa, void *spacedata)
|
||||
|
||||
object_handle_update(base->object);
|
||||
|
||||
/* patch: color remains constant, only set it for wire, so transparant works */
|
||||
if(v3d->zbuf && base->object->dt<=OB_WIRE)
|
||||
G.f |= G_PICKSEL;
|
||||
else
|
||||
G.f &= ~G_PICKSEL;
|
||||
|
||||
cpack(0x404040);
|
||||
draw_object(base);
|
||||
|
||||
@@ -2189,6 +2192,10 @@ void drawview3dspace(ScrArea *sa, void *spacedata)
|
||||
}
|
||||
|
||||
G.f &= ~G_PICKSEL;
|
||||
|
||||
/* Transp and X-ray afterdraw stuff */
|
||||
view3d_draw_xray(v3d); // clears zbuffer if it is used!
|
||||
view3d_draw_transp(v3d);
|
||||
}
|
||||
|
||||
/* update all objects, ipos, matrices, displists, etc. Flags set by depgraph or manual, no layer check here, gets correct flushed */
|
||||
@@ -2354,9 +2361,6 @@ void drawview3d_render(struct View3D *v3d)
|
||||
/* first draw set */
|
||||
if(G.scene->set) {
|
||||
|
||||
/* patch: color remains constant */
|
||||
G.f |= G_PICKSEL;
|
||||
|
||||
base= G.scene->set->base.first;
|
||||
while(base) {
|
||||
if(v3d->lay & base->lay) {
|
||||
@@ -2364,6 +2368,12 @@ void drawview3d_render(struct View3D *v3d)
|
||||
else {
|
||||
where_is_object(base->object);
|
||||
|
||||
/* patch: color remains constant, only set it for wire, so transparant works */
|
||||
if(v3d->zbuf && base->object->dt<=OB_WIRE)
|
||||
G.f |= G_PICKSEL;
|
||||
else
|
||||
G.f &= ~G_PICKSEL;
|
||||
|
||||
cpack(0x404040);
|
||||
draw_object(base);
|
||||
|
||||
@@ -2386,6 +2396,10 @@ void drawview3d_render(struct View3D *v3d)
|
||||
base= base->next;
|
||||
}
|
||||
|
||||
/* Transp and X-ray afterdraw stuff */
|
||||
view3d_draw_xray(v3d); // clears zbuffer if it is used!
|
||||
view3d_draw_transp(v3d);
|
||||
|
||||
G.f &= ~G_PICKSEL;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user