diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-06-25 19:22:27 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-06-25 19:22:27 +0300 |
commit | 25a223c3bdddc4ced2558afcbc81f379ec3beff9 (patch) | |
tree | 2a89a6a39e960d2f5ff30c6bb25f64bdc5c9c2ec /source/blender/draw | |
parent | 540b99bd2816cf3d8df72c43aff41929db0fbcdc (diff) |
Draw: Use more proper particles index lookup
Diffstat (limited to 'source/blender/draw')
-rw-r--r-- | source/blender/draw/intern/draw_cache_impl_particles.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/draw/intern/draw_cache_impl_particles.c b/source/blender/draw/intern/draw_cache_impl_particles.c index d1e05b525ef..28693b47c89 100644 --- a/source/blender/draw/intern/draw_cache_impl_particles.c +++ b/source/blender/draw/intern/draw_cache_impl_particles.c @@ -289,12 +289,12 @@ static void particle_calculate_parent_uvs( } ParticleData *particle = &psys->particles[parent_index]; int num = particle->num_dmcache; - if (num == DMCACHE_NOTFOUND) { + if (num == DMCACHE_NOTFOUND || num == DMCACHE_ISCHILD) { if (particle->num < psmd->mesh_final->totface) { num = particle->num; } } - if (num != DMCACHE_NOTFOUND) { + if (num != DMCACHE_NOTFOUND && num != DMCACHE_ISCHILD) { MFace *mface = &psmd->mesh_final->mface[num]; for (int j = 0; j < num_uv_layers; j++) { psys_interpolate_uvs( @@ -323,12 +323,12 @@ static void particle_calculate_parent_mcol( } ParticleData *particle = &psys->particles[parent_index]; int num = particle->num_dmcache; - if (num == DMCACHE_NOTFOUND) { + if (num == DMCACHE_NOTFOUND || num == DMCACHE_ISCHILD) { if (particle->num < psmd->mesh_final->totface) { num = particle->num; } } - if (num != DMCACHE_NOTFOUND) { + if (num != DMCACHE_NOTFOUND && num != DMCACHE_ISCHILD) { MFace *mface = &psmd->mesh_final->mface[num]; for (int j = 0; j < num_uv_layers; j++) { psys_interpolate_mcol( |