diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-02-19 21:44:36 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-02-19 21:44:36 +0400 |
commit | 85d99737b5753fd845c3fce0f08e6b5205530195 (patch) | |
tree | e879cb3fc4c4409a0d692b4aa869cef16878f054 /source | |
parent | fd89fa15c5a9ffabb8fc140f46b6dd7cbc36c61a (diff) |
fix for bug where particle system would fail when the original mesh had no tessface's
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/intern/particle.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c index e4afff5380b..38a73daab2a 100644 --- a/source/blender/blenkernel/intern/particle.c +++ b/source/blender/blenkernel/intern/particle.c @@ -806,7 +806,7 @@ int psys_render_simplify_distribution(ParticleThreadContext *ctx, int tot) mface= dm->getTessFaceArray(dm); origindex= dm->getTessFaceDataArray(dm, CD_ORIGINDEX); totface= dm->getNumTessFaces(dm); - totorigface= me->totface; + totorigface= me->totpoly; if(totface == 0 || totorigface == 0) return tot; @@ -2937,6 +2937,11 @@ void psys_cache_paths(ParticleSimulationData *sim, float cfra) vg_length = psys_cache_vgroup(psmd->dm, psys, PSYS_VG_LENGTH); } + /* ensure we have tessfaces to be used for mapping */ + if (part->from != PART_FROM_VERT) { + DM_ensure_tessface(psmd->dm); + } + /*---first main loop: create all actual particles' paths---*/ LOOP_SHOWN_PARTICLES { if(!psys->totchild) { |