I agree, the whole frame thing is a bit confusing when you’re not dealing with frames. It helps to think of the frames as tasks instead of actual frames.
Then the question becomes how many tasks do you want to execute? The answer in your case is probably one, and in terms of what that task’s frame is labelled; it doesn’t matter.
For the actual plugin params you want to specify mayabatch.exe
as your executable and tack on at least the -script <your-script-path>
argument . Depending on your Maya version this script may be required to be a MEL script, in which case you can just make a MEL wrapper that loads your python script:
// Assuming you already have your module on path (usually via Maya.env)
print("Loading Python module");
python "from your_project.your_module import batchprocess";
Here’s an example of a dictionary I’ve used to write out a plugin-info file in the past:
cmd_plugin = {
'SingleFramesOnly': 'False',
'Executable': '{}'.format(MAYA_EXEPATH.replace('/', '\\')),
'Arguments': '"{}" -script "{}" -command "$pipeline_args=\\"{}\\""'.format(sceneFile, scriptFile, pipelineArgs),
'StartupDirectory': '',
'ShellExecute': 'False',
'Shell': 'default'
}
This particular command expects a scene file to load up, which is the first name-less argument. It’s worth noting that you can run mayabatch.exe without a scene file as well, only executing the supplied script. The -command <MEL COMMAND>
flag was used to evaluate a global MEL string, which I fetched in the Python module later. JSON as base64 string I believe, just stuff that the Maya module needed to know regarding the job.
As for the job-info file, you have a massive amount of tweaking that can be done here, so I’ve only included the highlights that relate to your question:
cmd_job = {
'Plugin': 'CommandLine',
'Name': 'Job name goes here',
'Frames': '1',
'ChunkSize': '1',
...
}
So, a single frame and a single chunk does what you’d expect and creates a single task for this job. Presumably you’d get the same result with something like frames=1-10 and chunk=10. If you supplied frames=1-2 and chunk=1, your Maya script would run twice.
PS: The project I pulled this from was based around Maya 2018, so you might be best off confirming the command line arguments with whatever your target Maya version is.