Maya 2018 render settings at startup

pipeline

#1

I’m having trouble getting my render settings set at startup. My setup worked fine in Maya 2016, but it broke in 2017. The issue still persists in 2018.

If you put the code below into a userSetup.py (I just placed this test userSetup in one of the default Maya python path directories) and run Maya, you’ll see that the first 2 evals work fine, but they don’t run the code when I need it executed (after VRay is initialized). The last one, the script job, executes the code at the right time, but it breaks the render globals window (window is blank). Is this a bug? Thanks!

#userSetup.py

import sys
import maya.cmds as mc
import maya.utils

def print_text():
    print 'ran script'

#mc.evalDeferred('print_text()')
#maya.utils.executeDeferred('print_text()') 
mc.scriptJob(runOnce=True, e=["idle", print_text])