I routinely render from the Terminal on the Mac, but writing render scripts was a pain. So I decided to write this script to speed up the process. It creates a line of text that can be copied and pasted into TextEdit to make an .sh file or into the Terminal directly.
I've updated the script to correct ugly interface disease brought about by changes made in Maya 2011.
- Drop the script into your Maya 2010 scripts folder.
- Restart Maya or type “rehash” (sans quotes) into the command line.
- Type “source ekRndCommand.mel;ekRndCommand;” (also sans quotes) into the command line
- Press Enter and you should see the interface appear.
- Enter information as needed into the following fields.
Image Name-Type the name you want for your images or press the button to use the name in the Render Settings.
Camera Name-Click the Use Selected Camera button to use the active camera or choose the camera that you have selected.
Start Frame and End Frame-This should be self-explanatory. Click the From Render Settings button to pull these settings from the file’s Render Settings.
Padding- For animations, 3 or 4 digits works best.
Frame/Animation Ext.-This sets the <Name><Number>.<Ext> relationship. 3 is the most widely used. The What is this? button lists the available options.
Image Width And Height-Should be self explanatory.
Image Format-tif, jpg, tga, iff, png, etc are all possibilities. From Render Settings takes them from the file’s Render Settings.
Render Layer-Click the button to use the currently selected Render Layer or type in the layer name manually.
Project Folder-Click the Use Current Project button to list the current project. If current project is not set properly, use File>Project>Set to set the project and press the button again. You can also type this manually.
Render Director-If left blank, will render into the images folder of the specified project. The Click to Set Folder” button allows you to specify or, more usefully, create a specific render directory in which to render. It does not have to be in the project folder. Combined with the Render Layer function, it will create subfolders for each layer specified and do so automatically.
Scene File-If left blank, it will automatically include the open scene file. Pressing the button lets you specify a particular scene file which may or may not be open.
Pre- and PostRender Mel-These buttons let you specify/type mel scripts names (saved as <MyScript>.mel into the mel folder of your project folder) to run either pre or post render. As it currently stands, the command line has no way of setting motion blur or anti-aliasing attribs in Mental Ray. To do this you must use the setAttr command in a mel script. So you could have a high quality settings mel script and specify this as a PreRender mel script. It keeps you from having to set these settings manually.
Write Renderline-This button executes the script and creates the render line in the field below. It also saves the contents of the fields into optionVars so they will load the next time the script runs.
Close-This button saves the contents of the fields into optionVars and deletes the UI window.
- After writing the Renderline, copy the line of text into TextEdit.
- Make sure the text is plain text (Shift Cmd T).
- Hit Return
- Add lines as needed.
- Save the file with the .sh extension instead of .txt.
- 11.Open the Maya Terminal found in the Maya 2010 folder.
- Type “chmod 777 “ (sans quotes, but with a space after the 777).
- Drag the .sh file to the Terminal and place it after the chmod command.
- Hit enter. You have just made this script excecutable.
- 15.Drag the .sh file to the Terminal again and hit enter.
- The renderer should start.
If you get a “more than one file name not allowed…” error, replace all the carriage returns. It should work.
Make absolutely sure that there are no spaces anywhere in your file paths. Use underscores “_” instead.Good luck and have fun rendering!