diff options
Diffstat (limited to 'source/blender/editors/physics')
-rw-r--r-- | source/blender/editors/physics/particle_edit.c | 22 | ||||
-rw-r--r-- | source/blender/editors/physics/physics_fluid.c | 2 |
2 files changed, 18 insertions, 6 deletions
diff --git a/source/blender/editors/physics/particle_edit.c b/source/blender/editors/physics/particle_edit.c index d20e0e87934..b45b06d2a39 100644 --- a/source/blender/editors/physics/particle_edit.c +++ b/source/blender/editors/physics/particle_edit.c @@ -3663,6 +3663,8 @@ static void make_PTCacheUndo(PTCacheEdit *edit, PTCacheUndo *undo) for(; pm; pm=pm->next) { for(i=0; i<BPHYS_TOT_DATA; i++) pm->data[i] = MEM_dupallocN(pm->data[i]); + + pm->index_array = MEM_dupallocN(pm->index_array); } } @@ -3737,6 +3739,8 @@ static void get_PTCacheUndo(PTCacheEdit *edit, PTCacheUndo *undo) for(i=0; i<BPHYS_TOT_DATA; i++) pm->data[i] = MEM_dupallocN(pm->data[i]); + pm->index_array = MEM_dupallocN(pm->index_array); + BKE_ptcache_mem_init_pointers(pm); LOOP_POINTS { @@ -4001,12 +4005,20 @@ static void PE_create_particle_edit(Scene *scene, Object *ob, PointCache *cache, LOOP_POINTS { if(psys) { - pa = psys->particles + p; - if((pm->next && pm->next->frame < pa->time) - || (pm->prev && pm->prev->frame >= pa->dietime)) { - BKE_ptcache_mem_incr_pointers(pm); + if(pm->index_array) { + if(pm->index_array[p]) + BKE_ptcache_mem_seek_pointers(p, pm); + else continue; - } + } + else { + pa = psys->particles + p; + if((pm->next && pm->next->frame < pa->time) + || (pm->prev && pm->prev->frame >= pa->dietime)) { + BKE_ptcache_mem_incr_pointers(pm); + continue; + } + } } if(!point->totkey) { diff --git a/source/blender/editors/physics/physics_fluid.c b/source/blender/editors/physics/physics_fluid.c index 6f5b8924a13..1647892fd13 100644 --- a/source/blender/editors/physics/physics_fluid.c +++ b/source/blender/editors/physics/physics_fluid.c @@ -1005,7 +1005,7 @@ int fluidsimBake(bContext *C, ReportList *reports, Object *fsDomain) /* setup job */ WM_jobs_customdata(steve, fb, fluidbake_free); WM_jobs_timer(steve, 0.1, NC_SCENE|ND_FRAME, NC_SCENE|ND_FRAME); - WM_jobs_callbacks(steve, fluidbake_startjob, NULL, NULL); + WM_jobs_callbacks(steve, fluidbake_startjob, NULL, NULL, NULL); WM_jobs_start(CTX_wm_manager(C), steve); |