diff options
author | Jacques Lucke <jacques@blender.org> | 2020-03-27 14:29:20 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2020-03-27 14:33:33 +0300 |
commit | 5ce41e6f5706d4396c518be6e71e299ef95936ac (patch) | |
tree | e2eac7b01c32892f673b0a5d19c2bf40a4954f97 /source/blender/blenkernel/intern/fluid.c | |
parent | 6e505a45a1167537e7628e3feb31893cf8898ec8 (diff) |
Fix T75111: Crash when using subframes for animated fluid collider
This is not dependent on having an armature as mentioned in T75111.
The collider simply has to be animated.
Reviewers: sebbas
Differential Revision: https://developer.blender.org/D7251
Diffstat (limited to 'source/blender/blenkernel/intern/fluid.c')
-rw-r--r-- | source/blender/blenkernel/intern/fluid.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/source/blender/blenkernel/intern/fluid.c b/source/blender/blenkernel/intern/fluid.c index ae51c997a08..310410d8e0f 100644 --- a/source/blender/blenkernel/intern/fluid.c +++ b/source/blender/blenkernel/intern/fluid.c @@ -770,7 +770,9 @@ static void bb_combineMaps(FluidObjectBB *output, /* Values. */ output->numobjs[index_out] = bb1.numobjs[index_in]; - output->influence[index_out] = bb1.influence[index_in]; + if (output->influence && bb1.influence) { + output->influence[index_out] = bb1.influence[index_in]; + } output->distances[index_out] = bb1.distances[index_in]; if (output->velocity && bb1.velocity) { copy_v3_v3(&output->velocity[index_out * 3], &bb1.velocity[index_in * 3]); @@ -785,12 +787,14 @@ static void bb_combineMaps(FluidObjectBB *output, /* Values. */ output->numobjs[index_out] = MAX2(bb2->numobjs[index_in], output->numobjs[index_out]); - if (additive) { - output->influence[index_out] += bb2->influence[index_in] * sample_size; - } - else { - output->influence[index_out] = MAX2(bb2->influence[index_in], - output->influence[index_out]); + if (output->influence && bb2->influence) { + if (additive) { + output->influence[index_out] += bb2->influence[index_in] * sample_size; + } + else { + output->influence[index_out] = MAX2(bb2->influence[index_in], + output->influence[index_out]); + } } output->distances[index_out] = MIN2(bb2->distances[index_in], output->distances[index_out]); |