From 8620008ccdda5ca7d7b83cb6b1a24e62f881ee84 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Thu, 17 Jul 2014 23:49:08 +0200 Subject: Fix T41113: Hide doesn't work on particle systems Particles could completely cancel Hide flag! 'Accumulative' bool is not a really good idea here, hide (or render-hide) are some kind of 'absolute' no-go. Found another issue in that area, duplicated objects would still show in 'render override' mode, when object was render-disabled. Hopefully things are better now. --- source/blender/editors/space_view3d/drawobject.c | 16 ++++++---------- source/blender/editors/space_view3d/view3d_draw.c | 1 + 2 files changed, 7 insertions(+), 10 deletions(-) (limited to 'source/blender/editors') diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index 196507f133c..c1689ef06db 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -7171,23 +7171,23 @@ 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; + const bool has_particles = (ob->particlesystem.first != NULL); bool particle_skip_object = false; /* Draw particles but not their emitter object. */ if (ob != scene->obedit) { if (ob->restrictflag & OB_RESTRICT_VIEW) - skip_object = true; + return; if (render_override) { if (ob->restrictflag & OB_RESTRICT_RENDER) - skip_object = true; + return; - if (ob->transflag & OB_DUPLI) - skip_object = true; /* note: can be reset by particle "draw emitter" below */ + if (!has_particles && (ob->transflag & OB_DUPLI)) + return; } } - if (ob->particlesystem.first) { + if (has_particles) { /* XXX particles are not safe for simultaneous threaded render */ if (G.is_rendering) { return; @@ -7200,7 +7200,6 @@ 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; } @@ -7208,9 +7207,6 @@ 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 */ diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index 4adfa845299..dd08339cc94 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -1981,6 +1981,7 @@ static void draw_dupli_objects_color( DupliApplyData *apply_data; if (base->object->restrictflag & OB_RESTRICT_VIEW) return; + if ((base->object->restrictflag & OB_RESTRICT_RENDER) && (v3d->flag2 & V3D_RENDER_OVERRIDE)) return; if (dflag & DRAW_CONSTCOLOR) { BLI_assert(color == TH_UNDEFINED); -- cgit v1.2.3