My usual workflow with mayapy has been to just write a script that is designed to be called with mayapy.exe. This works fine when that is the intention from the start, however now I would like to run functions from existing libraries/modules using mayapy and I am not quite sure how to proceed. If I go the write-a-script route then I will end up creating a lot of scripts just to run existing functions in a way that I can pass them arguments via the command line. My other thought was to create a script that accepts a module name, function name, and all the arguments to pass. While that would work I figure there may be a better way.
How do you guys handle situations like this? Is this a good case for RPC?
Also, the mayapy instances that would be running these scripts will be on artists’ machines, and will be created (and killed) for each script that gets run. I’m not trying to set up persistent mayapy sessions (at the moment).