From 2a54a22ecc37e12d277b76d2eb43a5c830e093d6 Mon Sep 17 00:00:00 2001 From: wijnand Date: Mon, 7 May 2018 16:42:39 +0200 Subject: [PATCH] Skipping collection if it is a string type, added docstrings --- .../global/publish/validate_sequence_frames.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/colorbleed/plugins/global/publish/validate_sequence_frames.py b/colorbleed/plugins/global/publish/validate_sequence_frames.py index 0e13064e12..7375edfaf5 100644 --- a/colorbleed/plugins/global/publish/validate_sequence_frames.py +++ b/colorbleed/plugins/global/publish/validate_sequence_frames.py @@ -1,7 +1,14 @@ import pyblish.api +from avalon.vendor import six class ValidateSequenceFrames(pyblish.api.InstancePlugin): + """Ensure the sequence of frames is complete + + The files found in the instance are checked against the startFrame and + endFrame of the instance. If the first or last file is not + corresponding with the first or last frame it is flagged as invalid. + """ order = pyblish.api.ValidatorOrder label = "Validate Sequence Frames" @@ -10,7 +17,13 @@ class ValidateSequenceFrames(pyblish.api.InstancePlugin): def process(self, instance): collection = instance[0] + # Hack: Skip the check for `colorbleed.yeticache` from within Maya + # When publishing a Yeti cache from Maya the "collection" is a node, + # which is a string and it will fail when calling `indexes` + if isinstance(collection, six.string_types): + return + self.log.warning(collection) frames = list(collection.indexes) assert frames[0] == instance.data["startFrame"]