mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 16:34:53 +01:00
Merge pull request #1214 from BigRoy/enhancement/allow_disabling_removal_of_rendereed_files_on_farm
This commit is contained in:
commit
28c9709a65
2 changed files with 26 additions and 2 deletions
|
|
@ -31,6 +31,9 @@ class CollectRenderedFiles(pyblish.api.ContextPlugin):
|
||||||
# Keep "filesequence" for backwards compatibility of older jobs
|
# Keep "filesequence" for backwards compatibility of older jobs
|
||||||
targets = ["filesequence", "farm"]
|
targets = ["filesequence", "farm"]
|
||||||
label = "Collect rendered frames"
|
label = "Collect rendered frames"
|
||||||
|
settings_category = "core"
|
||||||
|
|
||||||
|
remove_files = False
|
||||||
|
|
||||||
_context = None
|
_context = None
|
||||||
|
|
||||||
|
|
@ -120,7 +123,7 @@ class CollectRenderedFiles(pyblish.api.ContextPlugin):
|
||||||
self._fill_staging_dir(repre_data, anatomy)
|
self._fill_staging_dir(repre_data, anatomy)
|
||||||
representations.append(repre_data)
|
representations.append(repre_data)
|
||||||
|
|
||||||
if not staging_dir_persistent:
|
if self.remove_files and not staging_dir_persistent:
|
||||||
add_repre_files_for_cleanup(instance, repre_data)
|
add_repre_files_for_cleanup(instance, repre_data)
|
||||||
|
|
||||||
instance.data["representations"] = representations
|
instance.data["representations"] = representations
|
||||||
|
|
@ -170,7 +173,7 @@ class CollectRenderedFiles(pyblish.api.ContextPlugin):
|
||||||
os.environ.update(session_data)
|
os.environ.update(session_data)
|
||||||
|
|
||||||
staging_dir_persistent = self._process_path(data, anatomy)
|
staging_dir_persistent = self._process_path(data, anatomy)
|
||||||
if not staging_dir_persistent:
|
if self.remove_files and not staging_dir_persistent:
|
||||||
context.data["cleanupFullPaths"].append(path)
|
context.data["cleanupFullPaths"].append(path)
|
||||||
context.data["cleanupEmptyDirs"].append(
|
context.data["cleanupEmptyDirs"].append(
|
||||||
os.path.dirname(path)
|
os.path.dirname(path)
|
||||||
|
|
|
||||||
|
|
@ -929,6 +929,20 @@ class IntegrateHeroVersionModel(BaseSettingsModel):
|
||||||
"hero versions.")
|
"hero versions.")
|
||||||
|
|
||||||
|
|
||||||
|
class CollectRenderedFilesModel(BaseSettingsModel):
|
||||||
|
remove_files: bool = SettingsField(
|
||||||
|
False,
|
||||||
|
title="Remove rendered files",
|
||||||
|
description=(
|
||||||
|
"Remove rendered files and metadata json on publish.\n\n"
|
||||||
|
"Note that when enabled but the render is to a configured "
|
||||||
|
"persistent staging directory the files will not be removed. "
|
||||||
|
"However with this disabled the files will **not** be removed in "
|
||||||
|
"either case."
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class CleanUpModel(BaseSettingsModel):
|
class CleanUpModel(BaseSettingsModel):
|
||||||
_isGroup = True
|
_isGroup = True
|
||||||
paterns: list[str] = SettingsField( # codespell:ignore paterns
|
paterns: list[str] = SettingsField( # codespell:ignore paterns
|
||||||
|
|
@ -1041,6 +1055,10 @@ class PublishPuginsModel(BaseSettingsModel):
|
||||||
"published as a render/review product of its own."
|
"published as a render/review product of its own."
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
CollectRenderedFiles: CollectRenderedFilesModel = SettingsField(
|
||||||
|
default_factory=CollectRenderedFilesModel,
|
||||||
|
title="Clean up farm rendered files"
|
||||||
|
)
|
||||||
CleanUp: CleanUpModel = SettingsField(
|
CleanUp: CleanUpModel = SettingsField(
|
||||||
default_factory=CleanUpModel,
|
default_factory=CleanUpModel,
|
||||||
title="Clean Up"
|
title="Clean Up"
|
||||||
|
|
@ -1428,6 +1446,9 @@ DEFAULT_PUBLISH_VALUES = {
|
||||||
"AttachReviewables": {
|
"AttachReviewables": {
|
||||||
"enabled": True,
|
"enabled": True,
|
||||||
},
|
},
|
||||||
|
"CollectRenderedFiles": {
|
||||||
|
"remove_files": False
|
||||||
|
},
|
||||||
"CleanUp": {
|
"CleanUp": {
|
||||||
"paterns": [], # codespell:ignore paterns
|
"paterns": [], # codespell:ignore paterns
|
||||||
"remove_temp_renders": False
|
"remove_temp_renders": False
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue