diff options
author | Ton Roosendaal <ton@blender.org> | 2007-06-03 12:34:32 +0400 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2007-06-03 12:34:32 +0400 |
commit | 0016aa9e71fb371b6f0f50f4e8fa118f8179e19e (patch) | |
tree | b7154f8ae42f3474306022e50ae944d69840aca8 /source/blender/blenkernel/intern | |
parent | 98a77bc9c61197f0a143ccd23dfd67526bd8f552 (diff) |
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.
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r-- | source/blender/blenkernel/intern/effect.c | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/source/blender/blenkernel/intern/effect.c b/source/blender/blenkernel/intern/effect.c index 00b2eb9fbd9..f42d0fa79e2 100644 --- a/source/blender/blenkernel/intern/effect.c +++ b/source/blender/blenkernel/intern/effect.c @@ -1541,6 +1541,7 @@ typedef struct pMatrixCache { /* 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 @@ static pMatrixCache *cache_object_matrices(Object *ob, int start, int end) 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 @@ static pMatrixCache *cache_object_matrices(Object *ob, int start, int end) } } } - } + } + + /* 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 @@ void build_particle_system(Object *ob) /* 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; } |