Skip to content

Commit

Permalink
Squashed commit ofhotfix-aov-extension-check-ignore:
Browse files Browse the repository at this point in the history
commit d00105c
Author: Theodoric JUILLET <theodoric.juillet@ellipsanime.net>
Date:   Mon Feb 21 17:40:03 2022 +0100

    fix: AOV Support for Render Settings.
    Add prefix custom option, extension ignore list, custom separator.

commit 6e97b89
Author: Theodoric JUILLET <theodoric.juillet@ellipsanime.net>
Date:   Fri Feb 18 18:14:33 2022 +0100

    Add ignore case for AOV ext depending on AovType

commit 6f79251
Merge: ecae9f6 6468751
Author: Petr Kalis <petr.kalis@gmail.com>
Date:   Mon Feb 7 10:05:55 2022 +0100

    Merge pull request ynput#2634 from Ellipsanime/fix-photoshop-environement-workfiles-on-launch

    Fix open workfile on launch in photoshop

commit ecae9f6
Merge: 4b3834e 3160199
Author: Milan Kolar <mkolar@users.noreply.github.com>
Date:   Mon Feb 7 09:52:39 2022 +0100

    Merge pull request ynput#2556 from pypeclub/feature/OP-2429_Publisher-Preparations-before-standalone-publisher

commit 4b3834e
Merge: ccea535 604a590
Author: pypebot <82967070+pypebot@users.noreply.github.com>
Date:   Mon Feb 7 09:38:20 2022 +0100

    [Automated] Merged release main into develop

commit ccea535
Merge: f2a9543 a11700e
Author: pypebot <82967070+pypebot@users.noreply.github.com>
Date:   Sat Feb 5 04:34:51 2022 +0100

    [Automated] Merged main into develop

commit 6468751
Author: clement.hector <clement.hector@gmail.com>
Date:   Fri Feb 4 12:11:05 2022 +0100

    use env_value_to_bool instead of ast.literal_eval + os.getenv

commit fe46093
Author: clement.hector <clement.hector@gmail.com>
Date:   Wed Feb 2 19:36:49 2022 +0100

    fix test on string to boolean

commit 3160199
Author: Jakub Trllo <jakub.trllo@gmail.com>
Date:   Tue Jan 25 14:15:19 2022 +0100

    fix grammar

commit d739364
Author: Jakub Trllo <jakub.trllo@gmail.com>
Date:   Tue Jan 25 13:48:18 2022 +0100

    handle default value of 'is_label_horizontal'

commit 7ec4d50
Author: Jakub Trllo <jakub.trllo@gmail.com>
Date:   Tue Jan 25 13:48:03 2022 +0100

    precreate widget is separated from create dialog completely

commit f8be576
Author: iLLiCiTiT <jakub.trllo@gmail.com>
Date:   Tue Jan 18 18:05:32 2022 +0100

    renamed method 'get_attribute_defs' to 'get_instance_attr_defs'

commit 20f5e8f
Author: iLLiCiTiT <jakub.trllo@gmail.com>
Date:   Tue Jan 18 17:51:25 2022 +0100

    hound fixes

commit 95176b6
Author: iLLiCiTiT <jakub.trllo@gmail.com>
Date:   Tue Jan 18 17:26:16 2022 +0100

    modified example creator

commit 23c3bc8
Author: iLLiCiTiT <jakub.trllo@gmail.com>
Date:   Tue Jan 18 17:26:09 2022 +0100

    style changes of header view nad checkbox

commit 2d75212
Author: iLLiCiTiT <jakub.trllo@gmail.com>
Date:   Tue Jan 18 17:25:51 2022 +0100

    ui attribute definitions are skipped for storing data

commit f0b7f72
Author: iLLiCiTiT <jakub.trllo@gmail.com>
Date:   Tue Jan 18 17:25:34 2022 +0100

    creator dialog has context widget and creator's attributes

commit 9c6a57a
Author: iLLiCiTiT <jakub.trllo@gmail.com>
Date:   Tue Jan 18 17:23:37 2022 +0100

    creator can define precreate attribute definitions and allowing context change

commit 3878c52
Author: iLLiCiTiT <jakub.trllo@gmail.com>
Date:   Tue Jan 18 17:22:57 2022 +0100

    added widgett for pre create attributes

commit fffdef5
Author: iLLiCiTiT <jakub.trllo@gmail.com>
Date:   Tue Jan 18 17:22:41 2022 +0100

    added publisher specific asset and task widgets

commit fbdd1d8
Author: iLLiCiTiT <jakub.trllo@gmail.com>
Date:   Tue Jan 18 17:22:08 2022 +0100

    moved few widgets to tools/utils and modified asset/task widgets to easily change source model

commit 396bdfd
Author: iLLiCiTiT <jakub.trllo@gmail.com>
Date:   Tue Jan 18 17:16:32 2022 +0100

    added few new attribute definitions and their widgets
  • Loading branch information
BenoitConnan committed Feb 28, 2022
1 parent 1f4cef9 commit 9486749
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 23 deletions.
51 changes: 28 additions & 23 deletions openpype/hosts/maya/plugins/publish/validate_rendersettings.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class ValidateRenderSettings(pyblish.api.InstancePlugin):
ImagePrefixTokens = {

'arnold': 'maya/<Scene>/<RenderLayer>/<RenderLayer>{aov_separator}<RenderPass>', # noqa
'redshift': 'maya/<Scene>/<RenderLayer>/<RenderLayer>',
'redshift': 'RENDER/<Scene>/<RenderLayer>/<Scene>_<RenderLayer>',
'vray': 'maya/<Scene>/<Layer>/<Layer>',
'renderman': '<layer>{aov_separator}<aov>.<f4>.<ext>' # noqa
}
Expand Down Expand Up @@ -89,6 +89,10 @@ class ValidateRenderSettings(pyblish.api.InstancePlugin):
VRAY_PREFIX = "maya/<Scene>/<Layer>/<Layer>"
DEFAULT_PREFIX = "maya/<Scene>/<RenderLayer>/<RenderLayer>_<RenderPass>"

aov_separator_custom = "."
aov_extension_check_ignore_list = ["Cryptomatte"]
image_prefix = "RENDER/<Scene>"

def process(self, instance):

invalid = self.get_invalid(instance)
Expand All @@ -115,16 +119,16 @@ def get_invalid(cls, instance):
layer=layer)

prefix = prefix.replace(
"{aov_separator}", instance.data.get("aovSeparator", "_"))
"{aov_separator}", cls.aov_separator_custom)
if not anim_override:
invalid = True
cls.log.error("Animation needs to be enabled. Use the same "
"frame for start and end to render single frame")

if not prefix.lower().startswith("maya/<scene>"):
if not prefix.startswith(cls.image_prefix):
invalid = True
cls.log.error("Wrong image prefix [ {} ] - "
"doesn't start with: 'maya/<scene>'".format(prefix))
cls.log.error("Image prefix is '{}'. "
"It should start with '{}'".format(prefix), cls.image_prefix)

if not re.search(cls.R_LAYER_TOKEN, prefix):
invalid = True
Expand All @@ -149,13 +153,13 @@ def get_invalid(cls, instance):

scene_sep = cmds.getAttr(
"{}.fileNameRenderElementSeparator".format(node))
if scene_sep != instance.data.get("aovSeparator", "_"):
if scene_sep != cls.aov_separator_custom:
cls.log.error("AOV separator is not set correctly.")
invalid = True

if renderer == "redshift":
redshift_AOV_prefix = cls.redshift_AOV_prefix.replace(
"{aov_separator}", instance.data.get("aovSeparator", "_")
"{aov_separator}", cls.aov_separator_custom
)
if re.search(cls.R_AOV_TOKEN, prefix):
invalid = True
Expand All @@ -167,13 +171,14 @@ def get_invalid(cls, instance):
rs_aovs = cmds.ls(type="RedshiftAOV", referencedNodes=False)
for aov in rs_aovs:
aov_prefix = cmds.getAttr("{}.filePrefix".format(aov))
aov_type = cmds.getAttr("{}.aovType".format(aov))
# check their image prefix
if aov_prefix != redshift_AOV_prefix:
cls.log.error(("AOV ({}) image prefix is not set "
"correctly {} != {}").format(
cmds.getAttr("{}.name".format(aov)),
cmds.getAttr("{}.filePrefix".format(aov)),
aov_prefix
redshift_AOV_prefix
))
invalid = True
# get aov format
Expand All @@ -183,12 +188,13 @@ def get_invalid(cls, instance):
default_ext = cmds.getAttr(
"redshiftOptions.imageFormat", asString=True)

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))
invalid = True
if aov_type not in cls.aov_extension_check_ignore_list:
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))
invalid = True

if renderer == "renderman":
file_prefix = cmds.getAttr("rmanGlobals.imageFileFormat")
Expand Down Expand Up @@ -219,11 +225,10 @@ def get_invalid(cls, instance):

# prefix check
default_prefix = cls.ImagePrefixTokens[renderer]
default_prefix = default_prefix.replace(
"{aov_separator}", instance.data.get("aovSeparator", "_"))
if prefix.lower() != default_prefix.lower():
cls.log.warning("warning: prefix differs from "
"recommended {}".format(
if prefix != default_prefix:
cls.log.warning("Warning: prefix '{}' differs from "
"recommended '{}'".format(
prefix,
default_prefix))

if padding != cls.DEFAULT_PADDING:
Expand Down Expand Up @@ -275,10 +280,10 @@ def repair(cls, instance):
renderer = instance.data['renderer']
layer_node = instance.data['setMembers']
redshift_AOV_prefix = cls.redshift_AOV_prefix.replace(
"{aov_separator}", instance.data.get("aovSeparator", "_")
"{aov_separator}", cls.aov_separator_custom
)
default_prefix = cls.ImagePrefixTokens[renderer].replace(
"{aov_separator}", instance.data.get("aovSeparator", "_")
"{aov_separator}", cls.aov_separator_custom
)

with lib.renderlayer(layer_node):
Expand Down Expand Up @@ -315,11 +320,11 @@ def repair(cls, instance):
node = vray_settings[0]

cmds.optionMenuGrp("vrayRenderElementSeparator",
v=instance.data.get("aovSeparator", "_"))
v=cls.aov_separator_custom)
cmds.setAttr(
"{}.fileNameRenderElementSeparator".format(
node),
instance.data.get("aovSeparator", "_"),
cls.aov_separator_custom,
type="string"
)

Expand Down
5 changes: 5 additions & 0 deletions openpype/settings/defaults/project_settings/maya.json
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,11 @@
"validate_collision": true
},
"ValidateRenderSettings": {
"aov_separator_custom": ".",
"image_prefix": "RENDER/<Scene>",
"aov_extension_check_ignore_list": [
"Cryptomatte"
],
"arnold_render_attributes": [],
"vray_render_attributes": [],
"redshift_render_attributes": [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,22 @@
"key": "ValidateRenderSettings",
"label": "ValidateRenderSettings",
"children": [
{
"type": "text",
"key": "aov_separator_custom",
"label": "AOV Separator Custom"
},
{
"type": "text",
"key": "image_prefix",
"label": "Image Prefix"
},
{
"type": "list",
"key": "aov_extension_check_ignore_list",
"label": "AOV Ignore List (Extension Check)",
"object_type": "text"
},
{
"type": "dict-modifiable",
"store_as_list": true,
Expand Down

0 comments on commit 9486749

Please sign in to comment.