Does anybody else have this problem in Maya 7? I didn't have this happening in Maya 5.0.1 To get it to happen, I open the script editor, type the following...
print "hi";
and save it as a script in the script path as test.mel If I type...
Yeah, a procedure does the same problem I stated above. I was just trying to simplify the problem. In fact, I discovered the problem using a procedure. Any ideas?
Nope, that doesn't work either. That gives me the same error. As long as I create the script in the same session of Maya, it will not work. If I exit Maya, and restart, then it will work. Any ideas why this happens? It doesn't sound like a big deal, but we have had some scripts that don't work correctly now because of this. It works in Maya 5.0.1 but not in Maya 7 Thanks!
QUOTE(failure @ 10/13/05, 05:02 AM) try with filename including full path [snapback]217219[/snapback]
Now that works but the problem is trying to use loadNewShelf The command inside the script loadNewShelf does not use the full path. We actually have a work around for this problem, it is just not as easy as it was in Maya 5.0.1 I assume this is just a bug in Maya 7 Thanks for your help failure!
QUOTE(Geegrafix @ 10/13/05, 04:47 AM) Nope, that doesn't work either. That gives me the same error. As long as I create the script in the same session of Maya, it will not work. If I exit Maya, and restart, then it will work. Any ideas why this happens? It doesn't sound like a big deal, but we have had some scripts that don't work correctly now because of this. It works in Maya 5.0.1 but not in Maya 7 Thanks! [snapback]217216[/snapback]
Failure,
I stand corrected, using the ./ does work like you said but, inside the script, loadNewShelf, it does not use that. I could update that script, but then it would need to be done on everyone's computer... blah blah blah, also making sure any new installs of Maya would have it changed etc... I don't think changing it is the way to go. I guess for now, we are stuck using our current work around. It is just too bad it got more difficult. Thanks again.
There is some kind of glitchiness with the source directive. Depending on the context in which the script is invoked MAYA_SCRIPT_PATH may not be fully defined or the search for the source file fails for some reason.
I would put all dependent scripts in the same folder and then use "./file.mel" syntax which explicitely states that the file is located in current directory - that is the directory in which the caller resides.
Maya only scans the scripts directory only one time at start-up. This is to save resources when dealing with scripts that are spread across the network. By running the command "rehash" Maya will recan the scripts directory. You only need to rehash only when there is a new file (inlcuding name changes) in the script diectory. You don't need the .mel when typing the source statement. The full path is not needed.
QUOTE(Nihilists @ 10/17/05, 03:27 AM) The answer is very simple: CODE rehash;
Maya only scans the scripts directory only one time at start-up. This is to save resources when dealing with scripts that are spread across the network. By running the command "rehash" Maya will recan the scripts directory. You only need to rehash only when there is a new file (inlcuding name changes) in the script diectory. You don't need the .mel when typing the source statement. The full path is not needed.