From a30dc7c74eb2f02b928bea9f74209b301c9ceee6 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 2 Jul 2013 19:17:34 +0000 Subject: Fix #35966: remesh modifier + particle use modifier stack option did not work well together. --- source/blender/blenkernel/intern/particle_system.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c index ec45c9eef40..9840852ad7e 100644 --- a/source/blender/blenkernel/intern/particle_system.c +++ b/source/blender/blenkernel/intern/particle_system.c @@ -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); + } } } -- cgit v1.2.3