From 006c43c6f08106dc7702ca49623dd18e3f1b18c4 Mon Sep 17 00:00:00 2001 From: Bo Zhou Date: Thu, 24 Mar 2022 10:37:17 +0900 Subject: [PATCH] replace unicode with str and normalize unicode instance data value --- .../plugins/publish/extract_multiverse_usd.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/openpype/hosts/maya/plugins/publish/extract_multiverse_usd.py b/openpype/hosts/maya/plugins/publish/extract_multiverse_usd.py index c64e5b03e2..d7d1337930 100644 --- a/openpype/hosts/maya/plugins/publish/extract_multiverse_usd.py +++ b/openpype/hosts/maya/plugins/publish/extract_multiverse_usd.py @@ -1,4 +1,5 @@ import os +import six from maya import cmds @@ -32,9 +33,9 @@ class ExtractMultiverseUsd(openpype.api.Extractor): "flattenParentXforms": bool, "writeSparseOverrides": bool, "useMetaPrimPath": bool, - "customRootPath": unicode, - "customAttributes": unicode, - "nodeTypesToIgnore": unicode, + "customRootPath": str, + "customAttributes": str, + "nodeTypesToIgnore": str, "writeMeshes": bool, "writeCurves": bool, "writeParticles": bool, @@ -57,7 +58,7 @@ class ExtractMultiverseUsd(openpype.api.Extractor): "writeTransformMatrix": bool, "writeUsdAttributes": bool, "timeVaryingTopology": bool, - "customMaterialNamespace": unicode, + "customMaterialNamespace": str, "numTimeSamples": int, "timeSamplesSpan": float } @@ -73,9 +74,9 @@ class ExtractMultiverseUsd(openpype.api.Extractor): "flattenParentXforms": False, "writeSparseOverrides": False, "useMetaPrimPath": False, - "customRootPath": u'', - "customAttributes": u'', - "nodeTypesToIgnore": u'', + "customRootPath": str(), + "customAttributes": str(), + "nodeTypesToIgnore": str(), "writeMeshes": True, "writeCurves": True, "writeParticles": True, @@ -98,7 +99,7 @@ class ExtractMultiverseUsd(openpype.api.Extractor): "writeTransformMatrix": True, "writeUsdAttributes": False, "timeVaryingTopology": False, - "customMaterialNamespace": u'', + "customMaterialNamespace": str(), "numTimeSamples": 1, "timeSamplesSpan": 0.0 } @@ -112,6 +113,8 @@ class ExtractMultiverseUsd(openpype.api.Extractor): # Ensure the data is of correct type value = instance.data[key] + if isinstance(value, six.text_type): + value = str(value) if not isinstance(value, self.options[key]): self.log.warning( "Overridden attribute {key} was of "