Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/blenkernel/intern/particle_system.c')
-rw-r--r--source/blender/blenkernel/intern/particle_system.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c
index f097af279b6..c0ef92b489e 100644
--- a/source/blender/blenkernel/intern/particle_system.c
+++ b/source/blender/blenkernel/intern/particle_system.c
@@ -196,8 +196,11 @@ static void realloc_particles(Object *ob, ParticleSystem *psys, int new_totpart)
if(psys->particles->keys)
MEM_freeN(psys->particles->keys);
- for(i=0, pa=psys->particles; i<totsaved; i++, pa++)
- if(pa->keys) pa->keys= NULL;
+ for(i=0, pa=psys->particles; i<psys->totpart; i++, pa++)
+ if(pa->keys) {
+ pa->keys= NULL;
+ pa->totkey= 0;
+ }
for(i=totsaved, pa=psys->particles+totsaved; i<psys->totpart; i++, pa++)
if(pa->hair) MEM_freeN(pa->hair);
@@ -2010,7 +2013,6 @@ static void set_keyed_keys(Scene *scene, Object *ob, ParticleSystem *psys)
Object *kob = ob;
ParticleSystem *kpsys = psys;
ParticleData *pa;
- ParticleKey state;
int totpart = psys->totpart, i, k, totkeys = psys->totkeyed + 1;
float prevtime, nexttime, keyedtime;
@@ -2034,10 +2036,11 @@ static void set_keyed_keys(Scene *scene, Object *ob, ParticleSystem *psys)
}
psys->flag &= ~PSYS_KEYED;
- state.time=-1.0;
for(k=0; k<totkeys; k++) {
for(i=0,pa=psys->particles; i<totpart; i++, pa++) {
+ (pa->keys + k)->time = -1.0; /* use current time */
+
if(kpsys->totpart > 0)
psys_get_particle_state(scene, kob, kpsys, i%kpsys->totpart, pa->keys + k, 1);