From 978e24d59b3209acf760ef0146e856ef8df63d9f Mon Sep 17 00:00:00 2001 From: Ondrej Samohel Date: Fri, 12 Jun 2020 14:02:00 +0200 Subject: [PATCH 1/2] fixing subset attaching assert, disabling arnold scene export --- pype/plugins/maya/create/create_render.py | 2 +- pype/plugins/maya/publish/collect_render.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pype/plugins/maya/create/create_render.py b/pype/plugins/maya/create/create_render.py index b2256af455..4d775dab52 100644 --- a/pype/plugins/maya/create/create_render.py +++ b/pype/plugins/maya/create/create_render.py @@ -35,7 +35,7 @@ class CreateRender(avalon.maya.Creator): _image_prefixes = { 'mentalray': 'maya///_', - 'vray': '"maya///', + 'vray': 'maya///', 'arnold': 'maya///_', 'renderman': 'maya///_', 'redshift': 'maya///_' diff --git a/pype/plugins/maya/publish/collect_render.py b/pype/plugins/maya/publish/collect_render.py index bfb6e79cba..41b4f2cc7c 100644 --- a/pype/plugins/maya/publish/collect_render.py +++ b/pype/plugins/maya/publish/collect_render.py @@ -192,7 +192,7 @@ class CollectMayaRender(pyblish.api.ContextPlugin): # in expectedFiles. If so, raise error as we cannot attach AOV # (considered to be subset on its own) to another subset if attachTo: - assert len(exp_files[0].keys()) == 1, ( + assert isinstance(exp_files, dict) is True, ( "attaching multiple AOVs or renderable cameras to " "subset is not supported" ) From df063665c4023618892a3d4fca8bf0163950a1a6 Mon Sep 17 00:00:00 2001 From: Ondrej Samohel Date: Fri, 12 Jun 2020 18:04:00 +0200 Subject: [PATCH 2/2] fix type check and enable arnold specific validator only when in arnold --- pype/plugins/maya/publish/collect_render.py | 2 +- .../maya/publish/validate_mesh_arnold_attributes.py | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/pype/plugins/maya/publish/collect_render.py b/pype/plugins/maya/publish/collect_render.py index 41b4f2cc7c..ca5c403808 100644 --- a/pype/plugins/maya/publish/collect_render.py +++ b/pype/plugins/maya/publish/collect_render.py @@ -192,7 +192,7 @@ class CollectMayaRender(pyblish.api.ContextPlugin): # in expectedFiles. If so, raise error as we cannot attach AOV # (considered to be subset on its own) to another subset if attachTo: - assert isinstance(exp_files, dict) is True, ( + assert isinstance(exp_files, list), ( "attaching multiple AOVs or renderable cameras to " "subset is not supported" ) diff --git a/pype/plugins/maya/publish/validate_mesh_arnold_attributes.py b/pype/plugins/maya/publish/validate_mesh_arnold_attributes.py index 1ddf0285d4..04a3cf3c79 100644 --- a/pype/plugins/maya/publish/validate_mesh_arnold_attributes.py +++ b/pype/plugins/maya/publish/validate_mesh_arnold_attributes.py @@ -1,5 +1,5 @@ import pymel.core as pc - +from maya import cmds import pyblish.api import pype.api import pype.hosts.maya.action @@ -23,6 +23,11 @@ class ValidateMeshArnoldAttributes(pyblish.api.InstancePlugin): pype.api.RepairAction ] optional = True + if cmds.getAttr( + "defaultRenderGlobals.currentRenderer").lower() == "arnold": + active = True + else: + active = False @classmethod def get_invalid_attributes(cls, instance, compute=False):