1 Maya Tutorial Quick Tip Render Faster using the Windows Command Line w Fri Sep 24, 2010 2:16 am
Admin
Admin
In this Quick Tip tutorial, you will learn how to batch render Maya scenes faster using the Windows command line, and in this way, maximize the amount of processing power you can get from your computer.
Step 1
First if you��re using Windows 7, and the latest version of Maya 2010, you need to set the path of the mayabatch to the systems�� Environment Variables. Right click on ��Computer�� and select ��Properties��. In the window that opens, click on ��Advanced System Settings��.[You must be registered and logged in to see this image.]
Step 2
In the window that pops up, select the ��Advanced�� tab on top, and then click on ��Environment Variables��.[You must be registered and logged in to see this image.]
Step 3
Under ��System Variables��, scroll and find the one with the name ��Path��, select it, and click the ��Edit�� button.[You must be registered and logged in to see this image.]
Step 4
In the window that comes up next to ��Variable value:��, scroll to the end of the field, and add ��;�� plus the path to your Maya directory (and its ��bin�� folder). By default the directory is ��C:\Program Files\Autodesk\Maya2010\bin�� Then click ok on all of the windows to close them.[You must be registered and logged in to see this image.]
Step 5
When rendering your file through the command line, the batch renderer will take all of the settings from the Maya file. These include settings in the render options, such as: the file name of the output files, image format, frame padding, start and end frames, renderable cameras, image size, and all of the other quality and render settings in the render set up. It will also take the different render layers (if you have them), and overall all the information will come from this file.[You must be registered and logged in to see this image.]
Step 6
Also the file’s output directory will be the same as specified in the project of the file.[You must be registered and logged in to see this image.]
Step 7
Now to open the command line, click on the ��Start�� button, and then in the search field type ��cmd��. The command line should show then show up. Click to open it. If you��re using XP, first click the ��Start�� button, then select ��Run��, and there type ��cmd�� in the field.[You must be registered and logged in to see this image.]
Step 8
Then, an easy way to batch render a file is to navigate to the folder with the particular file you want to render. Let��s say the folder is ��C:\Users\Pipera\Desktop\Project\My Projects\Project��, and in that folder there��s a file called ��Concept_Scene_1��. To render it, first you need to enter the directory type ��cd��, and the name of the folder (in this case it will be ��cd C:\Users\Pipera\Desktop\Project\My Projects\Project��). Now to render the file, just type ��Render FileName_and_Extension.mb (for Maya Binary). In this case the command line will look like this ��Render Concept_Scene_1.mb��[You must be registered and logged in to see this image.]
Step 9
In general, when rendering from the command line, the batch renderer will always take the settings from the file. But there��s a way to edit the settings if you need to, without opening the file again and saving it. These settings are called ‘flags’, and are typed after the ��Render�� command and before the file name. These flags won��t change your file, just the render that you��re going to output. To see all the different flags, open the command line and type ��Render �Ch��[You must be registered and logged in to see this image.]
Step 10
The only settings that are going to change are the ones that are overridden with flags. Let��s say you need to change the size of your image, and you want to render with mental ray. In the command line type ��Render �Cr mr �Cs 1 �Ce 125 Concept_Scene_1.mb��, where the ��-r�� flag specifies which render to use (in this case ��mr�� for mental ray), the ��-s�� is the start frame of the animation, and the ��-e�� is the end frame.[You must be registered and logged in to see this image.]
Step 11
Now for a more efficient way of rendering with Windows executable .bat files. These files are made and edited in Notepad. Let��s say that you want to render a file with mental ray. In Notepad write ��Render �Cr mr Concept_Scene_1.mb�� and save the file, but make sure in the end of the name to put ��.bat��, so that the file can save in a .bat format.[You must be registered and logged in to see this image.]
Step 12
Put the .bat file in the same folder as the file you want to render, and double click it to run the batch renderer.[You must be registered and logged in to see this image.]
Step 13
Using .bat files is great when you need to render several scenes that are in different directories. And what’s more, you can put different flags for each scene. It doesn��t matter where you put the .bat file, because the directories are listed within it. Also, the scenes will render consequently.[You must be registered and logged in to see this image.]
Step 14
With the ��-rd�� flag, you can specify in which directory your files are going to be rendered.[You must be registered and logged in to see this image.]
Step 15
The ��-rd�� flag can also be used for multiple files at the same time.[You must be registered and logged in to see this image.]
Step 16
Another highly useful flag is the ��-cam�� flag, which lets you specify which camera to render from the scene.[You must be registered and logged in to see this image.]
Step 17
You can render as many cameras as you like from the same or different scenes, and also put different flags to make it even more efficient.[You must be registered and logged in to see this image.]
Step 18
Rendering different cameras is even better when combined with the ��-rd�� tag, so each camera will be output into a different folder[You must be registered and logged in to see this image.]
Step 19
Remember that you can combine as many flags as you want to speed up your renders, and then you can view the commands when you type ��Render �Ch�� in the command line.[You must be registered and logged in to see this image.]
Step 20
Some final useful tips for rendering from the command line: Don’t use spaces in the name of the files always put an ��_�� instead; Make sure that the .bat files are saved with their extension after the name; If you want to stop the render process, just close the command line.[You must be registered and logged in to see this image.]
Don’t miss more CG tutorials and guides, published daily – subscribe to Cgtuts+ by RSS.]
Step 1
First if you��re using Windows 7, and the latest version of Maya 2010, you need to set the path of the mayabatch to the systems�� Environment Variables. Right click on ��Computer�� and select ��Properties��. In the window that opens, click on ��Advanced System Settings��.[You must be registered and logged in to see this image.]
Step 2
In the window that pops up, select the ��Advanced�� tab on top, and then click on ��Environment Variables��.[You must be registered and logged in to see this image.]
Step 3
Under ��System Variables��, scroll and find the one with the name ��Path��, select it, and click the ��Edit�� button.[You must be registered and logged in to see this image.]
Step 4
In the window that comes up next to ��Variable value:��, scroll to the end of the field, and add ��;�� plus the path to your Maya directory (and its ��bin�� folder). By default the directory is ��C:\Program Files\Autodesk\Maya2010\bin�� Then click ok on all of the windows to close them.[You must be registered and logged in to see this image.]
Step 5
When rendering your file through the command line, the batch renderer will take all of the settings from the Maya file. These include settings in the render options, such as: the file name of the output files, image format, frame padding, start and end frames, renderable cameras, image size, and all of the other quality and render settings in the render set up. It will also take the different render layers (if you have them), and overall all the information will come from this file.[You must be registered and logged in to see this image.]
Step 6
Also the file’s output directory will be the same as specified in the project of the file.[You must be registered and logged in to see this image.]
Step 7
Now to open the command line, click on the ��Start�� button, and then in the search field type ��cmd��. The command line should show then show up. Click to open it. If you��re using XP, first click the ��Start�� button, then select ��Run��, and there type ��cmd�� in the field.[You must be registered and logged in to see this image.]
Step 8
Then, an easy way to batch render a file is to navigate to the folder with the particular file you want to render. Let��s say the folder is ��C:\Users\Pipera\Desktop\Project\My Projects\Project��, and in that folder there��s a file called ��Concept_Scene_1��. To render it, first you need to enter the directory type ��cd��, and the name of the folder (in this case it will be ��cd C:\Users\Pipera\Desktop\Project\My Projects\Project��). Now to render the file, just type ��Render FileName_and_Extension.mb (for Maya Binary). In this case the command line will look like this ��Render Concept_Scene_1.mb��[You must be registered and logged in to see this image.]
Step 9
In general, when rendering from the command line, the batch renderer will always take the settings from the file. But there��s a way to edit the settings if you need to, without opening the file again and saving it. These settings are called ‘flags’, and are typed after the ��Render�� command and before the file name. These flags won��t change your file, just the render that you��re going to output. To see all the different flags, open the command line and type ��Render �Ch��[You must be registered and logged in to see this image.]
Step 10
The only settings that are going to change are the ones that are overridden with flags. Let��s say you need to change the size of your image, and you want to render with mental ray. In the command line type ��Render �Cr mr �Cs 1 �Ce 125 Concept_Scene_1.mb��, where the ��-r�� flag specifies which render to use (in this case ��mr�� for mental ray), the ��-s�� is the start frame of the animation, and the ��-e�� is the end frame.[You must be registered and logged in to see this image.]
Step 11
Now for a more efficient way of rendering with Windows executable .bat files. These files are made and edited in Notepad. Let��s say that you want to render a file with mental ray. In Notepad write ��Render �Cr mr Concept_Scene_1.mb�� and save the file, but make sure in the end of the name to put ��.bat��, so that the file can save in a .bat format.[You must be registered and logged in to see this image.]
Step 12
Put the .bat file in the same folder as the file you want to render, and double click it to run the batch renderer.[You must be registered and logged in to see this image.]
Step 13
Using .bat files is great when you need to render several scenes that are in different directories. And what’s more, you can put different flags for each scene. It doesn��t matter where you put the .bat file, because the directories are listed within it. Also, the scenes will render consequently.[You must be registered and logged in to see this image.]
Step 14
With the ��-rd�� flag, you can specify in which directory your files are going to be rendered.[You must be registered and logged in to see this image.]
Step 15
The ��-rd�� flag can also be used for multiple files at the same time.[You must be registered and logged in to see this image.]
Step 16
Another highly useful flag is the ��-cam�� flag, which lets you specify which camera to render from the scene.[You must be registered and logged in to see this image.]
Step 17
You can render as many cameras as you like from the same or different scenes, and also put different flags to make it even more efficient.[You must be registered and logged in to see this image.]
Step 18
Rendering different cameras is even better when combined with the ��-rd�� tag, so each camera will be output into a different folder[You must be registered and logged in to see this image.]
Step 19
Remember that you can combine as many flags as you want to speed up your renders, and then you can view the commands when you type ��Render �Ch�� in the command line.[You must be registered and logged in to see this image.]
Step 20
Some final useful tips for rendering from the command line: Don’t use spaces in the name of the files always put an ��_�� instead; Make sure that the .bat files are saved with their extension after the name; If you want to stop the render process, just close the command line.[You must be registered and logged in to see this image.]
Don’t miss more CG tutorials and guides, published daily – subscribe to Cgtuts+ by RSS.]