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:
authorKonrad Kleine <konrad.wilhelm.kleine@gmail.com>2012-09-23 21:50:51 +0400
committerKonrad Kleine <konrad.wilhelm.kleine@gmail.com>2012-09-23 21:50:51 +0400
commit60a5e05a4dd71f05aec928ccc785df1a3b24a217 (patch)
treeb884b0756fce062f04f970d0f4d1b54c9f9265c6 /source/blender/blenkernel/intern
parentedd11c0829df629030312b93047914f2d0ecbdc8 (diff)
Fix #32625 Zero area-sized faces caused jittered part. distrib. to crash
When appling a particle system to a face whose area size is zero, the jitter distribution failed. fmod() produces a NaN value in this case. This commit simply checks if the jitter offset (I guess that is "jitoff" means) and only call psys_uv_to_w() if it's a real floating point number.
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r--source/blender/blenkernel/intern/particle_system.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c
index 2c0452bc2d1..e65e15dd287 100644
--- a/source/blender/blenkernel/intern/particle_system.c
+++ b/source/blender/blenkernel/intern/particle_system.c
@@ -797,8 +797,10 @@ static void distribute_threads_exec(ParticleThread *thread, ParticleData *pa, Ch
}
else {
ctx->jitoff[i] = fmod(ctx->jitoff[i],(float)ctx->jitlevel);
- psys_uv_to_w(ctx->jit[2*(int)ctx->jitoff[i]], ctx->jit[2*(int)ctx->jitoff[i]+1], mface->v4, pa->fuv);
- ctx->jitoff[i]++;
+ if (!isnan(ctx->jitoff[i])) {
+ psys_uv_to_w(ctx->jit[2*(int)ctx->jitoff[i]], ctx->jit[2*(int)ctx->jitoff[i]+1], mface->v4, pa->fuv);
+ ctx->jitoff[i]++;
+ }
}
break;
case PART_DISTR_RAND: