Cannot Save Scripts in Script Editor and Shelf Editor

Cannot Save Scripts in Script Editor and Shelf Editor

jpasionAG5FN
Participant Participant
3,717 Views
10 Replies
Message 1 of 11

Cannot Save Scripts in Script Editor and Shelf Editor

jpasionAG5FN
Participant
Participant

Hi,

 

I'm trying to Save script mels for certain controls for this rig I'm using to animate, but the window for saving it does not appear. Also, I can save the script command  mel to a shelf but when I close Maya then open it back up the mel disappears from the shelf. How can I fix this? 

 

 

 

0 Likes
3,718 Views
10 Replies
Replies (10)
Message 2 of 11

fowlert
Autodesk
Autodesk

When you say "the window for saving it does not appear" do you mean that you hit File -> Save Script in the Script Editor and the file dialog doesn't open to let you choose a file location?

 

And for saving the shelves, do you happen to have the option to save all preferences and settings on exit off?  That option is in the main prefs in the "Save Actions" section.  I know a lot of people get their preferences the way they like them and then they disable that option, but that does block automatically saving of edited shelves (along with any other pref's you might have changed).

 

 

0 Likes
Message 3 of 11

jpasionAG5FN
Participant
Participant

Yes,  the file dialog doesn't open to let me choose a file location in the script editor.  And no, I have the boxes checked in the "Save Actions" section of the prefs and they're on, not off. So I should have the boxes unchecked? 

Message 4 of 11

fowlert
Autodesk
Autodesk

When you try to save your script does Maya lock up?  I have seen cases where the file dialog opens off screen and you can't see it, but in that case Maya would be completely locked.  Are there no errors at all in the script editor or Output Window?  If you turn on "Echo All Commands" in the script editor and then click the menu item what does it print out?

 

You can try calling this from the script editor to see if it works, this is what the menu would call for a mel tab:

commandScrollFieldPromptForFile "Save Selected" "C:/Users/timfo/Documents/maya/2020/scripts/" 1 "mel";

 

 

For the shelves, if you hit the little gear icon on the left side of the shelves and choose "Save All Shelves" does it save it then? 

 

Also for the shelves, after hitting the "Save All Shelves" menu, go to your preferences folder and check if the file actually got saved.  You should see some .mel files under <Maya prefs>/prefs/shelves.  Open up the .mel file for the shelf you saved in a text editor (e.g. if you saved to the "Polygons" shelf then open up shelf_Polygons.mel).  Does it have the button you expected listed in there?  You should be able to figure out if it's there or not depending on what it's executing in the "-command" line.  I think the buttons get saved in the order they are in the UI, so if you added a button at the end then it should be listed last in the .mel file.

Message 5 of 11

jpasionAG5FN
Participant
Participant

Maya doesn't lock up when I try to save the script, the "Save As" box just doesn't show up. And there is also no errors that show up in the output window when I try to save scripts. When I enable "Echo all commands" and click on the shelf button I just made, it prints out this:

 

// Result: scriptEditorPanel1Window|scriptEditorPanel1|formLayout98|formLayout100|paneLayout4|cmdScrollFieldReporter1 //
select -r Bones_Rig:Head_CON ;
autoUpdateAttrEd;
updateAnimLayerEditor("AnimLayerTab");
statusLineUpdateInputField;
if (!`exists polyNormalSizeMenuUpdate`) {eval "source buildDisplayMenu";} polyNormalSizeMenuUpdate;
dR_updateCounter;
dR_updateCommandPanel;
autoUpdateAttrEd;
updateAnimLayerEditor("AnimLayerTab");
statusLineUpdateInputField;
if (!`exists polyNormalSizeMenuUpdate`) {eval "source buildDisplayMenu";} polyNormalSizeMenuUpdate;
dR_updateCounter;
dR_updateCommandPanel;

 

 

As for the shelves, yes, when I hit Save All Shelves, the shelves are saved in the prefs folder but the actual buttons/icons within them disappear. 

 

I have some screenshots here. Before_Button.pngPrintout.pngreopening_maya.png

 

 

 

Message 6 of 11

fowlert
Autodesk
Autodesk

Hmm...that is odd.  You have a Shelf named "Bones", so there should be a shelf_Bones.mel file in your prefs.  Can you paste that file here?  At this point I'm still only guessing, but I have heard of people that do not have write permission on certain files/folders.  That would be something else to confirm.

 

My question about turning on "Echo All Commands" was meant for the "Save Script" problem.  Try enabling that and hitting the File -> Save Script menu in the Script Editor.

 

The other thing to try that everyone is quick to suggest is to remove your pref's folder and start Maya back up, that can sometimes fix odd problems.  If you do that then I always ask people to zip up their pref's and let us look at them.  Sometimes there's an option turned on that you're not aware of and comparing the old and new pref's helps us figure out what was happening.

0 Likes
Message 7 of 11

jpasionAG5FN
Participant
Participant

Hi, I've tried all of that and it's still not letting me save scripts and saving them in the shelf. What is the right way to delete the prefs folder and how can I send you the prefs folder? 

 

 

0 Likes
Message 8 of 11

jpasionAG5FN
Participant
Participant

It's now saying "syntax error" at the bottom 😞

Message 9 of 11

fowlert
Autodesk
Autodesk

Looks like you're on Windows, so your pref's folder should be in your "My Documents" folder.  You should see a folder for each major version of Maya there, so for me for Maya 2020 I have:  C:\Users\timfo\Documents\maya\2020

 

To send me the pref's you could zip up your entire "2020" folder and send that.

 

To reset all of your pref's you would just delete the 2020 folder and start Maya back up, it will recreate it.  The only thing you have to watch for here is if you've put stuff in there you might want to save.  e.g. under maya/2020/scripts you might have some scripts you downloaded, or maybe there are other shelves you have under maya/2020/prefs/shelves.  Of course if you zip it all up first before deleting then you have that as a backup in case you did delete something.

 

 

 

0 Likes
Message 10 of 11

jpasionAG5FN
Participant
Participant

Thank you, I have the 2020 folder attached below

Message 11 of 11

jpasionAG5FN
Participant
Participant

And another thing, I just deleted the prefs folder and reopened maya and it's saving the scipt mel buttons to the shelf but still won't allow me to save to my hard drive/external hard drive even with the "Echo all commands" on