From f81e7f8d8d5a3cda34be3aee70c9e75edfc1ea7e Mon Sep 17 00:00:00 2001 From: Fabia Serra Arrizabalaga Date: Wed, 14 Jun 2023 11:33:09 -0500 Subject: [PATCH 1/5] Expose cleanup plugin settings so they can be disabled --- openpype/plugins/publish/cleanup.py | 16 +++--- openpype/plugins/publish/cleanup_farm.py | 1 + .../defaults/project_settings/global.json | 9 +++- .../schemas/schema_global_publish.json | 52 ++++++++++++++++--- 4 files changed, 61 insertions(+), 17 deletions(-) diff --git a/openpype/plugins/publish/cleanup.py b/openpype/plugins/publish/cleanup.py index 57cc9c0ab52..fba6d09bd51 100644 --- a/openpype/plugins/publish/cleanup.py +++ b/openpype/plugins/publish/cleanup.py @@ -41,8 +41,8 @@ class CleanUp(pyblish.api.InstancePlugin): active = True # Presets - paterns = None # list of regex paterns - remove_temp_renders = True + patterns = None # list of regex patterns + remove_temp_renders = False def process(self, instance): """Plugin entry point.""" @@ -114,10 +114,10 @@ def clean_renders(self, instance, skip_cleanup_filepaths): src = os.path.normpath(src) dest = os.path.normpath(dest) - # add src dir into clearing dir paths (regex paterns) + # add src dir into clearing dir paths (regex patterns) transfers_dirs.append(os.path.dirname(src)) - # add dest dir into clearing dir paths (regex paterns) + # add dest dir into clearing dir paths (regex patterns) transfers_dirs.append(os.path.dirname(dest)) if src in skip_cleanup_filepaths: @@ -140,13 +140,13 @@ def clean_renders(self, instance, skip_cleanup_filepaths): # add dir for cleanup dirnames.append(os.path.dirname(src)) - # clean by regex paterns + # clean by regex patterns # make unique set transfers_dirs = set(transfers_dirs) self.log.debug("__ transfers_dirs: `{}`".format(transfers_dirs)) - self.log.debug("__ self.paterns: `{}`".format(self.paterns)) - if self.paterns: + self.log.debug("__ self.patterns: `{}`".format(self.patterns)) + if self.patterns: files = list() # get list of all available content of dirs for _dir in transfers_dirs: @@ -163,7 +163,7 @@ def clean_renders(self, instance, skip_cleanup_filepaths): if os.path.normpath(f) in skip_cleanup_filepaths: continue - for p in self.paterns: + for p in self.patterns: patern = re.compile(p) if not patern.findall(f): continue diff --git a/openpype/plugins/publish/cleanup_farm.py b/openpype/plugins/publish/cleanup_farm.py index 8052f137346..41f9e52dc03 100644 --- a/openpype/plugins/publish/cleanup_farm.py +++ b/openpype/plugins/publish/cleanup_farm.py @@ -14,6 +14,7 @@ class CleanUpFarm(pyblish.api.ContextPlugin): order = pyblish.api.IntegratorOrder + 11 label = "Clean Up Farm" enabled = True + optional = True # Keep "filesequence" for backwards compatibility of older jobs targets = ["filesequence", "farm"] diff --git a/openpype/settings/defaults/project_settings/global.json b/openpype/settings/defaults/project_settings/global.json index a78c5cb7ac5..bd6a5608167 100644 --- a/openpype/settings/defaults/project_settings/global.json +++ b/openpype/settings/defaults/project_settings/global.json @@ -397,11 +397,18 @@ ] }, "CleanUp": { + "enabled": true, + "optional": true, "paterns": [], "remove_temp_renders": false }, "CleanUpFarm": { - "enabled": false + "enabled": false, + "optional": true + }, + "ExplicitCleanUp": { + "enabled": false, + "optional": true } }, "tools": { diff --git a/openpype/settings/entities/schemas/projects_schema/schemas/schema_global_publish.json b/openpype/settings/entities/schemas/projects_schema/schemas/schema_global_publish.json index 3164cfb62d6..aa47f16a6ba 100644 --- a/openpype/settings/entities/schemas/projects_schema/schemas/schema_global_publish.json +++ b/openpype/settings/entities/schemas/projects_schema/schemas/schema_global_publish.json @@ -1108,11 +1108,22 @@ "key": "CleanUp", "label": "Clean Up", "is_group": true, + "checkbox_key": "enabled", "children": [ + { + "type": "boolean", + "key": "enabled", + "label": "Enabled" + }, + { + "type": "boolean", + "key": "optional", + "label": "Optional" + }, { "type": "list", "key": "paterns", - "label": "Paterrns (regex)", + "label": "Patterns (regex)", "object_type": { "type": "text" } @@ -1127,18 +1138,43 @@ }, { "type": "dict", - "collapsible": false, + "collapsible": true, "key": "CleanUpFarm", "label": "Clean Up Farm", "is_group": true, "checkbox_key": "enabled", "children": [ - { - "type": "boolean", - "key": "enabled", - "label": "Enabled" - } - ] + { + "type": "boolean", + "key": "enabled", + "label": "Enabled" + }, + { + "type": "boolean", + "key": "optional", + "label": "Optional" + } + ] + }, + { + "type": "dict", + "collapsible": true, + "key": "ExplicitCleanUp", + "label": "Explicit Clean Up", + "is_group": true, + "checkbox_key": "enabled", + "children": [ + { + "type": "boolean", + "key": "enabled", + "label": "Enabled" + }, + { + "type": "boolean", + "key": "optional", + "label": "Optional" + } + ] } ] } From 505a50980f3582136d8e42f8207f44017b95ec3c Mon Sep 17 00:00:00 2001 From: Fabia Serra Arrizabalaga Date: Wed, 14 Jun 2023 11:41:34 -0500 Subject: [PATCH 2/5] Revert change of variable to avoid breaking compatibility --- openpype/plugins/publish/cleanup.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/openpype/plugins/publish/cleanup.py b/openpype/plugins/publish/cleanup.py index fba6d09bd51..06ac99ec07e 100644 --- a/openpype/plugins/publish/cleanup.py +++ b/openpype/plugins/publish/cleanup.py @@ -41,7 +41,7 @@ class CleanUp(pyblish.api.InstancePlugin): active = True # Presets - patterns = None # list of regex patterns + paterns = None # list of regex patterns remove_temp_renders = False def process(self, instance): @@ -145,8 +145,8 @@ def clean_renders(self, instance, skip_cleanup_filepaths): transfers_dirs = set(transfers_dirs) self.log.debug("__ transfers_dirs: `{}`".format(transfers_dirs)) - self.log.debug("__ self.patterns: `{}`".format(self.patterns)) - if self.patterns: + self.log.debug("__ self.paterns: `{}`".format(self.paterns)) + if self.paterns: files = list() # get list of all available content of dirs for _dir in transfers_dirs: @@ -158,12 +158,12 @@ def clean_renders(self, instance, skip_cleanup_filepaths): self.log.debug("__ files: `{}`".format(files)) - # remove all files which match regex patern + # remove all files which match regex pattern for f in files: if os.path.normpath(f) in skip_cleanup_filepaths: continue - for p in self.patterns: + for p in self.paterns: patern = re.compile(p) if not patern.findall(f): continue From 421565ac7d10e855d85e8899ac3295b61cff9cbc Mon Sep 17 00:00:00 2001 From: Fabia Serra Arrizabalaga Date: Wed, 14 Jun 2023 11:45:11 -0500 Subject: [PATCH 3/5] Fix two typos --- openpype/hosts/nuke/plugins/publish/extract_camera.py | 4 ++-- openpype/hosts/nuke/plugins/publish/extract_model.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/openpype/hosts/nuke/plugins/publish/extract_camera.py b/openpype/hosts/nuke/plugins/publish/extract_camera.py index 4286f71e834..33df6258aef 100644 --- a/openpype/hosts/nuke/plugins/publish/extract_camera.py +++ b/openpype/hosts/nuke/plugins/publish/extract_camera.py @@ -11,9 +11,9 @@ class ExtractCamera(publish.Extractor): - """ 3D camera exctractor + """ 3D camera extractor """ - label = 'Exctract Camera' + label = 'Extract Camera' order = pyblish.api.ExtractorOrder families = ["camera"] hosts = ["nuke"] diff --git a/openpype/hosts/nuke/plugins/publish/extract_model.py b/openpype/hosts/nuke/plugins/publish/extract_model.py index 814d4041375..00462f80351 100644 --- a/openpype/hosts/nuke/plugins/publish/extract_model.py +++ b/openpype/hosts/nuke/plugins/publish/extract_model.py @@ -11,9 +11,9 @@ class ExtractModel(publish.Extractor): - """ 3D model exctractor + """ 3D model extractor """ - label = 'Exctract Model' + label = 'Extract Model' order = pyblish.api.ExtractorOrder families = ["model"] hosts = ["nuke"] From 08671cb49d830a7cdc0ca1413b1db59cde3ecef3 Mon Sep 17 00:00:00 2001 From: Fabia Serra Arrizabalaga Date: Thu, 15 Jun 2023 11:13:45 -0500 Subject: [PATCH 4/5] Delete optional attribute from clean up plugins --- openpype/plugins/publish/cleanup.py | 1 - openpype/plugins/publish/cleanup_explicit.py | 1 - openpype/plugins/publish/cleanup_farm.py | 1 - .../defaults/project_settings/global.json | 7 ++----- .../schemas/schema_global_publish.json | 15 --------------- 5 files changed, 2 insertions(+), 23 deletions(-) diff --git a/openpype/plugins/publish/cleanup.py b/openpype/plugins/publish/cleanup.py index 06ac99ec07e..d28b21970f6 100644 --- a/openpype/plugins/publish/cleanup.py +++ b/openpype/plugins/publish/cleanup.py @@ -37,7 +37,6 @@ class CleanUp(pyblish.api.InstancePlugin): "shell" ] exclude_families = ["clip"] - optional = True active = True # Presets diff --git a/openpype/plugins/publish/cleanup_explicit.py b/openpype/plugins/publish/cleanup_explicit.py index 983c9223c66..58a7332e3c6 100644 --- a/openpype/plugins/publish/cleanup_explicit.py +++ b/openpype/plugins/publish/cleanup_explicit.py @@ -18,7 +18,6 @@ class ExplicitCleanUp(pyblish.api.ContextPlugin): order = pyblish.api.IntegratorOrder + 10 label = "Explicit Clean Up" - optional = True active = True def process(self, context): diff --git a/openpype/plugins/publish/cleanup_farm.py b/openpype/plugins/publish/cleanup_farm.py index 41f9e52dc03..8052f137346 100644 --- a/openpype/plugins/publish/cleanup_farm.py +++ b/openpype/plugins/publish/cleanup_farm.py @@ -14,7 +14,6 @@ class CleanUpFarm(pyblish.api.ContextPlugin): order = pyblish.api.IntegratorOrder + 11 label = "Clean Up Farm" enabled = True - optional = True # Keep "filesequence" for backwards compatibility of older jobs targets = ["filesequence", "farm"] diff --git a/openpype/settings/defaults/project_settings/global.json b/openpype/settings/defaults/project_settings/global.json index bd6a5608167..660d2e7910f 100644 --- a/openpype/settings/defaults/project_settings/global.json +++ b/openpype/settings/defaults/project_settings/global.json @@ -398,17 +398,14 @@ }, "CleanUp": { "enabled": true, - "optional": true, "paterns": [], "remove_temp_renders": false }, "CleanUpFarm": { - "enabled": false, - "optional": true + "enabled": false }, "ExplicitCleanUp": { - "enabled": false, - "optional": true + "enabled": false } }, "tools": { diff --git a/openpype/settings/entities/schemas/projects_schema/schemas/schema_global_publish.json b/openpype/settings/entities/schemas/projects_schema/schemas/schema_global_publish.json index aa47f16a6ba..e1dcd0256ce 100644 --- a/openpype/settings/entities/schemas/projects_schema/schemas/schema_global_publish.json +++ b/openpype/settings/entities/schemas/projects_schema/schemas/schema_global_publish.json @@ -1115,11 +1115,6 @@ "key": "enabled", "label": "Enabled" }, - { - "type": "boolean", - "key": "optional", - "label": "Optional" - }, { "type": "list", "key": "paterns", @@ -1148,11 +1143,6 @@ "type": "boolean", "key": "enabled", "label": "Enabled" - }, - { - "type": "boolean", - "key": "optional", - "label": "Optional" } ] }, @@ -1168,11 +1158,6 @@ "type": "boolean", "key": "enabled", "label": "Enabled" - }, - { - "type": "boolean", - "key": "optional", - "label": "Optional" } ] } From 51fbbd48eb3e0c569acd1e6df3aef2bdd9b094d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabi=C3=A0=20Serra=20Arrizabalaga?= Date: Wed, 30 Aug 2023 00:47:41 +0200 Subject: [PATCH 5/5] Update openpype/settings/defaults/project_settings/global.json Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> --- openpype/settings/defaults/project_settings/global.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openpype/settings/defaults/project_settings/global.json b/openpype/settings/defaults/project_settings/global.json index 660d2e7910f..21972be4179 100644 --- a/openpype/settings/defaults/project_settings/global.json +++ b/openpype/settings/defaults/project_settings/global.json @@ -405,7 +405,7 @@ "enabled": false }, "ExplicitCleanUp": { - "enabled": false + "enabled": true } }, "tools": {