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:
authorJanne Karhu <jhkarh@gmail.com>2008-09-28 23:53:37 +0400
committerJanne Karhu <jhkarh@gmail.com>2008-09-28 23:53:37 +0400
commitd1ce4fbaff012dc33a9d6f52b2e6eed6c86ae7fb (patch)
tree7dc5e2eb6a2fde79be1c8018913270b1f0688b2e
parentc3794cb983f1fd4a225575d6d7f6636d2c75c934 (diff)
A previous commit by me (16701) broke keyed- and none-physics particles or at least made them do funny things.
-rw-r--r--source/blender/blenkernel/intern/particle.c5
-rw-r--r--source/blender/blenkernel/intern/particle_system.c8
2 files changed, 7 insertions, 6 deletions
diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c
index 878cb08c950..f6bfaf14b7e 100644
--- a/source/blender/blenkernel/intern/particle.c
+++ b/source/blender/blenkernel/intern/particle.c
@@ -3796,7 +3796,7 @@ int psys_get_particle_state(Object *ob, ParticleSystem *psys, int p, ParticleKey
}
else{
if (pa) { /* TODO PARTICLE - should this ever be NULL? - Campbell */
- if(pa->state.time==state->time)
+ if(pa->state.time==state->time || ELEM(part->phystype,PART_PHYS_NO,PART_PHYS_KEYED))
copy_particle_key(state, &pa->state, 1);
else if(pa->prev_state.time==state->time)
copy_particle_key(state, &pa->prev_state, 1);
@@ -3828,6 +3828,9 @@ int psys_get_particle_state(Object *ob, ParticleSystem *psys, int p, ParticleKey
/* convert back to real velocity */
VecMulf(state->vel, frs_sec / dfra);
+
+ VecLerpf(state->ave, keys[1].ave, keys[2].ave, keytime);
+ QuatInterpol(state->rot, keys[1].rot, keys[2].rot, keytime);
}
}
else {
diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c
index fe5ea79e462..ef675c1c791 100644
--- a/source/blender/blenkernel/intern/particle_system.c
+++ b/source/blender/blenkernel/intern/particle_system.c
@@ -4154,7 +4154,7 @@ static void psys_update_path_cache(Object *ob, ParticleSystemModifierData *psmd,
}
if((part->type==PART_HAIR || psys->flag&PSYS_KEYED) && (psys_in_edit_mode(psys)
- || (part->type==PART_HAIR || part->draw_as==PART_DRAW_PATH) || part->draw&PART_DRAW_KEYS)){
+ || (part->type==PART_HAIR || part->draw_as==PART_DRAW_PATH))){
psys_cache_paths(ob, psys, cfra, 0);
/* for render, child particle paths are computed on the fly */
@@ -4464,10 +4464,8 @@ static void system_step(Object *ob, ParticleSystem *psys, ParticleSystemModifier
return;
}
- /* cache shouldn't be used for hair or "none" or "first keyed" physics */
- if(part->type == PART_HAIR || part->phystype == PART_PHYS_NO)
- usecache= 0;
- else if(part->type == PART_PHYS_KEYED && (psys->flag & PSYS_FIRST_KEYED))
+ /* cache shouldn't be used for hair or "none" or "keyed" physics */
+ if(part->type == PART_HAIR || ELEM(part->phystype, PART_PHYS_NO, PART_PHYS_KEYED))
usecache= 0;
else if(BKE_ptcache_get_continue_physics())
usecache= 0;