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 4 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
4 changes: 2 additions & 2 deletions openpype/hosts/nuke/plugins/publish/extract_camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
4 changes: 2 additions & 2 deletions openpype/hosts/nuke/plugins/publish/extract_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
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
remove_temp_renders = False

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 @@ -397,11 +397,15 @@
]
},
"CleanUp": {
"enabled": true,
"paterns": [],
"remove_temp_renders": false
},
"CleanUpFarm": {
"enabled": false
},
"ExplicitCleanUp": {
"enabled": false
}
},
"tools": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1108,11 +1108,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 @@ -1127,18 +1133,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"
}
]
}
]
}