From 426bc1e92bb739f7ee467c1d736b724ac34ef59d Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 12 Nov 2020 09:51:31 +0100 Subject: [PATCH] skip instances without visible layers --- pype/plugins/tvpaint/publish/extract_sequence.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pype/plugins/tvpaint/publish/extract_sequence.py b/pype/plugins/tvpaint/publish/extract_sequence.py index c899ecb9e6..239dec5249 100644 --- a/pype/plugins/tvpaint/publish/extract_sequence.py +++ b/pype/plugins/tvpaint/publish/extract_sequence.py @@ -56,9 +56,6 @@ class ExtractSequence(pyblish.api.Extractor): ) # Get all layers and filter out not visible - # TODO what to do if all are invisible? - # - skip without output? - # - still render but empty output? layers = instance.data["layers"] filtered_layers = [ layer @@ -66,6 +63,13 @@ class ExtractSequence(pyblish.api.Extractor): if layer["visible"] ] layer_ids = [str(layer["layer_id"]) for layer in filtered_layers] + if not layer_ids: + self.log.info( + f"None of the layers from the instance" + " are visible. Extraction skipped." + ) + return + self.log.debug( "Instance has {} layers with ids: {}".format( len(layer_ids), ", ".join(layer_ids)