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.
This commit is contained in:
parent
1097a3f70d
commit
8620008ccd
Notes:
blender-bot
2023-02-14 10:20:02 +01:00
Referenced by issue #41113, Hide doesn't work on particle systems
|
@ -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 */
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue