Page MenuHome

Fix T90706: Crash when deleting fluid sim geometry
ClosedPublic

Authored by Sonny Campbell (SonnyCampbell_Unity) on Jun 27 2022, 11:58 AM.

Details

Summary

The crash was because when deleting the fluid sim domain geometry manta_set_domain_from_mesh would set fds->global_size to [inf, inf, inf] because me->totvert was zero. This would cause an error to be thrown in python saying the NameError: name 'inf' is not defined. Did you mean: 'int'?

There were two possible solutions to fix this. In fluid_script.h I could add the line from numpy import inf to the manta_import string, which fixed the issue, but I wasn't sure if we wanted to include the numpy module as it wasn't there already. The other solution is the one that I went with, which just sets fds->global_size = [FLT_MAX, FLT_MAX, FLT_MAX] instead of [inf, inf, inf] in the case that me->totvert == 0

Diff Detail

Repository
rB Blender

Event Timeline

If it wanted to use inf before, it's probably more safe to keep using instead of using FLT_MAX. Importing numpy is not ideal, but that doesn't seem necessary: https://docs.python.org/3/library/math.html#math.inf

  • Revert "Fix T90706: Crash when deleting fluid sim geometry"
  • Import inf from the math module
This revision is now accepted and ready to land.Jun 28 2022, 2:50 PM

Hey @Jacques Lucke (JacquesLucke) / @Campbell Barton (campbellbarton) - just following up on this as I don't have commit priviledges yet, so was hoping one of you could commit this change for me when you get the chance?