# Shelf Button Name Lost On Restart

**URL:** https://forum.highend3d.com/t/shelf-button-name-lost-on-restart/2808
**Category:** Maya
**Tags:** mel
**Created:** [September 21, 2006, 5:02pm UTC](https://forum.highend3d.com/t/shelf-button-name-lost-on-restart/2808 "2006-09-21T17:02:32Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![shakes](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/s/f4b2a3/32.png) [@shakes](https://forum.highend3d.com/u/shakes)
#### Post date: [September 21, 2006, 5:02pm UTC](https://forum.highend3d.com/t/shelf-button-name-lost-on-restart/2808/1 "2006-09-21T17:02:32Z")

</div>

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?

Thanks

---

<div class="post-metadata">

### Author: ![joojaa](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/j/5daacb/32.png) [@joojaa](https://forum.highend3d.com/u/joojaa)
#### Post date: [September 21, 2006, 6:02pm UTC](https://forum.highend3d.com/t/shelf-button-name-lost-on-restart/2808/2 "2006-09-21T18:02:17Z")

</div>

Yes see button names dont get passed to the shelf save routines and its apin to hack them there but its possible.

---

<div class="post-metadata">

### Author: ![shakes](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/s/f4b2a3/32.png) [@shakes](https://forum.highend3d.com/u/shakes)
#### Post date: [September 21, 2006, 7:16pm UTC](https://forum.highend3d.com/t/shelf-button-name-lost-on-restart/2808/3 "2006-09-21T19:16:41Z")

</div>

Ok, so how would you do it?

---

<div class="post-metadata">

### Author: ![shakes](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/s/f4b2a3/32.png) [@shakes](https://forum.highend3d.com/u/shakes)
#### Post date: [September 22, 2006, 12:16pm UTC](https://forum.highend3d.com/t/shelf-button-name-lost-on-restart/2808/4 "2006-09-22T12:16:33Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![joojaa](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/j/5daacb/32.png) [@joojaa](https://forum.highend3d.com/u/joojaa)
#### Post date: [September 22, 2006, 12:49pm UTC](https://forum.highend3d.com/t/shelf-button-name-lost-on-restart/2808/5 "2006-09-22T12:49:50Z")

</div>

Yes byt tis has a porblem... if you add stuff to the shelf maya may decide to fix the name again.

---

<div class="post-metadata">

### Author: ![shakes](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/s/f4b2a3/32.png) [@shakes](https://forum.highend3d.com/u/shakes)
#### Post date: [September 22, 2006, 5:31pm UTC](https://forum.highend3d.com/t/shelf-button-name-lost-on-restart/2808/6 "2006-09-22T17:31:05Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![joojaa](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/j/5daacb/32.png) [@joojaa](https://forum.highend3d.com/u/joojaa)
#### Post date: [September 22, 2006, 5:32pm UTC](https://forum.highend3d.com/t/shelf-button-name-lost-on-restart/2808/7 "2006-09-22T17:32:30Z")

</div>

Yes but you can remake the save routines to incorporate the name!

---

<div class="post-metadata">

### Author: ![shakes](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/s/f4b2a3/32.png) [@shakes](https://forum.highend3d.com/u/shakes)
#### Post date: [September 22, 2006, 6:36pm UTC](https://forum.highend3d.com/t/shelf-button-name-lost-on-restart/2808/8 "2006-09-22T18:36:29Z")

</div>

That'd be cool, how do you do that?
