[Bf-blender-cvs] [8620008] master: Fix T41113: Hide doesn't work on particle systems

Bastien Montagne noreply at git.blender.org
Fri Jul 18 00:07:26 CEST 2014


Commit: 8620008ccdda5ca7d7b83cb6b1a24e62f881ee84
Author: Bastien Montagne
Date:   Thu Jul 17 23:49:08 2014 +0200
https://developer.blender.org/rB8620008ccdda5ca7d7b83cb6b1a24e62f881ee84

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.

===================================================================

M	source/blender/editors/space_view3d/drawobject.c
M	source/blender/editors/space_view3d/view3d_draw.c

===================================================================

diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c
index 196507f..c1689ef 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 4adfa845..dd08339 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);




More information about the Bf-blender-cvs mailing list