From d7b6582cd38f1dd5a74036778ad22bb36b0dc54e Mon Sep 17 00:00:00 2001 From: Roy Nieterau Date: Fri, 24 Dec 2021 15:11:53 +0100 Subject: [PATCH] Fix Maya 2022 Python 3 compatibility: types.BooleanType and types.ListType don't exist in Py3+ --- .../hosts/maya/plugins/publish/validate_ass_relative_paths.py | 4 ++-- .../maya/plugins/publish/validate_vray_referenced_aovs.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/openpype/hosts/maya/plugins/publish/validate_ass_relative_paths.py b/openpype/hosts/maya/plugins/publish/validate_ass_relative_paths.py index 3625d4ab32..5fb9bd98b1 100644 --- a/openpype/hosts/maya/plugins/publish/validate_ass_relative_paths.py +++ b/openpype/hosts/maya/plugins/publish/validate_ass_relative_paths.py @@ -110,9 +110,9 @@ class ValidateAssRelativePaths(pyblish.api.InstancePlugin): Maya API will return a list of values, which need to be properly handled to evaluate properly. """ - if isinstance(attr_val, types.BooleanType): + if isinstance(attr_val, bool): return attr_val - elif isinstance(attr_val, (types.ListType, types.GeneratorType)): + elif isinstance(attr_val, (list, types.GeneratorType)): return any(attr_val) else: return bool(attr_val) diff --git a/openpype/hosts/maya/plugins/publish/validate_vray_referenced_aovs.py b/openpype/hosts/maya/plugins/publish/validate_vray_referenced_aovs.py index 6cfbd4049b..7a48c29b7d 100644 --- a/openpype/hosts/maya/plugins/publish/validate_vray_referenced_aovs.py +++ b/openpype/hosts/maya/plugins/publish/validate_vray_referenced_aovs.py @@ -82,9 +82,9 @@ class ValidateVrayReferencedAOVs(pyblish.api.InstancePlugin): bool: cast Maya attribute to Pythons boolean value. """ - if isinstance(attr_val, types.BooleanType): + if isinstance(attr_val, bool): return attr_val - elif isinstance(attr_val, (types.ListType, types.GeneratorType)): + elif isinstance(attr_val, (list, types.GeneratorType)): return any(attr_val) else: return bool(attr_val)