Cannot perform dirmap with userSetup.py

138 views
Skip to first unread message

Fredrik Averpil

unread,
Sep 21, 2013, 8:02:45 AM9/21/13
to maya...@googlegroups.com
Hi,

I'm trying to perform dirmaps via userSetup.py but it seems this does not work in batchrender mode. 

I've tried to perform this in userSetup.py directly:
maya.cmds.dirmap( ... )
and also deferred:
maya.utils.executeDeferred( ... )

It just doesn't work when in batchrender mode, although it works fine if you launch the Maya GUI.

If I create the dirmaps in the MEL equivalent (userSetup.mel) it all works fine in both batchrender mode and if you run the Maya GUI. It's just that I do not wish to use userSetup.mel as I'd like to keep everything in python and within userSetup.py.

Does anyone know if this is a limitation of dirmap or what could be going on?
I've noticed that not even a simple print statement ( print 'hello' ) in userSetup.py will show up in the terminal when in batchrender mode.

I'm trying to get this to work with Maya 2014 Extension 1 in Windows 7 and in CentOS. And I've got the same MAYA_SCRIPT_PATH setup when running both the GUI and the batchrender commands (pointing at the dir containing both the userSetup.py and the userSetup.mel) ... but no luck.

Any ideas?



// Fredrik

Fredrik Averpil

unread,
Sep 21, 2013, 8:55:13 AM9/21/13
to maya...@googlegroups.com
After struggling a bit with this I have come to a conclusion, but it would be great if someone from Autodesk could confirm it. I don't know if anyone from the big A is on this list? :)

I found this post, saying that maya.cmds.executeDeferred does not get executed in batch render mode: http://download.autodesk.com/us/maya/2011help/PyMel/generated/functions/pymel.mayautils/pymel.mayautils.executeDeferred.html
And so there is the workaround with the pymel wrapper: pymel.mayautils.executeDeferred

However, even if using that when defining the dirmaps, it seems that anything being deferred using this method is delayed quite a bit – so that Maya has time to error out when trying to load a scene that it can't find without the dirmap mapping.

This means that if you're trying to load scenes and "dirmap" the Maya scene path in order to find it, you're forced to use userSetup.mel as this executes immediately and doesn't wait like userSetup.py needs to do with the pymel.mayautils.executeDeferred wrapper.



// Fredrik
Reply all
Reply to author
Forward
0 new messages