Maya 2014 scriptjobs

Have these changed in some way in terms of threading? I have a scriptjob for selection change that fires off a function:


def getSelection():
    return cmds.ls(sl=True, l=True) or []

After going to maya 2014, i sometimes get errors that

“Flag ‘l’ must be passed a boolean argument”

Which it most certainly is. I have seen errors like this before, but they were happening in threaded stuff and I get why that is bad. But I thought the script jobs were run on the main thread. Did something change or am i doing this wrong?

Thanks

So I’m in Maya 2014 sp1 and this worked for me with no errors…


def getSelection():
    print cmds.ls(sl=True, l=True)
    return cmds.ls(sl=True, l=True) or []
    

cmds.scriptJob( event = ( "SelectionChanged", getSelection ) )

Can you show how your writing the scriptJob?

-Nick