[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [51409] trunk/blender/source/blender: Better fix for #32846.

Lukas Toenne lukas.toenne at googlemail.com
Thu Oct 18 17:54:25 CEST 2012


Revision: 51409
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=51409
Author:   lukastoenne
Date:     2012-10-18 15:54:24 +0000 (Thu, 18 Oct 2012)
Log Message:
-----------
Better fix for #32846. Instead of using time change or object recalc condition, set an explicit object flag to disable particle system modifier update during dupli list creation. This is more transparent and should prevent issues with hair path generation being skipped.

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/intern/DerivedMesh.c
    trunk/blender/source/blender/makesdna/DNA_object_types.h
    trunk/blender/source/blender/modifiers/intern/MOD_particlesystem.c

Modified: trunk/blender/source/blender/blenkernel/intern/DerivedMesh.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/DerivedMesh.c	2012-10-18 15:00:32 UTC (rev 51408)
+++ trunk/blender/source/blender/blenkernel/intern/DerivedMesh.c	2012-10-18 15:54:24 UTC (rev 51409)
@@ -2249,8 +2249,16 @@
 {
 	DerivedMesh *final;
 
+	/* XXX hack
+	 * psys modifier updates particle state when called during dupli-list generation,
+	 * which can lead to wrong transforms. This disables particle system modifier execution.
+	 */
+	ob->transflag |= OB_NO_PSYS_UPDATE;
+
 	mesh_calc_modifiers(scene, ob, NULL, NULL, &final, 0, 1, 0, dataMask, -1, 0, 0);
 
+	ob->transflag &= ~OB_NO_PSYS_UPDATE;
+
 	return final;
 }
 

Modified: trunk/blender/source/blender/makesdna/DNA_object_types.h
===================================================================
--- trunk/blender/source/blender/makesdna/DNA_object_types.h	2012-10-18 15:00:32 UTC (rev 51408)
+++ trunk/blender/source/blender/makesdna/DNA_object_types.h	2012-10-18 15:54:24 UTC (rev 51409)
@@ -378,6 +378,7 @@
 #define OB_DUPLIPARTS		2048
 #define OB_RENDER_DUPLI		4096
 #define OB_NO_CONSTRAINTS	8192 /* runtime constraints disable */
+#define OB_NO_PSYS_UPDATE	16384 /* hack to work around particle issue */
 
 /* (short) ipoflag */
 /* XXX: many old flags for features removed due to incompatibility

Modified: trunk/blender/source/blender/modifiers/intern/MOD_particlesystem.c
===================================================================
--- trunk/blender/source/blender/modifiers/intern/MOD_particlesystem.c	2012-10-18 15:00:32 UTC (rev 51408)
+++ trunk/blender/source/blender/modifiers/intern/MOD_particlesystem.c	2012-10-18 15:54:24 UTC (rev 51409)
@@ -190,12 +190,7 @@
 		psmd->totdmface = psmd->dm->getNumTessFaces(psmd->dm);
 	}
 
-	/* skip the particle update if no timestep is performed or initialization required.
-	 * XXX this is a workaround for bug #32846, which is caused by modifier updates
-	 * during dupli-list generation (in cycles). The dupli-list generation can temporarily change
-	 * the ob->obmat matrix, which in turn leads to wrong particle states if used for reset ...
-	 */
-	if (psys->cfra != cfra || psys->recalc) {
+	if (!(ob->transflag & OB_NO_PSYS_UPDATE)) {
 		psmd->flag &= ~eParticleSystemFlag_psys_updated;
 		particle_system_update(md->scene, ob, psys);
 		psmd->flag |= eParticleSystemFlag_psys_updated;




More information about the Bf-blender-cvs mailing list