Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

General: Expose cleanup plugin settings #5141

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions openpype/plugins/publish/cleanup.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,11 @@ class CleanUp(pyblish.api.InstancePlugin):
"shell"
]
exclude_families = ["clip"]
optional = True
active = True

# Presets
paterns = None # list of regex paterns
remove_temp_renders = True
paterns = None # list of regex patterns
fabiaserra marked this conversation as resolved.
Show resolved Hide resolved
remove_temp_renders = False
fabiaserra marked this conversation as resolved.
Show resolved Hide resolved

def process(self, instance):
"""Plugin entry point."""
Expand Down Expand Up @@ -114,10 +113,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:
Expand All @@ -140,7 +139,7 @@ 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)

Expand All @@ -158,7 +157,7 @@ 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
Expand Down
1 change: 0 additions & 1 deletion openpype/plugins/publish/cleanup_explicit.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
4 changes: 4 additions & 0 deletions openpype/settings/defaults/project_settings/global.json
Original file line number Diff line number Diff line change
Expand Up @@ -334,11 +334,15 @@
]
},
"CleanUp": {
iLLiCiTiT marked this conversation as resolved.
Show resolved Hide resolved
"enabled": true,
"paterns": [],
"remove_temp_renders": false
},
"CleanUpFarm": {
"enabled": false
},
"ExplicitCleanUp": {
"enabled": true
}
},
"tools": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -977,11 +977,17 @@
"key": "CleanUp",
"label": "Clean Up",
"is_group": true,
"checkbox_key": "enabled",
"children": [
{
"type": "boolean",
"key": "enabled",
"label": "Enabled"
},
{
"type": "list",
"key": "paterns",
"label": "Paterrns (regex)",
"label": "Patterns (regex)",
"object_type": {
"type": "text"
}
Expand All @@ -996,18 +1002,33 @@
},
{
"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": "dict",
"collapsible": true,
"key": "ExplicitCleanUp",
"label": "Explicit Clean Up",
"is_group": true,
"checkbox_key": "enabled",
"children": [
{
"type": "boolean",
"key": "enabled",
"label": "Enabled"
}
]
}
]
}
Loading