Maya Custom Environment Setup and MayaBatch

Hi,

We’re looking at getting Maya working in our studio and on our renderfarm. As such we’ve created a custom environment using a batch script rolled up into a .exe file to run Maya so that we can centralise the installation of our plugins and customisation. Unfortunately this seems to cause us a problem when we’re rendering MayaBatch jobs through deadline because they stall just before giving the “READY FOR INPUT” command to deadline, it looks like they’re waiting for a mel command to proceed.

I’ve attached the code we’re using in our .bat file that we’ve converted into a .exe file, which we have then redirected the Maya 2013 Plugin in Deadline to use. Because we’re going through our batch file to run the mayabatch.exe I’m wondering if this is whats causing the problem, we’ve had to add %* to the end of the batch script to pass the variables through.

I’ve also attached a screengrab on the render machine so you can see where it’s got to. Interestingly this works fine for a Maya Software render but if we use either Arnold or Vray it stalls.

Any help anyone can offer would be great!

Nick

[code]@echo off
C:
cd \

rem \---- RLM License Server
set RLM_LICENSE=5053@TITAN02

rem \---- Codebase Root
set CODEBASE=S:\Codebase\PipelineTools\src

rem \---- MEL root
set MELROOT=%CODEBASE%\sl_codebase\maya\startup

rem \---- Maya Installation
set MAYA=C:\Program Files\Autodesk\Maya2013

rem \---- Maya Executable
set MAYABIN=%MAYA%\bin

rem \---- Module path
set MAYA_MODULE_PATH=S:\Codebase\Maya\maya2013\modules

rem \---- Yeti plugin setup
set YETIBIN=%MAYA_MODULE_PATH%\Yeti-v1.2.5_Maya2013-windows64\bin
set YETI_HOME=%MAYA_MODULE_PATH%\Yeti-v1.2.5_Maya2013-windows64
set YETI_DOCS=%MAYA_MODULE_PATH%\Yeti-v1.2.5_Maya2013-windows64\docs
set YETI_EXTENSION=%MAYA_MODULE_PATH%\Yeti-v1.2.5_Maya2013-windows64\plug-ins

rem \---- MtoA plugin setup
set MTOA_RENDER_DESC_PATH=%MAYA_MODULE_PATH%\mtoa
set MTOABIN=%MAYA_MODULE_PATH%\mtoa\bin
set MTOA_EXTENSIONS_PATH=%MTOA_EXTENSIONS_PATH%;%YETI_EXTENSION%
set MTOA_PLUGINS_PATH=%MAYA_MODULE_PATH%\mtoa\shaders

rem \---- Vray plugin setup
set VRAY_RENDER_DESC_PATH=%MAYA_MODULE_PATH%\vray\maya_root\bin\rendererDesc
set VRAY_FOR_MAYA2013_MAIN_x64=%MAYA_MODULE_PATH%\vray\maya_vray
set VRAY_FOR_MAYA2013_PLUGINS_x64=%MAYA_MODULE_PATH%\vray\maya_vray\vrayplugins
set VRAY_AUTH_CLIENT_FILE_PATH=%MAYA_MODULE_PATH%\vray
set VRAYBIN=%MAYA_MODULE_PATH%\vray\maya_root\bin
set VRAY_PLUGINS=%MAYA_MODULE_PATH%\vray\maya_vray\plug-ins
set VRAY_SCRIPTS=%MAYA_MODULE_PATH%\vray\maya_vray\scripts

rem \---- LD Library paths
set LD_LIBRARY_PATH=%LD_LIBRARY_PATH%;%YETIBIN%
set DYLD_LIBRARY_PATH=%DYLD_LIBRARY_PATH%;%YETIBIN%

rem \---- userSetup.mel path
set MAYA_SCRIPT_PATH=%MELROOT%;%VRAY_SCRIPTS%

rem \---- Xbmlangpath
set XBMLANGPATH=%XBMLANGPATH%;%MAYA_MODULE_PATH%\vray\maya_vray\icons%B

rem \---- Plugin path
set MAYA_PLUG_IN_PATH=%MAYA_PLUG_IN_PATH%;S:\Codebase\Maya\maya2013\plug-ins;%VRAY_PLUGINS%

rem \---- Maya Render Desc Path
set MAYA_RENDER_DESC_PATH=%MAYA_RENDER_DESC_PATH%;%MTOA_RENDER_DESC_PATH%;%VRAY_RENDER_DESC_PATH%

rem \---- Put Maya on the PATH
set PATH=%PATH%;%MAYABIN%;%YETIBIN%;%MTOABIN%;%VRAYBIN%

rem \---- Python paths
set PYTHONPATH=%PYTHONPATH%;%CODEBASE%;%MAYA_SCRIPT_PATH%

rem \---- Start Maya
mayabatch %*[/code]

That’s interesting that it works for one renderer but not others. To me, it looks like a problem where the stdin that Deadline is normally piping directly to mayabatch isn’t making it to mayabatch. Perhaps it’s swallowed by the batch process, but if that were the case, I wouldn’t expect the mayaSoftware renderer to work either…

Hi Ryan,

I’ve tested the Maya Software job again and you’re right it’s not working either. Any ideas for what we could do to diagnose where it’s getting stuck or how we can make this work?

Cheers

Nick

Normally, Deadline is piping standard input (stdin) directly to mayabatch. I think the problem is that now that stdin is going to the batch file, and it’s not being passed on to mayabatch. I know you can redirect a file to a process’ stdin within a batch file, but I don’t know if it’s possible to continuously stream stdin that the batch file is receiving to a process that it has started.

Back when we were in production, we used to have a compiled C++ exe that wrapped our render processes. This gave us greater control over the process, so we could deal with stdin/stdout.

In Deadline 6, we have added the ability to specify environment variables for a job that are applied to the rendering process, which would probably be exactly what you need in this case. Unfortunately, for 5.2, the only solution I can think of would involve modifying the MayaBatch.py plugin file directly. Essentially, you would use the plugin API to assign environment variables to the rendering process. If this is something you want to explore, let me know and I can point you in the right direction.

Cheers,

  • Ryan

Hah, I love it, always making sure we’re keeping up to date with the versions by adding the functionality we want to the newest version! We’ve got the Deadline 6 Beta 12 running at the moment, whereabouts are the options and how do we go about adding them in?

Cheers

Nick

Check the release notes for beta 10 in the beta announcements. Then scroll down to the “Job Environment Variables” section.

Cheers,

  • Ryan

Hi,

Just a quick update, that worked a treat, although because we have so many variables to put in I’ve had to write my own submitter. I wonder if other users might find it easier if they can specify some defaults env variables that can be put in defaultly?

Nick