Joakim - This is excellent :) I have two questions. I put the userSetup code into my userSetup.mel file, correctly me if I'm wrong, shouldn't this load the script menu automatically when Maya starts, or must I always run this command first ? def MyScript(): #Code MyScript() When I run the command listed above, the script…
The main script userSetup.py should call the menu script scriptMenu.py, correct ? If so I have a file called userSetup.py & a file called scriptMenu.py. The following code; def MyScript(): #Code MyScript() What is the purpose of this code ?
[code] [/code] Im not sure what you are looking for but you could put it in a menu or just have it as tabs in the script editor. Would any of that work? Here's how you make a menu for scripts:import maya.cmds as cmdsimport uuid, osdef ScriptsMenu(): if cmds.menu('scriptsMenu', ex=1): cmds.deleteUI('scriptsMenu')…
Ok so, 1. userSetup.py loads the scriptfolder AND runs your scriptMenu.py main function. - to test if this is actually working print TEST in your userSetup file. When starting Maya you open the script editor and if TEST is printed in the output field that means the userSetup file was loaded by Maya. While doing this you…
Sure I can see that but the userSetup file is not a "custom" script in that way. I mean, you will never really touch it again since all scripts will be called from the menu anyway. Still odd that it can't be changed, though. Maybe try making a new thread asking how to change location of the userSetup file.
I prefer to have all scripts in my custom scripts path, that is the only hiccup with your script, which is Maya won't load the script from a custom scripts folder. :)
I think Maya expects it to be in the /2015-x64/scripts folder and I thought it was possible to change that inside maya but ive never done it. Anyway, what stops you from have the usersetup in that place and the actual scripts in your custom path?
I dont think you should expect that to work just by executing in the script editor. Did you find out anything about why your usersetup wont load? Thats the first thing you need to solve. Everything else might work if you solve that.
Ok. I have no idea why your usersetup wont run.. do you have a usersetup.mel in the same folder or in the folder your supposedly changed to? In that case remove the mel file. Otherwise you can try creating a userSetup.mel and just print test in there, just to see if maya only fails to load python.