From 5779158d34984d984e5302b2ec89e5b51edfcf5a Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 3 Mar 2021 10:11:14 +0100 Subject: [PATCH] added cleanup method that will remove temp image files of individial layers --- pype/hosts/tvpaint/plugins/publish/extract_sequence.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pype/hosts/tvpaint/plugins/publish/extract_sequence.py b/pype/hosts/tvpaint/plugins/publish/extract_sequence.py index 919dd02f7c..f1929707b4 100644 --- a/pype/hosts/tvpaint/plugins/publish/extract_sequence.py +++ b/pype/hosts/tvpaint/plugins/publish/extract_sequence.py @@ -242,6 +242,7 @@ class ExtractSequence(pyblish.api.Extractor): filename_template, thumbnail_filename ) + self._cleanup_tmp_files(files_by_position) return output def render_layer( @@ -476,6 +477,11 @@ class ExtractSequence(pyblish.api.Extractor): return output_filepaths, thumbnail_filepath + def _cleanup_tmp_files(self, files_by_position): + for data in files_by_position.values(): + for filepath in data.values(): + os.remove(filepath) + def _copy_image(self, src_path, dst_path): # Create hardlink of image instead of copying if possible if hasattr(os, "link"):