From bdc6a0ca26a833e1365cefcf0f7cb5979e5c6bc4 Mon Sep 17 00:00:00 2001 From: Milan Kolar Date: Fri, 16 Oct 2020 10:25:46 +0200 Subject: [PATCH] don't crash if we only have single frame --- pype/plugins/nuke/load/load_sequence.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/pype/plugins/nuke/load/load_sequence.py b/pype/plugins/nuke/load/load_sequence.py index c5ce288540..44b9cb4a34 100644 --- a/pype/plugins/nuke/load/load_sequence.py +++ b/pype/plugins/nuke/load/load_sequence.py @@ -119,13 +119,14 @@ class LoadSequence(api.Loader): repr_cont = context["representation"]["context"] if "#" not in file: frame = repr_cont.get("frame") - padding = len(frame) - file = file.replace(frame, "#" * padding) + if frame: + padding = len(frame) + file = file.replace(frame, "#" * padding) read_name = "Read_{0}_{1}_{2}".format( repr_cont["asset"], repr_cont["subset"], - repr_cont["representation"]) + context["representation"]["name"]) # Create the Loader with the filename path set with viewer_update_and_undo_stop(): @@ -249,8 +250,9 @@ class LoadSequence(api.Loader): if "#" not in file: frame = repr_cont.get("frame") - padding = len(frame) - file = file.replace(frame, "#" * padding) + if frame: + padding = len(frame) + file = file.replace(frame, "#" * padding) # Get start frame from version data version = io.find_one({