Could use some help with multiprocessing and the Python API

Hello! I’ve been trying to get multiprocessing working with a Blender plugin for weeks but nothing seems to be working for me so have finally come to talk to the experts!

The problem:
I have a plugin that simulates erosion that requires a lot of calculations. When looking into multiprocessing from the Blender/Python API I come back to this Stackoverflow answer:

When running the code in the answer (or any other variation of code using the multiprocessing library) a new instance of Blender will open, immediately crash with these errors and I can’t seem to trace the source:

Error: engine not found '-s'
Error: Not freed memory blocks: 47571, total unfreed memory 12.142883 MB

I’ve looked into forking off some subprocesses from the Python script and while this works with small, simple test scripts I need to pass the subprocess some complicated data structures - which subprocess can’t seem to handle.

Any help would be greatly appreciated!

1 Like

I’m not sure how much assistance I could be as I haven’t used this module in Blender myself, but have you tried looking at how other plugins (add-ons) have used the module? If it helps, these are 4 add-ons I found that use the multiprocessing module doing a quick grep of my add-ons folder.

From the “official” add-ons shipped with Blender

  • Power Sequencer
  • Mesh Tissue

Other free add-ons

  • Molecular script
  • chromoly tools (CTools)

I also recommend listing your OS and which version(s) of Blender you’ve been trying this with.

1 Like