diff options
author | Janne Karhu <jhkarh@gmail.com> | 2008-02-12 19:36:03 +0300 |
---|---|---|
committer | Janne Karhu <jhkarh@gmail.com> | 2008-02-12 19:36:03 +0300 |
commit | a6f33fc4440e6a99236c1fcd53008ba7f78ea3b1 (patch) | |
tree | 00e701e7df16be2a656de2d03087280c78208ed5 | |
parent | 66e69965b15fa03634fcc741a4ec67e1e865cc83 (diff) |
Fix for bug: [#8271] Changes to the texture settings for particle attributes are not updated
- Material buttons code didn't set particles update flag
- Small change to how particle emit time is interpreted from textures, now the "time" texture output can actually be used for something
-rw-r--r-- | source/blender/blenkernel/intern/particle.c | 9 | ||||
-rw-r--r-- | source/blender/src/buttons_shading.c | 2 |
2 files changed, 7 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c index b9ac5bddba3..52f0937e69b 100644 --- a/source/blender/blenkernel/intern/particle.c +++ b/source/blender/blenkernel/intern/particle.c @@ -3147,11 +3147,14 @@ void psys_get_texture(Object *ob, Material *ma, ParticleSystemModifierData *psmd externtex(mtex, texco, &value, rgba, rgba+1, rgba+2, rgba+3); if((event & mtex->pmapto) & MAP_PA_TIME){ + /* the first time has to set the base value for time regardless of blend mode */ if((setvars&MAP_PA_TIME)==0){ - ptex->time=0.0; - setvars|=MAP_PA_TIME; + ptex->time *= 1.0f - var; + ptex->time += var * ((neg & MAP_PA_TIME)? 1.0f - value : value); + setvars |= MAP_PA_TIME; } - ptex->time= texture_value_blend(mtex->def_var,ptex->time,value,var,blend,neg & MAP_PA_TIME); + else + ptex->time= texture_value_blend(mtex->def_var,ptex->time,value,var,blend,neg & MAP_PA_TIME); } if((event & mtex->pmapto) & MAP_PA_LIFE) ptex->life= texture_value_blend(mtex->def_var,ptex->life,value,var,blend,neg & MAP_PA_LIFE); diff --git a/source/blender/src/buttons_shading.c b/source/blender/src/buttons_shading.c index 673f835cc49..ea3b7b81dd3 100644 --- a/source/blender/src/buttons_shading.c +++ b/source/blender/src/buttons_shading.c @@ -3095,7 +3095,7 @@ void do_matbuts(unsigned short event) ob=base->object; for(psys=ob->particlesystem.first; psys; psys=psys->next) { if(psys && ma==give_current_material(ob,psys->part->omat)) { - psys->flag |= PSYS_INIT; + psys->recalc |= PSYS_INIT; DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); } |