Page MenuHome

Fix T98427: Crash adding quick effects smoke from Python
ClosedPublic

Authored by Campbell Barton (campbellbarton) on Jun 22 2022, 1:26 PM.

Details

Summary

Manta flow used the __main__ namespace which it was executed in,
this caused a bug when calculating fluid from Python, which clears
it's __main__ name-space after execution.
This caused Manta-flows name space to be cleared too.

Resolve this by creating a separate name-space for manta-flow.

Diff Detail

Repository
rB Blender
Branch
TEMP-T98427-FIX (branched from master)
Build Status
Buildable 22678
Build 22678: arc lint + arc unit

Event Timeline

Campbell Barton (campbellbarton) requested review of this revision.Jun 22 2022, 1:26 PM
Campbell Barton (campbellbarton) created this revision.

terminateMantaflow() isn't actually called anywhere

intern/mantaflow/intern/MANTA_main.cpp
645–646

Probably don't need a null check here and also in manta_python_main_module_ensure

706

From checking the source code I couldn't actually find terminateMantaflow() being called anywhere, I put the clearing functionality in the destructor but should probably call terminateMantaflow() there

This revision now requires changes to proceed.Jun 24 2022, 1:58 PM
Campbell Barton (campbellbarton) marked an inline comment as done.
  • Update based on feedback.

Regarding terminateMantaflow not being called, I think the fix would be to call this function as freeing the module elsewhere doesn't make so much sense.
Although I think calling this is outside the scope of this patch.

In practice this would only run on exit so it's more of a technicality when the module is kept while Blender runs.

This revision is now accepted and ready to land.Jun 24 2022, 3:08 PM