From 4fab9dadda55b72f25eaf98eb17a01a94c739743 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Samohel?= <33513211+antirotor@users.noreply.github.com> Date: Tue, 2 Jun 2020 16:20:47 +0200 Subject: [PATCH] skip invalid attributes --- pype/plugins/maya/publish/collect_look.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pype/plugins/maya/publish/collect_look.py b/pype/plugins/maya/publish/collect_look.py index 6dc66711dac..7df85e4ba7a 100644 --- a/pype/plugins/maya/publish/collect_look.py +++ b/pype/plugins/maya/publish/collect_look.py @@ -277,7 +277,13 @@ def collect(self, instance): if looksets: for look in looksets: for at in shaderAttrs: - con = cmds.listConnections("{}.{}".format(look, at)) + try: + con = cmds.listConnections("{}.{}".format(look, at)) + except ValueError: + # skip attributes that are invalid in current + # context. For example in the case where + # Arnold is not enabled. + continue if con: materials.extend(con)