mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-25 05:14:40 +01:00
Merge pull request #3654 from BigRoy/fix_3410_2
Maya: Redshift Skip aov file format check for Cryptomatte
This commit is contained in:
commit
de0c33ce30
1 changed files with 26 additions and 13 deletions
|
|
@ -13,6 +13,12 @@ from openpype.pipeline.publish import (
|
|||
from openpype.hosts.maya.api import lib
|
||||
|
||||
|
||||
def get_redshift_image_format_labels():
|
||||
"""Return nice labels for Redshift image formats."""
|
||||
var = "$g_redshiftImageFormatLabels"
|
||||
return mel.eval("{0}={0}".format(var))
|
||||
|
||||
|
||||
class ValidateRenderSettings(pyblish.api.InstancePlugin):
|
||||
"""Validates the global render settings
|
||||
|
||||
|
|
@ -105,8 +111,9 @@ class ValidateRenderSettings(pyblish.api.InstancePlugin):
|
|||
|
||||
# Get the node attributes for current renderer
|
||||
attrs = lib.RENDER_ATTRS.get(renderer, lib.RENDER_ATTRS['default'])
|
||||
# Prefix attribute can return None when a value was never set
|
||||
prefix = lib.get_attr_in_layer(cls.ImagePrefixes[renderer],
|
||||
layer=layer)
|
||||
layer=layer) or ""
|
||||
padding = lib.get_attr_in_layer("{node}.{padding}".format(**attrs),
|
||||
layer=layer)
|
||||
|
||||
|
|
@ -183,18 +190,22 @@ class ValidateRenderSettings(pyblish.api.InstancePlugin):
|
|||
redshift_AOV_prefix
|
||||
))
|
||||
invalid = True
|
||||
# get aov format
|
||||
aov_ext = cmds.getAttr(
|
||||
"{}.fileFormat".format(aov), asString=True)
|
||||
|
||||
default_ext = cmds.getAttr(
|
||||
"redshiftOptions.imageFormat", asString=True)
|
||||
# check aov file format
|
||||
aov_ext = cmds.getAttr("{}.fileFormat".format(aov))
|
||||
default_ext = cmds.getAttr("redshiftOptions.imageFormat")
|
||||
aov_type = cmds.getAttr("{}.aovType".format(aov))
|
||||
if aov_type == "Cryptomatte":
|
||||
# redshift Cryptomatte AOV always uses "Cryptomatte (EXR)"
|
||||
# so we ignore validating file format for it.
|
||||
pass
|
||||
|
||||
if default_ext != aov_ext:
|
||||
cls.log.error(("AOV file format is not the same "
|
||||
"as the one set globally "
|
||||
"{} != {}").format(default_ext,
|
||||
aov_ext))
|
||||
elif default_ext != aov_ext:
|
||||
labels = get_redshift_image_format_labels()
|
||||
cls.log.error(
|
||||
"AOV file format {} does not match global file format "
|
||||
"{}".format(labels[aov_ext], labels[default_ext])
|
||||
)
|
||||
invalid = True
|
||||
|
||||
if renderer == "renderman":
|
||||
|
|
@ -302,6 +313,9 @@ class ValidateRenderSettings(pyblish.api.InstancePlugin):
|
|||
default = lib.RENDER_ATTRS['default']
|
||||
render_attrs = lib.RENDER_ATTRS.get(renderer, default)
|
||||
|
||||
# Repair animation must be enabled
|
||||
cmds.setAttr("defaultRenderGlobals.animation", True)
|
||||
|
||||
# Repair prefix
|
||||
if renderer != "renderman":
|
||||
node = render_attrs["node"]
|
||||
|
|
@ -334,8 +348,7 @@ class ValidateRenderSettings(pyblish.api.InstancePlugin):
|
|||
cmds.optionMenuGrp("vrayRenderElementSeparator",
|
||||
v=instance.data.get("aovSeparator", "_"))
|
||||
cmds.setAttr(
|
||||
"{}.fileNameRenderElementSeparator".format(
|
||||
node),
|
||||
"{}.fileNameRenderElementSeparator".format(node),
|
||||
instance.data.get("aovSeparator", "_"),
|
||||
type="string"
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue