Maya2022/2023/2024 vray 6.1 renderout in deadline different from local render

I met this problem for a long time.final i found maya2022 ocio path is “<MAYA_RESOURCES>/OCIO-configs/Maya2022-default/config.ocio” When i set “C:\Program Files\Autodesk\Maya2022\resources\OCIO-configs\Maya2022-default/config.ocio” render out will be OK.But every job i have to change the ocio path when i submitt to deadline(some job i will be forget). I guess smone know how to set deadline to slove this promble.(maya 2023 2024 with the same question)

You can set an environment variable through and OnJobSubmission event for the job to look for OCIO path.

You will need to write an event plugin which will fire up at the time the job is submitted. It will set OCIO path on the job as an environment variable. The script file will be something like below please tweak as required. Also make the .param file yourself. Look at the docs on how to write it here: Event Plugins — Deadline 10.3.0.13 documentation

###############################################################
# Imports
###############################################################
from System import *

from Deadline.Events import *
from Deadline.Scripting import *

import os
import string
#########################################################################################
# This is the function called by Deadline to get an instance of the Draft event listener.
#########################################################################################


def GetDeadlineEventListener():
    return CustomEnvironmentCopyListener()


def CleanupDeadlineEventListener(eventListener):
    eventListener.Cleanup()

###############################################################
# The event listener class.
###############################################################

class EnvironmentCopyListener (DeadlineEventListener):
	def __init__(self):
	    self.OnJobSubmittedCallback += self.OnJobSubmitted
	
	def Cleanup(self):
	    del self.OnJobSubmittedCallback
	
	def OnJobSubmitted(self, job):
		key = "OCIO"
		variable = "C:\Program Files\Autodesk\Maya2022\resources\OCIO-configs\Maya2022-default/config.ocio"
	
		# Set chosen variable to job
		self.LogInfo("Setting %s to %s" % (key, variable))
		job.SetJobEnvironmentKeyValue(key, variable)
	
		RepositoryUtils.SaveJob(job)
	
		self.LogInfo("On Job Submitted Event Plugin: OCIO Environment Finished")
1 Like

Hello,

I tested this based on zainail’s post.
I tried setting either OCIO or MAYA_LOCATION using JobEnvironmentKeyValue, as suggested in various sources, but neither worked correctly in my environment.

When I checked the job properties, I found that the OCIO path shown in the V-Ray error message (<MAYA_RESOURCES>/OCIO-configs/Maya2022-default/config.ocio) was actually set via the OCIOConfigFile key under “Plugin Info Parameters”.
By overriding this value using SetJobPluginInfoKeyValue, the render completed successfully.

To allow non-Maya software to be used on the same farm, I also added a filter to the event plugin to limit processing to V-Ray with Maya 2024, 2025, and 2026 only.

*Please note that this plugin runs on job submission, so it likely won’t be triggered by actions like requere.

from Deadline.Events import DeadlineEventListener
from Deadline.Scripting import RepositoryUtils


def GetDeadlineEventListener():
    return FixMayaVRayOCIOEventListener()


def CleanupDeadlineEventListener(deadlinePlugin):
    deadlinePlugin.Cleanup()


class FixMayaVRayOCIOEventListener (DeadlineEventListener):
    def __init__(self):
        super().__init__()
        self.OnJobSubmittedCallback += self.OnJobSubmitted
    
    def Cleanup(self):
        del self.OnJobSubmittedCallback
    
    def OnJobSubmitted(self, job):
        event_plugin = "FixMayaVRayOCIO"
        self.LogInfo(f'CustomEventPlugin: {event_plugin}')

        # Job Plugin Check
        job_plugin = job.JobPlugin
        self.LogInfo(f"{event_plugin}: Job Plugin: {job_plugin}")

        if job_plugin != "MayaBatch":
            self.LogInfo(f"{event_plugin}: Skip because it's not MayaBatch")
            return
        
        # Maya Version Check
        maya_version = int(job.GetJobPluginInfoKeyValue("Version"))
        self.LogInfo(f"{event_plugin}: Maya Version: {str(maya_version)}")

        if not maya_version >= 2024:
            self.LogInfo(f"{event_plugin}: Skip because maya version is not 2024 or higher")
            return

        # Renderer Check
        maya_renderer = job.GetJobPluginInfoKeyValue("Renderer")
        self.LogInfo(f"{event_plugin}: Maya Renderer: {maya_renderer}")
        
        if maya_renderer != "vray":
            self.LogInfo(f"{event_plugin}: Skip because it's not vray")
            return

        key = "OCIOConfigFile"
        if maya_version == 2024:
            variable = r"C:/Program Files\Autodesk/Maya2024/resources/OCIO-configs/Maya2022-default/config.ocio"
        elif maya_version == 2025:
            variable = r"C:/Program Files\Autodesk/Maya2025/resources/OCIO-configs/Maya2022-default/config.ocio"
        elif maya_version == 2026:
            variable = r"C:/Program Files\Autodesk/Maya2026/resources/OCIO-configs/Maya2022-default/config.ocio"
        else:
            self.LogInfo(f"{event_plugin}: Path matching version not found")
            return

        self.LogInfo(f"{event_plugin}: {key}: {variable}")
    
        job.SetJobPluginInfoKeyValue(key, variable)

        RepositoryUtils.SaveJob(job)
        self.LogInfo(f"On Job Submitted Event Plugin: {event_plugin} Finished")
    
    def OnJobFinished(self, job):
        pass

FixMayaVRayOCIO.zip (1.6 KB)