Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/physics/particle_edit_undo.c
| Show First 20 Lines • Show All 160 Lines • ▼ Show 20 Lines | else { | ||||
| BLI_duplicatelist(&edit->pid.cache->mem_cache, &undo->mem_cache); | BLI_duplicatelist(&edit->pid.cache->mem_cache, &undo->mem_cache); | ||||
| pm = edit->pid.cache->mem_cache.first; | pm = edit->pid.cache->mem_cache.first; | ||||
| for (; pm; pm = pm->next) { | for (; pm; pm = pm->next) { | ||||
| for (i = 0; i < BPHYS_TOT_DATA; i++) { | for (i = 0; i < BPHYS_TOT_DATA; i++) { | ||||
| pm->data[i] = MEM_dupallocN(pm->data[i]); | pm->data[i] = MEM_dupallocN(pm->data[i]); | ||||
| } | } | ||||
| BKE_ptcache_mem_pointers_init(pm); | void *cur[BPHYS_TOT_DATA]; | ||||
| BKE_ptcache_mem_pointers_init(pm, cur); | |||||
| LOOP_POINTS { | LOOP_POINTS { | ||||
| LOOP_KEYS { | LOOP_KEYS { | ||||
| if ((int)key->ftime == (int)pm->frame) { | if ((int)key->ftime == (int)pm->frame) { | ||||
| key->co = pm->cur[BPHYS_DATA_LOCATION]; | key->co = cur[BPHYS_DATA_LOCATION]; | ||||
| key->vel = pm->cur[BPHYS_DATA_VELOCITY]; | key->vel = cur[BPHYS_DATA_VELOCITY]; | ||||
| key->rot = pm->cur[BPHYS_DATA_ROTATION]; | key->rot = cur[BPHYS_DATA_ROTATION]; | ||||
| key->time = &key->ftime; | key->time = &key->ftime; | ||||
| } | } | ||||
| } | } | ||||
| BKE_ptcache_mem_pointers_incr(pm); | BKE_ptcache_mem_pointers_incr(cur); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| static void undoptcache_free_data(PTCacheUndo *undo) | static void undoptcache_free_data(PTCacheUndo *undo) | ||||
| { | { | ||||
| PTCacheEditPoint *point; | PTCacheEditPoint *point; | ||||
| ▲ Show 20 Lines • Show All 118 Lines • Show Last 20 Lines | |||||