Hi, has anyone had any trouble with their userSetup.py in Maya 2019.1 not running at all?
It was all working fine and as usual for days, after updating to 2019.1, then after closing and re-opening Maya it has stopped running.
I've tried moving the entire thing into a function and calling that with a cmds.evalDeferred() and I've tried peppering the entire thing with print and sys.stdout.write() statements using deferred evaluation. It simply isn't running 😞
Any ideas?
This is my userSetup before the issue, as it has been working for the past year or so.
import pymel.core as pm
import maya.cmds as cmds
from sys_utils import mk_menu
from sys_utils.rollbackImporter import RollbackImporter
rollback = RollbackImporter()
cmds.evalDeferred("mkMenu = mk_menu.MKMenu()")
Solved! Go to Solution.
Solved by phoebe. Go to Solution.
I think I've solved it!
It looks like userSetup is being called earlier that it has in the past, so the imports it relied on from PYTHONPATH weren't available yet. I've nested the imports into the start() function, stored the rollback and menu variables under __main__ and called start() with the lowestPriority flag in cmds.evalDeferred().
import pymel.core as pm
import maya.cmds as cmds
import sys
def start():
from sys_utils import mk_menu
from sys_utils.rollbackImporter import RollbackImporter
import __main__
__main__.rollback = RollbackImporter()
__main__.mkMenu = mk_menu.MKMenu()
cmds.evalDeferred(start, lp=True)
Can't find what you're looking for? Ask the community or share your knowledge.