0

I have used the addNewShelfTab and scriptToShelf command in MEL to create an icon for my mini mel script. I want to be able to change the icon for this button from the default like you can from the Shelf Editor by using either MEL or Python. How can I go about doing this?

shaveenk
  • 1,983
  • 7
  • 25
  • 37

2 Answers2

0

shelfButton mel command help

shelfButton -edit -image1 "icon.png" $name;
SAF
  • 309
  • 2
  • 13
0

The following python script worked for me:

import maya.mel as mel
import pymel.core as pm

mel.eval('addNewShelfTab($shelfName)');
pm.shelfButton( annotation='Annotation', image1=$image, command='<command>' );
shaveenk
  • 1,983
  • 7
  • 25
  • 37