adding optional validator for maya color space

This commit is contained in:
Kayla Man 2023-01-04 23:49:07 +08:00
parent e045cc95be
commit 1ba5223801

View file

@ -0,0 +1,28 @@
from maya import cmds
import pyblish.api
import openpype.hosts.maya.api.action
from openpype.pipeline.publish import ValidateContentsOrder
class ValidateMayaColorSpace(pyblish.api.InstancePlugin):
"""
Check if the OCIO Color Management and maketx options
enabled at the same time
"""
order = ValidateContentsOrder
families = ['look']
hosts = ['maya']
label = 'Maya Color Space'
optional = True
def process(self, instance):
ocio_maya = cmds.colorManagementPrefs(q=True,
cmConfigFileEnabled=True,
cmEnabled=True)
maketx = instance.data["maketx"]
if ocio_maya and maketx:
raise Exception("Maya is color managed and maketx option is on. OpenPype doesn't support this combination yet.") # noqa