Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source/blender/blenkernel/intern/particle.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c
index 0b8853364d6..098700495a0 100644
--- a/source/blender/blenkernel/intern/particle.c
+++ b/source/blender/blenkernel/intern/particle.c
@@ -1422,7 +1422,6 @@ int psys_particle_dm_face_lookup(
{
MFace *mtessface_final;
OrigSpaceFace *osface_final;
- int totface_final;
int pindex_orig;
float uv[2], (*faceuv)[2];
@@ -1430,6 +1429,13 @@ int psys_particle_dm_face_lookup(
const int *index_mf_to_mpoly = NULL;
const int *index_mp_to_orig = NULL;
+ const int totface_final = dm_final->getNumTessFaces(dm_final);
+ const int totface_deformed = dm_deformed ? dm_deformed->getNumTessFaces(dm_deformed) : totface_final;
+
+ if (ELEM(0, totface_final, totface_deformed)) {
+ return DMCACHE_NOTFOUND;
+ }
+
index_mf_to_mpoly = dm_final->getTessFaceDataArray(dm_final, CD_ORIGINDEX);
index_mp_to_orig = dm_final->getPolyDataArray(dm_final, CD_ORIGINDEX);
BLI_assert(index_mf_to_mpoly);
@@ -1451,11 +1457,6 @@ int psys_particle_dm_face_lookup(
index_mf_to_mpoly_deformed = NULL;
- totface_final = dm_final->getNumTessFaces(dm_final);
- if (!totface_final) {
- return DMCACHE_NOTFOUND;
- }
-
mtessface_final = dm_final->getTessFaceArray(dm_final);
osface_final = dm_final->getTessFaceDataArray(dm_final, CD_ORIGSPACE);