Maya Plugin Submitter - Vray Export / Render using specific vray.exe version

Hello,
I’d like to be able to chose which version of Vray to use when sending a Vray Export Job with the Maya Submitter.

For now, the default action send create two jobs :

  • A vray export job
  • A vray render job

Some of our projects will need vray4 (maya 2018) while some other need to be launched using vray5 (maya 2020), so both exe paths are listed in the plugin config.
Problem is, the vray render job will get the first vray.exe path listed in the deadline plugin configuration, so all jobs are launched using vray.exe from \Maya2018 path:

image

We tried adding a separate Vray5 deadline plugin, but we can’t find a way to tell Maya submitter plugin to create a job using this plugin when choosing “Vray Export Job” on the submitter.

I couldn’t find anything to tinker with in deadline_repo\scripts\Submission\MayaSubmission.py

:diamonds: Is there a way to force the jobs created with Maya Submitter Plugin to always pick a specific vray.exe path, unregarding the path order in the plugin config?

:diamonds: If not, is there a way to force the Maya Submitter Plugin to use another Deadline Plugin when chosing “Vray Export Job” ?

Thanks

Unfortunately it is not possible out of the box.
Have not done this for Maya+Vray, but for some other plugins:

  • modify the submitter to pass the full version as a job property
  • modify the plugin config file to have a different executable path for each version; then configure the right executable paths
  • modify the plugin to read the full version and select an executable from the config accordingly

It is not a ton of work, but you’d have to get your hands in some dirty python code.

Thanks for your answer Mois,

Dirty python stuff does not scare me, but I find it pretty hard to find an entry point to all that customization.

  • modify the submitter to pass the full version as a job property

I’m guessing this would be in SubmitMayaToDeadline.mel?

  • modify the plugin to read the full version and select an executable from the config accordingly

Would this be in deadline_repo\plugins\Vray\Vray.py, in renderExecutable() ?

In order to customize plugins you can copy them to deadline_repo/custom/plugins so you won’t have to modify the original. Plugins are picked from custom by default if they exist.

Here is an example for Houdini:

Good luck!

A good place to learn from is the MayaBatch integration.

In the MayaBatch.py, you can see how a version is used to resolve a specific version of the application:

## Called by Deadline to get the render executable.
def RenderExecutable( self ):
    versionString = str( self.Version ).replace( ".", "_" )
    
    mayaExecutable = ""
    mayaExeList = self.deadlinePlugin.GetConfigEntry( "RenderExecutable" + versionString )
    
    if(SystemUtils.IsRunningOnWindows()):
        if( self.Build == "32bit"):
            self.deadlinePlugin.LogInfo( "Enforcing 32 bit build of Maya" )
            mayaExecutable = FileUtils.SearchFileListFor32Bit( mayaExeList )
            if( mayaExecutable == "" ):
                self.deadlinePlugin.LogWarning( "32 bit Maya " + versionString + " render executable was not found in the semicolon separated list \"" + mayaExeList + "\". Checking for any executable that exists instead." )
       
        elif( self.Build == "64bit" ):
            self.deadlinePlugin.LogInfo( "Enforcing 64 bit build of Maya" )
            mayaExecutable = FileUtils.SearchFileListFor64Bit( mayaExeList )
            if( mayaExecutable == "" ):
                self.deadlinePlugin.LogWarning( "64 bit Maya " + versionString + " render executable was not found in the semicolon separated list \"" + mayaExeList + "\". Checking for any executable that exists instead." )
       
    if( mayaExecutable == "" ):
        self.deadlinePlugin.LogInfo( "Not enforcing a build of Maya" )
        mayaExecutable = FileUtils.SearchFileList( mayaExeList )
        if( mayaExecutable == "" ):
            self.deadlinePlugin.FailRender( "Maya " + versionString + " render executable was not found in the semicolon separated list \"" + mayaExeList + "\". The path to the render executable can be configured from the Plugin Configuration in the Deadline Monitor." )
    
    return mayaExecutable

The self.Version comes from

def StartJob( self ):
    self.Version = StringUtils.ParseLeadingNumber( self.GetPluginInfoEntry( "Version" ) )
    self.Version = int(self.Version * 10) / 10.0 # we only want one decimal place
    if not str(self.Version).endswith(".5"):
        self.Version = int(self.Version) * 1.0 # If it's not a *.5 Version, then we want to ignore the decimal value
    
    self.Build = self.GetPluginInfoEntryWithDefault( "Build", "None" ).lower()
    
    self.LogInfo( "Rendering with Maya Version " + str(self.Version) )
    ...

The Job has a Version value in the PluginInfo metadata because the submitter wrote it there:

proc string WriteJobFilesAndSubmit( string $renderer, int $showDialog, int 
$regionRendering, int $jobType, string $cameraOverride )
{
    ... way down the function ...
	fprint $fileId ( "Version=" + MayaVersion() + "\n" );

In the MayaBatch.param file in the plugins/MayaBatch, you will find multiple parameters defining the possible executables:

[RenderExecutable2017_0]
Type=multilinemultifilename
Category=Render Executables
CategoryOrder=0
Index=13
Label=Maya 2017 Render Executable
Default=C:\Program Files\Autodesk\MayaIO2017\bin\MayaBatch.exe;/usr/autodesk/mayaIO2017/bin/maya;/Applications/Autodesk/mayaIO2017/Maya.app/Contents/bin/maya;C:\Program Files\Autodesk\Maya2017\bin\MayaBatch.exe;/usr/autodesk/maya2017/bin/maya;/Applications/Autodesk/maya2017/Maya.app/Contents/bin/maya
Description=The path to the Maya 2017 executable file used for rendering. Enter alternative paths on separate lines.

[RenderExecutable2017_5]
Type=multilinemultifilename
Category=Render Executables
CategoryOrder=0
Index=14
Label=Maya 2017.5 Render Executable
Default=C:\Program Files\Autodesk\Maya2017.5\bin\MayaBatch.exe;/usr/autodesk/maya2017.5/bin/maya;/Applications/Autodesk/maya2017.5/Maya.app/Contents/bin/maya
Description=The path to the Maya 2017.5 executable file used for rendering. Enter alternative paths on separate lines.

[RenderExecutable2018_0]
Type=multilinemultifilename
Category=Render Executables
CategoryOrder=0
Index=15
Label=Maya 2018 Render Executable
Default=C:\Program Files\Autodesk\Maya2018\bin\MayaBatch.exe;/usr/autodesk/maya2018/bin/maya;/Applications/Autodesk/maya2018/Maya.app/Contents/bin/maya;/usr/autodesk/mayaIO2018/bin/maya
Description=The path to the Maya 2018 executable file used for rendering. Enter alternative paths on separate lines.

[RenderExecutable2019_0]
Type=multilinemultifilename
Category=Render Executables
CategoryOrder=0
Index=16
Label=Maya 2019 Render Executable
Default=C:\Program Files\Autodesk\Maya2019\bin\MayaBatch.exe;/usr/autodesk/maya2019/bin/maya;/Applications/Autodesk/maya2019/Maya.app/Contents/bin/maya;/usr/autodesk/mayaIO2019/bin/maya
Description=The path to the Maya 2019 executable file used for rendering. Enter alternative paths on separate lines.

[RenderExecutable2020_0]
Type=multilinemultifilename
Category=Render Executables
CategoryOrder=0
Index=17
Label=Maya 2020 Render Executable
Default=C:\Program Files\Autodesk\Maya2020\bin\MayaBatch.exe;/usr/autodesk/maya2020/bin/maya;/Applications/Autodesk/maya2020/Maya.app/Contents/bin/maya;/usr/autodesk/mayaIO2020/bin/maya
Description=The path to the Maya 2020 executable file used for rendering. Enter alternative paths on separate lines.

So when the executable is resolved, the MayaBatch.py reads the Version from the metadata, looks in the correct entry defining the executable for that version, and picks the first file it can find (Linux, Windows, macOS)…

You need to implement the same logic for VRay :slight_smile: