RenderToolbox Group exporting objects from Maya
Exporting Objects:
How to export all the objects in a Maya file into separate .obj files via a MEL script.
1.) After generating your scene in Maya, click on the small rectangle at the bottom right corner of the screen. This will open a scripting window in Maya.
2.) Within Maya's scripting user interface, go to "File" and select "OpenScript". From here you will want to load the script called OBJSequenceExport.mel. This script is found in RenderToolbox/Utilities/Maya.
3.) After you load this file it should appear in the Maya script window. Within Maya's scripting user interface, go to "Script" and select "execute" to begin running the script.
4.) Once the script begins it will prompt you to set the path to the folder where you would like the .obj files to be placed. This is typically the scene_objects folder for the particular scene you are working on. You can click on the two dots next to the path name and that will provide a GUI you can use to navigate to the directory you want. Once you have selected the correct folder click on the button that says "Export it!" and the objects will automatically be exported to the directory that you specified.
5.) After the script is finished running the obj and mel files will appear in the directory you specified just as they would have if you had exported them individually. From here you can proceed as you normally would. Note that to save more time in the steps that follow the exporting you can use the Matlab script to clean up your scene_objects folder as described below.
Post Export Cleanup:
After exporting .obj files from Maya there are some bits of text that must be edited within each .obj file before processing can proceed. This script performs these edits automatically to avoid opening individual files. In addition, this script deletes the .mel files that were automatically generated when the .obj files were exported. These files are never used later in processing so it is important to remove them to save disk space.
1.) After exporting, all of your .obj files should reside in a folder called something like "scene_objects." Open Matlab and change directories until you have reached the scene_objects folder for the scene you are interested in rendering.
2.) At the command line type "ProcessObjectFolder". If the code is already in your path this will run the script to remove the MEL files and edit the lines of the .obj files that must be edited before you can proceed with rendering. If not on your path, you can find the script in RenderToolbox/Utilities/Maya.
There are 236 comments on this page. [Display comments]