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.
Owen
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.





Subscribe
Hi,
Thanks for posting this, good stuff to know!
Do you know if there is a way to *disable* maya from falling back on the absolute paths, or to pre-emptively disable a maya scene from loading any file textures or references (besides the options available in the open options [do not load references]), or opening the .ma editing the text? This is in an event where it's not possible to open the scene first and "disable file load", etc on any file nodes, cache nodes, etc.
Here's an example - I am hooked up from home to a VPN to a local network at the office, and I copy the maya scene to my home computer. The bandwidth isn't too good, but the file size of the scene is small. I disable the loading of the reference models, which works OK, but Maya goes to open the 11 MB HDR file for the IBL. Unfortunately, this works (haha), because the absolute path (UNC path for OSX) is valid, since I am logged in to the VPN and all the volumes at the office are mounted and seen as local. So the scene takes about 10-15 min to open while it loads the IBL over a very slow network connection.
I just want to open the scene to edit some animation, and I don't need any file textures to load. Any way to temporary suspend this BEFORE the scene is opened?
Thanks for any help!
Best,
Matt
Posted by: M Foglia | 01/11/2010 at 06:51 PM
@M Foglia
if you don't switch to shaded/textured mode, you can quickly set the .disableFileLoad attribute on all file textures to avoid loading the textures over the network with for ($file in $fileNodes) {setAttr ($file + ".disableFileLoad") 0;}
Posted by: THNKR | 01/11/2010 at 10:45 PM
[quote]** If you are rendering from the command line Autodesk recommends you copy the project directory to each render station, and explicitly set the path to the project folder that contains the scene you are rendering by including the “-proj” flag in your command.[/quote]
Are you serious about this???
Copying/syncing the whole project each time for a render is likely to take longer than the actual rendering..
Posted by: Jimmy Christensen | 02/11/2010 at 08:30 AM
Nevermind the above comment. Guess it was taken out of context.
Either way reading/writing the workspace.mel is still bad. Ever heard of race conditions?
Posted by: Jimmy Christensen | 02/11/2010 at 08:32 AM
recommendation to copy entire project folder to rendernodes' local drives is the dumbest thing i heard recently.
sorry for being rude, but sometimes ADSK acts like it's making software for kids, not for production teams (except its price). Do you ever talk to your customers and ask about their pipelines ?
Posted by: michal | 02/11/2010 at 04:42 PM
Yes, it started with maya 2011, and yes, we set -proj for the command line renders via Rush render que, and yes, it still over-writes the workspace.mel with a short-bus equivalent. The method we currently employ to work around this new "feature" from our great ant overloads at Autodesk is to change permissions on the workspace.mel so it cannot be over-written by maya. Without this, ncaches, images, textures all go bonkers....to use the technical term.
So whatever happened between 2010 and 2011 is one on a long list of should-have-been-caught-in-beta that I keep in a rainbow colored trapper keeper under my desk.
Hope the write permissions tip helps some of you before you become as bald as I am.
Cheers,
-ctj
Posted by: Christopher T. Janney | 02/11/2010 at 05:53 PM
@Michal: you're right, what I wrote wasn't entirely accurate; on 'network rendering', the Maya 2011 docs say:
File Access
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.
Owen
Posted by: owen | 02/11/2010 at 06:53 PM
Hi Owen ...is it possible to adjust the way maya launches into the default Persp window on startup? I thought workspace.mel would be a good place to start! However now I'm thinking this would be something in user /prefs since workspace.mel is project centric!
I get asked this allot from our users...
Cheers
Posted by: Nick | 04/02/2011 at 02:35 PM
Hey Nick,
You're correct, the variable that controls the default layout is stored in the "userPrefs.mel" file, and not the "workspace.mel" file.
Artists set the default layout in the Settings/Preferences > Preferences window.
Go to the Interface > UI Elements section, and look for Panel Configurations. Here you can set the layout used when 'Starting new scenes'.
This option is saved in the user's "userPrefs.mel" file as, for example: optionVar -sv "newScenePanelConfiguration" "Single Perspective View";
Other options include (but maybe not limited to):
. "Four View"
. "Persp/Outliner"
. "Persp/Graph"
. "Hypershade/Persp"
. "Persp/Graph/Hypergraph"
Hope that helps,
O
Posted by: Owen | 04/02/2011 at 03:16 PM
hey mate! I was just going to reply to my post saying I found it ...I was sifting through the files thinking it wasn't a UI option when I found the newScenePanelConfiguration attr which pointed me back to Win > Pref
Thanks for the reply though! This has resolved a few questions! Much appreciated.
cheers
Posted by: Nick | 04/02/2011 at 03:37 PM
Can anyone confirm if this has been fixed in Maya 2012? We use a Linux renderfarm and the workspace.mel still seems to get overwritten. It seems to be that when another 2 nodes try saving the file at the same time (which happens constantly on farms) we get incomplete entrys etc...
What on earth posessed them to change this operation and are they going to change it back? - or give us the option to disable it!
This must be wrecking havok on farms the world over!
Posted by: Jono | 08/03/2011 at 08:49 PM