Community
Maya Programming
Welcome to Autodesk’s Maya Forums. Share your knowledge, ask questions, and explore popular Maya SDK topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

userSetup.py stopped running in Maya 2019.1

1 REPLY 1
SOLVED
Reply
Message 1 of 2
phoebe
1849 Views, 1 Reply

userSetup.py stopped running in Maya 2019.1

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

 

Tags (3)
1 REPLY 1
Message 2 of 2
phoebe
in reply to: phoebe

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.

Post to forums  

Autodesk Design & Make Report