Fix #35966: remesh modifier + particle use modifier stack option did not work

well together.
This commit is contained in:
Brecht Van Lommel 2013-07-02 19:17:34 +00:00
parent d6c14ed855
commit a30dc7c74e
Notes: blender-bot 2023-02-14 05:00:07 +01:00
Referenced by issue #57922, UV Map "From Dupli" does not work on emitter mesh with UV-altering modifiers.
1 changed files with 10 additions and 9 deletions

View File

@ -421,23 +421,24 @@ void psys_calc_dmcache(Object *ob, DerivedMesh *dm, ParticleSystem *psys)
continue;
}
if (psys->part->from == PART_FROM_VERT) {
if (pa->num < totelem && nodearray[pa->num])
pa->num_dmcache= GET_INT_FROM_POINTER(nodearray[pa->num]->link);
if (use_modifier_stack) {
if (pa->num < totelem)
pa->num_dmcache = DMCACHE_ISCHILD;
else
pa->num_dmcache = DMCACHE_NOTFOUND;
}
else { /* FROM_FACE/FROM_VOLUME */
/* Note that sometimes the pa->num is over the nodearray size, this is bad, maybe there is a better place to fix this,
* but for now passing NULL is OK. every face will be searched for the particle so its slower - Campbell */
if (use_modifier_stack) {
else {
if (psys->part->from == PART_FROM_VERT) {
if (pa->num < totelem && nodearray[pa->num])
pa->num_dmcache = GET_INT_FROM_POINTER(nodearray[pa->num]->link);
pa->num_dmcache= GET_INT_FROM_POINTER(nodearray[pa->num]->link);
else
pa->num_dmcache = DMCACHE_NOTFOUND;
}
else
else { /* FROM_FACE/FROM_VOLUME */
/* Note that sometimes the pa->num is over the nodearray size, this is bad, maybe there is a better place to fix this,
* but for now passing NULL is OK. every face will be searched for the particle so its slower - Campbell */
pa->num_dmcache= psys_particle_dm_face_lookup(ob, dm, pa->num, pa->fuv, pa->num < totelem ? nodearray[pa->num] : NULL);
}
}
}