Disappearing shelf buttons in Maya 2016 and up?
One reason for disappearing shelf buttons its entry exists multiple times in userPrefs.mel
what confuses the loading. There might be a shelf entry with ; at the end and one without. Both valid
but overwriting each other.
This script runs through the .mel file and tries to remove any line with duplicates.
Besides "shelfName" entries that are filtered are associated "shelfVersion", "shelfFile", "shelfLoad and "shelfAlign" entries
path_to_userprefs: file path to userPrefs.mel. Windows usually "C:/Users/username/Documents/maya/20xx/prefs/userPrefs.mel"
Limited to speed up script, default values should be good. If you need to modify will depend on our file.
Start and end line of to process for search process. You can search "shelf" in userPrefs.mel in text editor to find the section
Hot to use:
Run the script, then reopen shelf (or restart maya)
import pathToFile.missing_shelf_clean_userprefs.py as missi
missi.clean_disappearingshelf_userprefs("C:/Users/monika/Documents/username/2017/prefs/userPrefs.mel", searchlines=[1000, 3000])