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.
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user