mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 16:34:53 +01:00
add option to disable render cleanup
This commit is contained in:
parent
49aa669467
commit
67c03d4aa0
1 changed files with 9 additions and 3 deletions
|
|
@ -21,6 +21,7 @@ class CleanUp(pyblish.api.InstancePlugin):
|
|||
|
||||
# Presets
|
||||
paterns = None # list of regex paterns
|
||||
remove_temp_renders = True
|
||||
|
||||
def process(self, instance):
|
||||
"""Plugin entry point."""
|
||||
|
|
@ -36,8 +37,9 @@ class CleanUp(pyblish.api.InstancePlugin):
|
|||
)
|
||||
)
|
||||
|
||||
self.log.info("Cleaning renders new...")
|
||||
self.clean_renders(instance)
|
||||
if self.remove_temp_renders:
|
||||
self.log.info("Cleaning renders new...")
|
||||
self.clean_renders(instance)
|
||||
|
||||
if [ef for ef in self.exclude_families
|
||||
if instance.data["family"] in ef]:
|
||||
|
|
@ -85,7 +87,11 @@ class CleanUp(pyblish.api.InstancePlugin):
|
|||
if os.path.normpath(src) != os.path.normpath(dest):
|
||||
if instance_family == 'render' or 'render' in current_families:
|
||||
self.log.info("Removing src: `{}`...".format(src))
|
||||
os.remove(src)
|
||||
try:
|
||||
os.remove(src)
|
||||
except PermissionError:
|
||||
self.log.warning("Insufficient permission to delete {}".format(src))
|
||||
continue
|
||||
|
||||
# add dir for cleanup
|
||||
dirnames.append(os.path.dirname(src))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue