From ca2baae479c12ec3e17a7841c9cb1baf1903ff19 Mon Sep 17 00:00:00 2001 From: Toke Jepsen Date: Tue, 23 Jul 2019 12:41:43 +0100 Subject: [PATCH] Support tagging unwanted representations for deletion. --- pype/plugins/global/publish/extract_burnin.py | 11 ++++++++++- pype/plugins/maya/publish/extract_quicktime.py | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/pype/plugins/global/publish/extract_burnin.py b/pype/plugins/global/publish/extract_burnin.py index 5f16cc91f2..85e851b389 100644 --- a/pype/plugins/global/publish/extract_burnin.py +++ b/pype/plugins/global/publish/extract_burnin.py @@ -82,10 +82,19 @@ class ExtractBurnin(pype.api.Extractor): if os.path.exists(full_burnin_path): repre_update = { "files": movieFileBurnin, - "name": repre["name"] + "name": repre["name"], + "tags": [x for x in repre["tags"] if x != "delete"] } instance.data["representations"][i].update(repre_update) # removing the source mov file os.remove(full_movie_path) self.log.debug("Removed: `{}`".format(full_movie_path)) + + # Remove any representations tagged for deletion. + for repre in instance.data["representations"]: + if "delete" in repre.get("tags", []): + self.log.debug("Removing representation: {}".format(repre)) + instance.data["representations"].remove(repre) + + self.log.debug(instance.data["representations"]) diff --git a/pype/plugins/maya/publish/extract_quicktime.py b/pype/plugins/maya/publish/extract_quicktime.py index 87608af641..26e115602c 100644 --- a/pype/plugins/maya/publish/extract_quicktime.py +++ b/pype/plugins/maya/publish/extract_quicktime.py @@ -118,7 +118,7 @@ class ExtractQuicktime(pype.api.Extractor): 'endFrame': end, 'frameRate': fps, 'preview': True, - 'tags': ['review'] + 'tags': ['review', 'delete'] } instance.data["representations"].append(representation)