Fix T40850: object emitter of particles not visible in viewport when GLSL and "only render" checked.

Objects were hidden in "only render" mode if they were duplicators. This is correct in general, but for particles should be disabled by the "show emitter" option.
This commit is contained in:
Lukas Tönne 2014-06-29 13:24:50 +02:00
parent 50ca320f57
commit 4236e3bebf
Notes: blender-bot 2023-02-14 10:24:52 +01:00
Referenced by issue #40850, object emitter of particles not visible in viewport when GLSL and "only render" checked
1 changed files with 14 additions and 7 deletions

View File

@ -7171,16 +7171,19 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, const short
const bool is_obact = (ob == OBACT);
const bool render_override = (v3d->flag2 & V3D_RENDER_OVERRIDE) != 0;
const bool is_picking = (G.f & G_PICKSEL) != 0;
bool skip_object = false;
bool particle_skip_object = false; /* Draw particles but not their emitter object. */
if (ob != scene->obedit) {
if (ob->restrictflag & OB_RESTRICT_VIEW) {
return;
}
else if (render_override && ((ob->restrictflag & OB_RESTRICT_RENDER) ||
(ob->transflag & OB_DUPLI)))
{
return;
if (ob->restrictflag & OB_RESTRICT_VIEW)
skip_object = true;
if (render_override) {
if (ob->restrictflag & OB_RESTRICT_RENDER)
skip_object = true;
if (ob->transflag & OB_DUPLI)
skip_object = true; /* note: can be reset by particle "draw emitter" below */
}
}
@ -7197,6 +7200,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, const short
for (psys = ob->particlesystem.first; psys; psys = psys->next) {
/* Once we have found a psys which renders its emitter object, we are done. */
if (psys->part->draw & PART_DRAW_EMITTER) {
skip_object = false;
particle_skip_object = false;
break;
}
@ -7204,6 +7208,9 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, const short
}
}
if (skip_object)
return;
/* xray delay? */
if ((dflag & DRAW_PICKING) == 0 && (base->flag & OB_FROMDUPLI) == 0 && (v3d->flag2 & V3D_RENDER_SHADOW) == 0) {
/* don't do xray in particle mode, need the z-buffer */