update comments

This commit is contained in:
MustafaJafar 2024-04-22 15:20:03 +02:00
parent 2f1096484a
commit ccaba9340b

View file

@ -8,7 +8,7 @@ from ayon_core.hosts.houdini.api import lib
class CollectFilesForCleaningUp(pyblish.api.InstancePlugin,
AYONPyblishPluginMixin):
"""Collect Files For Cleaning Up.
This collector collects output files
and adds them to file remove list.
@ -45,20 +45,20 @@ class CollectFilesForCleaningUp(pyblish.api.InstancePlugin,
if not node:
self.log.debug("Skipping Collector. Instance has no instance_node")
return
output_parm = lib.get_output_parameter(node)
if not output_parm:
self.log.debug("ROP node type '{}' is not supported for cleaning up."
.format(node.type().name()))
return
filepath = output_parm.eval()
if not filepath:
self.log.warning("No filepath value to collect.")
return
files = []
# Non Render Products with frames
# Products with frames
frames = instance.data.get("frames", [])
staging_dir, _ = os.path.split(filepath)
if isinstance(frames, str):
@ -66,7 +66,7 @@ class CollectFilesForCleaningUp(pyblish.api.InstancePlugin,
else:
files = [os.path.join(staging_dir, f) for f in frames]
# Render Products
# Farm Products with expected files
expectedFiles = instance.data.get("expectedFiles", [])
for aovs in expectedFiles:
# aovs.values() is a list of lists
@ -74,7 +74,7 @@ class CollectFilesForCleaningUp(pyblish.api.InstancePlugin,
# Intermediate exported render files.
# TODO : For products like Karma,
# Karma has more intermediate files
# Karma has more intermediate files
# e.g. USD and checkpoint
ifdFile = instance.data.get("ifdFile")
if self.intermediate_exported_render and ifdFile:
@ -84,14 +84,14 @@ class CollectFilesForCleaningUp(pyblish.api.InstancePlugin,
ifd_files = self._get_ifd_file_list(ifdFile,
start_frame, end_frame)
files.extend(ifd_files)
# Non Render Products with no frames
# Products with single output file/frame
if not files:
files.append(filepath)
self.log.debug("Add directories to 'cleanupEmptyDir': {}".format(staging_dir))
instance.context.data["cleanupEmptyDirs"].append(staging_dir)
self.log.debug("Add files to 'cleanupFullPaths': {}".format(files))
instance.context.data["cleanupFullPaths"] += files
@ -113,10 +113,10 @@ class CollectFilesForCleaningUp(pyblish.api.InstancePlugin,
match, int(start_frame), int(end_frame)
)
result = [
os.path.join(parent_path, r).replace("\\", "/")
os.path.join(parent_path, r).replace("\\", "/")
for r in result
]
return result
return []
return result
return []