diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-02-15 12:27:39 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-02-15 13:53:58 +0300 |
commit | 5ce6ca05366e653cc576ac6beaed72d07c0e2e6c (patch) | |
tree | 693cccbb0455f826e9b2c3cf86841000487abd3d /source/blender/blenkernel | |
parent | 67cec97387965009dfaa57f7f4c8ab948e048e70 (diff) |
Fix T54078: Adding subsurf prior to particle system breaks simple children vgroups and textures
cpa->num points to a face index on BASE mesh, but get_child_modifier_parameters()
expects index on a FINAL dm. So wrong index was used here.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/intern/particle.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c index 723bb86cb47..87322b5fddc 100644 --- a/source/blender/blenkernel/intern/particle.c +++ b/source/blender/blenkernel/intern/particle.c @@ -2306,7 +2306,19 @@ static void psys_thread_create_path(ParticleTask *task, struct ChildParticle *cp /* get the original coordinates (orco) for texture usage */ cpa_from = part->from; - cpa_num = pa->num; + + /* + * NOTE: Should in theory be the same as: + cpa_num = psys_particle_dm_face_lookup( + ctx->sim.psmd->dm_final, + ctx->sim.psmd->dm_deformed, + pa->num, pa->fuv, + NULL); + */ + cpa_num = (ELEM(pa->num_dmcache, DMCACHE_ISCHILD, DMCACHE_NOTFOUND)) + ? pa->num + : pa->num_dmcache; + /* XXX hack to avoid messed up particle num and subsequent crash (#40733) */ if (cpa_num > ctx->sim.psmd->dm_final->getNumTessFaces(ctx->sim.psmd->dm_final)) cpa_num = 0; |