From cb8aa03b64cf41e1289a6ed6d25d2143363f7b71 Mon Sep 17 00:00:00 2001 From: Petr Kalis Date: Tue, 20 Jul 2021 11:19:16 +0200 Subject: [PATCH] Textures - fix - multiple version loaded at same time fails in better spot --- .../plugins/publish/collect_texture.py | 8 ++++++-- .../tools/standalonepublish/widgets/widget_drop_frame.py | 3 ++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/openpype/hosts/standalonepublisher/plugins/publish/collect_texture.py b/openpype/hosts/standalonepublisher/plugins/publish/collect_texture.py index 0fa554aa8b..439168ea10 100644 --- a/openpype/hosts/standalonepublisher/plugins/publish/collect_texture.py +++ b/openpype/hosts/standalonepublisher/plugins/publish/collect_texture.py @@ -421,8 +421,12 @@ class CollectTextures(pyblish.api.ContextPlugin): "have '{}' key".format(key) raise ValueError(msg) - parsed_value = regex_result[0][idx] - return parsed_value + try: + parsed_value = regex_result[0][idx] + return parsed_value + except IndexError: + self.log.warning("Wrong index, probably " + "wrong name {}".format(name)) def _update_representations(self, upd_representations): """Frames dont have sense for textures, add collected udims instead.""" diff --git a/openpype/tools/standalonepublish/widgets/widget_drop_frame.py b/openpype/tools/standalonepublish/widgets/widget_drop_frame.py index 63dcb82e83..7fe43c4203 100644 --- a/openpype/tools/standalonepublish/widgets/widget_drop_frame.py +++ b/openpype/tools/standalonepublish/widgets/widget_drop_frame.py @@ -211,7 +211,8 @@ class DropDataFrame(QtWidgets.QFrame): folder_path = os.path.dirname(collection.head) if file_base[-1] in ['.', '_']: file_base = file_base[:-1] - file_ext = collection.tail + file_ext = os.path.splitext( + collection.format('{head}{padding}{tail}'))[1] repr_name = file_ext.replace('.', '') range = collection.format('{ranges}')