Hi, I'm making this shelf and one of the button's icon image changes when you click it. It does this by checking to see what the current icon image is and then changing approprietly:
shelfButton -q -image NameofButton;
Unfortunately when I restart Maya it stops working because it can't find "NameofButton". Any suggestions?
So, I figured out what to do so I figured I'd post it in case anyone was searching this. Pretty easy actually, when Maya saves a shelf it goes into your user shelves directory(which you can find using print (internalVar -ush); ). It doesn't save the button names but you can just add them in manually to the file there and it works fine.
Ya your right, I didn't realise until I closed and reopened maya for a second time(because it saves the shelf everytime you close maya properly). So I made the shelf file read-only, not the greatest solution but I'm the only using this script and all it does is comes up with a warning that it can't save over the read-only file.