add validator to the look publish

This commit is contained in:
Kayla Man 2023-01-13 23:08:23 +08:00
parent baca6a93c3
commit 1f45f8c5b3
3 changed files with 34 additions and 0 deletions

View file

@ -0,0 +1,25 @@
from maya import cmds
import pyblish.api
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'
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

View file

@ -306,6 +306,11 @@
"optional": true,
"active": true
},
"ValidateMayaColorSpace": {
"enabled": true,
"optional": true,
"active": true
},
"ValidateAttributes": {
"enabled": false,
"attributes": {}

View file

@ -144,6 +144,10 @@
{
"key": "ValidateShadingEngine",
"label": "Validate Look Shading Engine Naming"
},
{
"key": "ValidateMayaColorSpace",
"label": "ValidateMayaColorSpace"
}
]
},