Fix T39319: Particle System Bug on Cycles Render.

Crashes due to bad dm face calculation in particle RNA/cycles hair.
This stuff is a total mess, but this kind of check is used in other
places and prevents crashing at least.
This commit is contained in:
Lukas Tönne
2014-03-25 12:33:07 +01:00
parent b7dbb2f48e
commit a7ed1db51f

View File

@@ -475,7 +475,8 @@ static void rna_ParticleSystem_uv_on_emitter(ParticleSystem *particlesystem, Rep
if (particle_no < totpart) {
/* get uvco & mcol */
num = particle->num_dmcache;
num = (ELEM(particle->num_dmcache, DMCACHE_ISCHILD, DMCACHE_NOTFOUND)) ?
particle->num : particle->num_dmcache;
if (num == DMCACHE_NOTFOUND)
if (particle->num < modifier->dm->getNumTessFaces(modifier->dm))