Announcements

Between mid-October and November, the content on AREA will be relocated to the Autodesk Community M&E Hub and the Autodesk Community Gallery. Learn more HERE.

userSetup.py stopped running in Maya 2019.1

userSetup.py stopped running in Maya 2019.1

phoebe
Participant Participant
2,153 Views
1 Reply
Message 1 of 2

userSetup.py stopped running in Maya 2019.1

phoebe
Participant
Participant

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()")

 

0 Likes
Accepted solutions (1)
2,154 Views
1 Reply
Reply (1)
Message 2 of 2

phoebe
Participant
Participant
Accepted 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)