What is dirmap? dirmap is a Maya command that will tell maya to scan and change directory structures as the scene is loaded.. This command works in two steps. First we need to enable it so Maya knows that path remapping must be done. The second part is to give the from and to arguemnts so maya can spot the bad path and replace it with the new one.
How to use this within the UI
1. Launch Maya and setup the dirmap commands so that Maya changes the paths when loading the scene. After loading re-save file. The commands would look something like.
dirmap -en true;
dirmap -m "C:/Users/cruzn/Desktop/trainingContent_troubleshooting//sourceimages/" "C:/Users/cruzn/Desktop/trainingContent_troubleshooting/missing/";
The above tells Maya that on load of a scene check for these parameters. If any hit the old path than the new path would be set. we can use multiple lines to remap texutres in different directories
Using dirmap without UI
If you wish to avoid having to load the scene in the UI and want to go straight in to rendering than the second option will be to make a *.mel procedure like.
global proc dirMap()
{
dirmap -en true;
dirmap -m "C:/Users/cruzn/Desktop/trainingContent_troubleshooting//sourceimages/" "C:/Users/cruzn/Desktop/trainingContent_troubleshooting/missing/";
}
Much like the first option you will need to change the paths to match the current folders.
Save this file as a dirMap.mel in C:/Users/username/maya/2013-x64\scripts. All the rendering machines will need this.
When rendering you will need to use the -preRender flag with the command to launch the script we created. It is case sensitive so please make sure you use the "dirMap" exactly as described in this example.
So with the paths set in the script and saved we can now render.
"C:\Program Files\Autodesk\Maya2013\bin\Render.exe" -r mr -v 3 -preRender "dirMap" Z:\pathtest.mb
This will make the changes to the paths before render begins. I use verbosity 3 to capture warning such as missing textures.
Cheers!
Nelson
It would be better, if Maya has the same behavior of Softimage in situations like that... When Softimage detects that you´re trying to open a scene file from a diferent project that was set, it asks if you want to change the project automatically.
Posted by: Rodrigo Elias | 03/12/2012 at 06:43 PM