Subprocess problems from within RV

Hi there.

We've recently started using our in-house multiprocessing library from one of our RV plugins, and since then we've been running into a lot of troubles. At first, since launching a new subprocess would spawn a new instance of RV, we wanted to execute the studio's own Python27. We've been unable to do this properly without doing some dirty hacking here and there. Namely, the only way I've been able of making it kind of work is by wiping the whole sys.path and replacing it with our own.

So the questions would be: Is it possible to replace the RV's python interpreter? or, Is there any way of setting or replacing the sys.path with our own? Or in general, are there any general considerations we need to keep in mind when doing multiprocessing within RV? 

Thanks a lot, 


1 comment

  • Avatar
    Jon Morley Official comment

    Hi José,

    There are a couple of things to mention that might help or discourage you. RV requires its own Python interpreter because we bind our commands API to our own interpreter. If you don't use RV's interpreter you can't access any of the methods in RV's Python API. The other issue is that RV's Python API is not thread safe and that extends to multiple processes as well. The only place the graph can be reliably modified is in the main thread of RV's process.

    If what you are trying to multiprocess does not use the RV Python API then I would consider communicating with RV through the network (src/python/network/rvNetwork.py) and/or calling out to external Python code outside of RV's interpreter. Is that a possibility for you?


Please sign in to leave a comment.