Fix for invalid particle pointer access in mixed particle/child loop.
This commit is contained in:
@@ -331,6 +331,12 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
|
|||||||
float hairmat[4][4];
|
float hairmat[4][4];
|
||||||
float mat[3][3];
|
float mat[3][3];
|
||||||
|
|
||||||
|
if (first_particle + p < psys->totpart)
|
||||||
|
pa = psys->particles + first_particle + p;
|
||||||
|
else {
|
||||||
|
ChildParticle *cpa = psys->child + p;
|
||||||
|
pa = psys->particles + cpa->parent;
|
||||||
|
}
|
||||||
psys_mat_hair_to_global(sim.ob, sim.psmd->dm, sim.psys->part->from, pa, hairmat);
|
psys_mat_hair_to_global(sim.ob, sim.psmd->dm, sim.psys->part->from, pa, hairmat);
|
||||||
copy_m3_m4(mat, hairmat);
|
copy_m3_m4(mat, hairmat);
|
||||||
/* to quaternion */
|
/* to quaternion */
|
||||||
|
Reference in New Issue
Block a user