I delete a shelf tab and add the same tab, updating the contents.
The problem is that executing the code works inside Maya, but executing the code under userSetup.py, the global MEL variable:
$gShelfTopLevel
That holds the path to the shelf,. But when executing the script, it is EMPTY. So the script deleteShelfTab and everything else i do, doesn't work...
Why doesn't it work?
Failed to execute userSetup.py
Traceback (most recent call last):
File "C:/Users/lmartinez/Documents/maya/scripts\userSetup.py", line 15, in <module>
utils.executeDeferred(mayaInitScript.mayaInitScript())
File "R:\resource\technical\maya\mayaInitScript.py", line 29, in mayaInitScript
mel.eval("deleteShelfTab \"" + shelfName + "\"")
RuntimeError: Error occurred during execution of MEL script
file: C:/winapp/3d/Maya2015/scripts/others/deleteShelfTab.mel line 57: setParent: Object '' not found.
This works on an opened Maya. But this variable seems to be holding and empty string...
I do nothing with it before this.