[Bf-blender-cvs] [a860678] gooseberry: Skip drawing of particle systems (including hair) when using cache duplis.

Lukas Tönne noreply at git.blender.org
Mon Mar 23 13:04:07 CET 2015


Commit: a86067888e510236f6e23bb8cde6e0c6dd1cca8f
Author: Lukas Tönne
Date:   Wed Mar 18 16:17:15 2015 +0100
Branches: gooseberry
https://developer.blender.org/rBa86067888e510236f6e23bb8cde6e0c6dd1cca8f

Skip drawing of particle systems (including hair) when using cache
duplis.

Particle systems can not be overridden from caches easily, there are too
many strings attached to the data and code to make this reliable.
Instead, a new simplified data structure for reading hair from caches
will be added, which replaces drawing and rendering of particle data.
The original particle data is not updated through duplis, so is usually
out of sync and should not be displayed.

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

M	source/blender/editors/space_view3d/drawobject.c
M	source/blender/editors/space_view3d/view3d_draw.c
M	source/blender/makesdna/DNA_object_types.h

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

diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c
index b44da8a..26bd448 100644
--- a/source/blender/editors/space_view3d/drawobject.c
+++ b/source/blender/editors/space_view3d/drawobject.c
@@ -8090,7 +8090,8 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, const short
 
 	/* code for new particle system */
 	if ((ob->particlesystem.first) &&
-	    (ob != scene->obedit))
+	    (ob != scene->obedit) &&
+	    !(base->flag & OB_FROMCACHE))
 	{
 		ParticleSystem *psys;
 
diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c
index 152293a..f6e1f7a 100644
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@ -2102,7 +2102,7 @@ static void draw_dupli_objects_color(
 		UI_GetThemeColorBlend3ubv(color, TH_BACK, 0.5f, color_rgb);
 	}
 
-	tbase.flag = OB_FROMDUPLI | base->flag;
+	tbase.flag |= OB_FROMDUPLI;
 	lb = object_duplilist(G.main->eval_ctx, scene, base->object);
 	// BLI_listbase_sort(lb, dupli_ob_sort); /* might be nice to have if we have a dupli list with mixed objects. */
 
@@ -2160,6 +2160,8 @@ static void draw_dupli_objects_color(
 		if (base->object->dup_cache) {
 			DupliObjectData *dob_data = BKE_dupli_cache_find_data(base->object->dup_cache, tbase.object);
 			if (dob_data->cache_dm) {
+				tbase.flag |= OB_FROMCACHE;
+				
 				tbase.object->derivedFinal = dob_data->cache_dm;
 				tbase.object->bb = bb_tmp = &dob_data->bb;
 			}
diff --git a/source/blender/makesdna/DNA_object_types.h b/source/blender/makesdna/DNA_object_types.h
index da5d03d..25c5e9b 100644
--- a/source/blender/makesdna/DNA_object_types.h
+++ b/source/blender/makesdna/DNA_object_types.h
@@ -553,6 +553,7 @@ enum {
 #define OB_DONE             (1 << 10)  /* unknown state, clear before use */
 /* #define OB_RADIO            (1 << 11) */  /* deprecated */
 #define OB_FROMGROUP        (1 << 12)
+#define OB_FROMCACHE        (1 << 13)
 
 /* WARNING - when adding flags check on PSYS_RECALC */
 /* ob->recalc (flag bits!) */




More information about the Bf-blender-cvs mailing list