Maya Swift Tips – Command Line Batch Rendering on Mac, Pt I

Many many times I find myself in the need of queuing my maya scenes for rendering.

Check out my github repo with other 3d scripts:

I don’t have any render job management app on my mac, but since I just want to batch render multiple files at once, there’s no need at all: it can be easily resolved with a little help from the osx terminal.

  1. Open up TextEdit or any other text editor capable of saving files (with no formatting) in .sh format. In my case, I used Text Wrangler.
  2. Create a new document in order to start writing the code needed for Maya Command Line rendering. You can find some help on the Autodesk website or Maya Docs, if you need more advanced features. Here a little explanation of my code: 

    #!/bin/bash; –> needed to tell that we’ll be using the bash shell.
    /Applications/Autodesk/maya2014/ –> full path to the maya render bin. I use the full path so that I can launch the final shell script without being inside the maya terminal (found inside the maya application folder
    -r –> flag used to render
    file –> flag used to specify the path to the input file
    “/Volumes/LaCie3TBYas/CG/Works/svilupparty2015/svilupparty_maya/scenes/reel/reel_lupoAlberto_v001.mb” —-> actual path to the file (remember the quotation marks)
  3. If your scene render settings are all good, you may not need to do anything else. Other way, you can specific which maya project to use, where to render, which render engine utilize, and so on..
    Here you can find some examples from the Solidangle Site, if you’re using Arnold.
  4. Now save the file as .sh and exit the text edit.
  5. Open a new Terminal window (Applications/Utility/Terminal) and type: $ cd /Users/namesurname/pathToYourJustSavedFile/ (this changes the directory in which the terminal reads, you can also add the path by dragging to the terminal the folder that contains your shell script.
    The $ is the prompt character, used to show that is a terminal command: do not paste it.)
  6. In order to make the file executable, type : $ chmod 755 ( is the name of your file, obviously)
    If you want to know more about the chmod command, have a read here.
  7. Now double click on the .sh file or launch it from the Terminal, like this $ sh
  8. All done! It should start to render in background, saving some resources, since we didn’t need to open Maya at all.
    If it doesn’t start, make sure that you didn’t misspell anything and that you saved correctly the .sh file, without any formatting.

Example code for the batch:

Lascia una risposta

L'indirizzo email non verrà pubblicato. I campi obbligatori sono contrassegnati *


È possibile utilizzare questi tag ed attributi XHTML: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">