Pointcache:
authorDaniel Genrich <daniel.genrich@gmx.net>
Sun, 13 Sep 2009 23:58:03 +0000 (23:58 +0000)
committerDaniel Genrich <daniel.genrich@gmx.net>
Sun, 13 Sep 2009 23:58:03 +0000 (23:58 +0000)
* reset on object transformations

source/blender/editors/transform/transform_conversions.c

index 6386c0d4eb72d399e299652a6fb999e31ac73396..776f2e47d1e2c5ba0b082ce75caded2fdd1a1a86 100644 (file)
@@ -4946,8 +4946,18 @@ void special_aftertrans_update(TransInfo *t)
                        ob= base->object;
 
                        if (base->flag & SELECT && (t->mode != TFM_DUMMY)) {
+                               ListBase pidlist;
+                               PTCacheID *pid;
+
+                               /* flag object caches as outdated */
+                               BKE_ptcache_ids_from_object(&pidlist, ob);
+                               for(pid=pidlist.first; pid; pid=pid->next) {
+                                       if(pid->type != PTCACHE_TYPE_PARTICLES) /* particles don't need reset on geometry change */
+                                               pid->cache->flag |= PTCACHE_OUTDATED;
+                               }
+
                                /* pointcache refresh */
-                               if (BKE_ptcache_object_reset(scene, ob, PTCACHE_RESET_DEPSGRAPH))
+                               if (BKE_ptcache_object_reset(scene, ob, PTCACHE_RESET_OUTDATED))
                                        ob->recalc |= OB_RECALC_DATA;
 
                                /* Needed for proper updating of "quick cached" dynamics. */