Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/physics/particle_edit.c
| Show First 20 Lines • Show All 5,194 Lines • ▼ Show 20 Lines | else { | ||||
| edit->psys = NULL; | edit->psys = NULL; | ||||
| for (pm = cache->mem_cache.first; pm; pm = pm->next) { | for (pm = cache->mem_cache.first; pm; pm = pm->next) { | ||||
| totframe++; | totframe++; | ||||
| } | } | ||||
| for (pm = cache->mem_cache.first; pm; pm = pm->next) { | for (pm = cache->mem_cache.first; pm; pm = pm->next) { | ||||
| LOOP_POINTS { | LOOP_POINTS { | ||||
| if (BKE_ptcache_mem_pointers_seek(p, pm) == 0) { | void *cur[BPHYS_TOT_DATA]; | ||||
| if (BKE_ptcache_mem_pointers_seek(p, pm, cur) == 0) { | |||||
| continue; | continue; | ||||
| } | } | ||||
| if (!point->totkey) { | if (!point->totkey) { | ||||
| key = point->keys = MEM_callocN(totframe * sizeof(PTCacheEditKey), "ParticleEditKeys"); | key = point->keys = MEM_callocN(totframe * sizeof(PTCacheEditKey), "ParticleEditKeys"); | ||||
| point->flag |= PEP_EDIT_RECALC; | point->flag |= PEP_EDIT_RECALC; | ||||
| } | } | ||||
| else { | else { | ||||
| key = point->keys + point->totkey; | key = point->keys + point->totkey; | ||||
| } | } | ||||
| 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->ftime = (float)pm->frame; | key->ftime = (float)pm->frame; | ||||
| key->time = &key->ftime; | key->time = &key->ftime; | ||||
| BKE_ptcache_mem_pointers_incr(pm); | BKE_ptcache_mem_pointers_incr(cur); | ||||
| point->totkey++; | point->totkey++; | ||||
| } | } | ||||
| } | } | ||||
| psys = NULL; | psys = NULL; | ||||
| } | } | ||||
| recalc_lengths(edit); | recalc_lengths(edit); | ||||
| ▲ Show 20 Lines • Show All 292 Lines • Show Last 20 Lines | |||||