Particle distribution error when using Vertex Weights.
In the unlucky case the last face in a Mesh has no weight (zero), the code
that tries to distribute particles evenly accidentally could assign it
still a particle, because of the 'remainder' calculus.

Also only happens in cases where the remainder has a value.
So a workaround is also to increase/decrease amount of particles.
This commit is contained in:
Ton Roosendaal 2006-08-27 11:55:32 +00:00
parent 683d0c579d
commit 5387532526

@ -1917,7 +1917,10 @@ void build_particle_system(Object *ob)
remainder += foweights[curface];
curface++;
}
foweights[curface] += remainder;
/* if this is the last face, the foweights[] can be zero, so we don't add a particle extra */
if(curface!=totface-1)
foweights[curface] += remainder;
maxw= (paf->end-paf->sta)/foweights[curface];
}