[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [10864] trunk/blender/source/blender: Bugfix #6799

Ton Roosendaal ton at blender.org
Sun Jun 3 10:34:33 CEST 2007


Revision: 10864
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=10864
Author:   ton
Date:     2007-06-03 10:34:32 +0200 (Sun, 03 Jun 2007)

Log Message:
-----------
Bugfix #6799

Particle system was messing up depsgraph tags, causing bad results
in commandline renders especially (or in rendering first frame of
animation).

Fixed with introducing a temp storage tag in Objects. The real fix
should be to make particle systems behave nice inside the depsgraph.

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/intern/effect.c
    trunk/blender/source/blender/makesdna/DNA_object_types.h

Modified: trunk/blender/source/blender/blenkernel/intern/effect.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/effect.c	2007-06-02 22:53:19 UTC (rev 10863)
+++ trunk/blender/source/blender/blenkernel/intern/effect.c	2007-06-03 08:34:32 UTC (rev 10864)
@@ -1541,6 +1541,7 @@
 
 
 /* WARN: this function stores data in ob->id.idnew! */
+/* error: this function changes ob->recalc of other objects... */
 static pMatrixCache *cache_object_matrices(Object *ob, int start, int end)
 {
 	pMatrixCache *mcache, *mc;
@@ -1561,16 +1562,17 @@
 	sfo= ob->sf;
 	ob->sf= 0.0f;
 
-	/* clear storage */
-	for(obcopy= G.main->object.first; obcopy; obcopy= obcopy->id.next) 
+	/* clear storage, copy recalc tag (bad loop) */
+	for(obcopy= G.main->object.first; obcopy; obcopy= obcopy->id.next) {
 		obcopy->id.newid= NULL;
+		obcopy->recalco= obcopy->recalc;
+		obcopy->recalc= 0;
+	}
 	
 	/* all objects get tagged recalc that influence this object (does group too) */
-	/* another hack; while transform you cannot call this, it sets own recalc flags */
-	if(G.moving==0) {
-		ob->recalc |= OB_RECALC_OB; /* make sure a recalc gets flushed */
-		DAG_object_update_flags(G.scene, ob, -1);
-	}
+	/* note that recalco has the real recalc tags, set by callers of this function */
+	ob->recalc |= OB_RECALC_OB; /* make sure a recalc gets flushed */
+	DAG_object_update_flags(G.scene, ob, -1);
 	
 	for(G.scene->r.cfra= start; G.scene->r.cfra<=end; G.scene->r.cfra++, mc++) {
 		
@@ -1649,7 +1651,12 @@
 				}
 			}
 		}
-	}	
+	}
+	
+	/* copy recalc tag (bad loop) */
+	for(obcopy= G.main->object.first; obcopy; obcopy= obcopy->id.next)
+		obcopy->recalc= obcopy->recalco;
+	
 	return mcache;
 }
 
@@ -2088,6 +2095,7 @@
 	/* reset deflector cache */
 	for(base= G.scene->base.first; base; base= base->next) {
 		if(base->object->sumohandle) {
+			
 			MEM_freeN(base->object->sumohandle);
 			base->object->sumohandle= NULL;
 		}

Modified: trunk/blender/source/blender/makesdna/DNA_object_types.h
===================================================================
--- trunk/blender/source/blender/makesdna/DNA_object_types.h	2007-06-02 22:53:19 UTC (rev 10863)
+++ trunk/blender/source/blender/makesdna/DNA_object_types.h	2007-06-03 08:34:32 UTC (rev 10864)
@@ -204,7 +204,7 @@
 
 	short shapenr, shapeflag;	/* current shape key for menu or pinned, flag for pinning */
 	float smoothresh;			/* smoothresh is phong interpolation ray_shadow correction in render */
-	int pad4;
+	short recalco, pad4;		/* recalco for temp storage of ob->recalc, bad design warning */
 	
 	struct FluidsimSettings *fluidsimSettings; /* if fluidsim enabled, store additional settings */
   





More information about the Bf-blender-cvs mailing list