Maya 2011 overwrites the workspace.mel file whenever the user sets a Project, or launches a Batch Render, unlike in Maya 2010 where the workspace.mel file was read but not overwritten.
Maya 2011 reads the contents of the file to set its internal file rules before overwriting the (same) file - so there is no corruption of the file rules - but the header will get modified and you'll lose any comments you previously had editied in. Some people feel that Maya should not be overwriting the workspace.mel file at all when it just needs to read the file contents and so Autodesk is looking at changing this behaviour.
This next point is not new to Maya 2011 but I thought it was worth sharing anyway.
When Maya is opened, or you double-click a maya scene file to open Maya, the initial workspace is set from a preference stored in your userPrefs.mel file. The optionVar is called "lastLocalWS", which stores the path to a workspace.mel file. When Maya opens, it reads "lastLocalWS" and attempts to read the workspace.mel file at this location, and set the file rules accordingly.
If the workspace.mel file referred to in "lastLocalWS" does not exist but the path to your Project directory can be resolved*, Maya will create a new workspace.mel file in that directory This new workspace.mel file will typically only contain a small subset of the file rules required to describe your entire Project. Now we have a problem because the file rules in the (new) workspace.mel file only partially describe your Project.
If your Project is stored locally you may not see the problem until you move to another workstation and try opening the file through a mapped network drive. Assuming you haven't set your Project before opening a scene file, it is possible that Maya will be looking for your nCache or texture image file in the wrong Project. If the Project-relative part of the file path cannot be resolved, Maya will fall back on the file's full path. If the full, or absolute path to your nCache or texture image refers to a file on the C: drive, but you're actually accessing this file via a mapped network drive (let's say you want to start a batch render on another workstation), Maya is going to be unable to resolve the absolute path**
To be sure that Maya pulls in all the necessary external files when you open a scene file, be sure to remember the following:
- Make sure that each project directory contains a workspace.mel file with file rules that accurately describe what type of file is stored in which sub-directory.
- Set the Project before you open a scene file, or perform a Batch Render.
If you don't, Maya is likely to create a workspace.mel file for you, which may be incomplete, or Maya will look for external files based on their absolute file path, which may be incorrect if you're sharing files across a network.
If you are unsure of your current working directory, check it with the MEL command:
workspace –q –rd;
// Result: C:/Users/burgeso/Documents/maya/projects/default/
I hope that helps.
2/11/10: I ammended this post after a couple of readers pointed out some inaccuracies.
* If the Project path referred to in "lastLocalWS" cannot be resolved, or the optionVar is not set, Maya will set the current workspace to the local user/default project.
** On 'network rendering', the Maya 2011 docs say:
All files, scenes, and textures you use must be stored in locations accessible to each render workstation. This can be achieved by doing either of the following:
- Providing the files to all the render workstations from a central file server. File permissions must be adjusted for your environment.
- Transferring the files to each render workstation’s local storage.