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
This commit is contained in:
Janne Karhu
2008-02-12 16:36:03 +00:00
parent 66e69965b1
commit a6f33fc444
2 changed files with 7 additions and 4 deletions

View File

@@ -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);

View File

@@ -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);
}