[Bf-blender-cvs] [4236e3b] master: Fix T40850: object emitter of particles not visible in viewport when GLSL and "only render" checked.

Lukas Tönne noreply at git.blender.org
Sun Jun 29 13:31:55 CEST 2014


Commit: 4236e3bebf693912102f79102c1ae5389b7536c5
Author: Lukas Tönne
Date:   Sun Jun 29 13:24:50 2014 +0200
https://developer.blender.org/rB4236e3bebf693912102f79102c1ae5389b7536c5

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.

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

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

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

diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c
index 0e010ef..196507f 100644
--- a/source/blender/editors/space_view3d/drawobject.c
+++ b/source/blender/editors/space_view3d/drawobject.c
@@ -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 */




More information about the Bf-blender-cvs mailing list