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.
This commit is contained in:
@@ -2306,7 +2306,19 @@ static void psys_thread_create_path(ParticleTask *task, struct ChildParticle *cp
|
|||||||
|
|
||||||
/* get the original coordinates (orco) for texture usage */
|
/* get the original coordinates (orco) for texture usage */
|
||||||
cpa_from = part->from;
|
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) */
|
/* 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))
|
if (cpa_num > ctx->sim.psmd->dm_final->getNumTessFaces(ctx->sim.psmd->dm_final))
|
||||||
cpa_num = 0;
|
cpa_num = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user