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

Lukas Tönne noreply at git.blender.org
Wed Mar 18 16:20:43 CET 2015


Commit: 878d09e65bc88a087ccc21fa8b43f76767334330
Author: Lukas Tönne
Date:   Wed Mar 18 16:17:15 2015 +0100
Branches: alembic_pointcache
https://developer.blender.org/rB878d09e65bc88a087ccc21fa8b43f76767334330

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 61c9891..ff664c8 100644
--- a/source/blender/editors/space_view3d/drawobject.c
+++ b/source/blender/editors/space_view3d/drawobject.c
@@ -7611,7 +7611,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 297e586..a6d6cef 100644
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@ -2041,7 +2041,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. */
 
@@ -2099,6 +2099,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 e8e5be8..fd151c7 100644
--- a/source/blender/makesdna/DNA_object_types.h
+++ b/source/blender/makesdna/DNA_object_types.h
@@ -541,6 +541,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