Particle textures didn't use original coordinates properly for grid distribution.

This commit is contained in:
Janne Karhu
2011-02-18 00:17:46 +00:00
parent 9e6e34df6c
commit 6a9734821d

View File

@@ -1831,9 +1831,11 @@ static void psys_particle_on_shape(int UNUSED(distr), int UNUSED(index), float *
void psys_particle_on_emitter(ParticleSystemModifierData *psmd, int from, int index, int index_dmcache, float *fuv, float foffset, float *vec, float *nor, float *utan, float *vtan, float *orco, float *ornor){
if(psmd){
if(psmd->psys->part->distr==PART_DISTR_GRID && psmd->psys->part->from != PART_FROM_VERT){
if(vec){
VECCOPY(vec,fuv);
}
if(vec)
copy_v3_v3(vec,fuv);
if(orco)
copy_v3_v3(orco, fuv);
return;
}
/* we cant use the num_dmcache */
@@ -3780,7 +3782,7 @@ void psys_get_texture(ParticleSimulationData *sim, ParticleData *pa, ParticleTex
short blend=mtex->blendtype;
short texco = mtex->texco;
if(ELEM(texco, TEXCO_UV, TEXCO_ORCO) && (ELEM(part->from, PART_FROM_FACE, PART_FROM_VOLUME) == 0 || part->distr == PART_DISTR_GRID))
if(texco == TEXCO_UV && (ELEM(part->from, PART_FROM_FACE, PART_FROM_VOLUME) == 0 || part->distr == PART_DISTR_GRID))
texco = TEXCO_GLOB;
switch(texco) {