mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-02 00:44:52 +01:00
add collector: CollectStagingDirsForCleaningUp
This commit is contained in:
parent
9285e0bec0
commit
24fd0cb749
2 changed files with 99 additions and 0 deletions
|
|
@ -0,0 +1,90 @@
|
|||
import pyblish.api
|
||||
|
||||
from ayon_core.pipeline import AYONPyblishPluginMixin
|
||||
|
||||
|
||||
class CollectStagingDirsForCleaningUp(pyblish.api.InstancePlugin,
|
||||
AYONPyblishPluginMixin):
|
||||
"""Collect Staging Directories For Cleaning Up.
|
||||
|
||||
This collector collects staging directories
|
||||
and adds them to file remove list.
|
||||
|
||||
CAUTION:
|
||||
This collector deletes the parent folder of the exported files.
|
||||
It works fine with the default filepaths in the creators.
|
||||
Artist should be aware with that fact so they take care when
|
||||
changing the file path in the ROP node.
|
||||
Developers should be aware when changing the filepath pattern
|
||||
in creator plugins.
|
||||
"""
|
||||
|
||||
order = pyblish.api.CollectorOrder
|
||||
|
||||
hosts = ["houdini"]
|
||||
label = "Collect Staging Directories For Cleaning Up"
|
||||
|
||||
def process(self, instance):
|
||||
|
||||
import hou
|
||||
|
||||
node = hou.node(instance.data["instance_node"])
|
||||
|
||||
# Get sop path
|
||||
node_type = node.type().name()
|
||||
if node_type == "geometry":
|
||||
filepath = node.evalParm("sopoutput")
|
||||
|
||||
elif node_type == "comp":
|
||||
filepath = node.evalParm("copoutput")
|
||||
|
||||
elif node_type == "alembic":
|
||||
filepath = node.evalParm("filename")
|
||||
|
||||
elif node_type == "ifd":
|
||||
filepath = node.evalParm("vm_picture")
|
||||
# vm_picture is empty when mantra node is
|
||||
# used to export .ifd files only.
|
||||
if not filepath:
|
||||
filepath = node.evalParm("soho_diskfile")
|
||||
|
||||
elif node_type == "Redshift_Proxy_Output":
|
||||
filepath = node.evalParm("RS_archive_file")
|
||||
|
||||
elif node_type == "Redshift_ROP":
|
||||
filepath = node.evalParm("RS_outputFileNamePrefix")
|
||||
|
||||
elif node_type == "opengl":
|
||||
filepath = node.evalParm("picture")
|
||||
|
||||
elif node_type == "filmboxfbx":
|
||||
filepath = node.evalParm("sopoutput")
|
||||
|
||||
elif node_type == "usd":
|
||||
filepath = node.evalParm("lopoutput")
|
||||
|
||||
elif node_type == "karma":
|
||||
filepath = node.evalParm("picture")
|
||||
|
||||
elif node_type == "arnold":
|
||||
filepath = node.evalParm("ar_picture")
|
||||
# ar_picture is empty when arnold node is
|
||||
# used to export .ass files only.
|
||||
if not filepath:
|
||||
filepath = node.evalParm("ar_ass_file")
|
||||
|
||||
elif node_type == "vray_renderer":
|
||||
filepath = node.evalParm("SettingsOutput_img_file_path")
|
||||
|
||||
else:
|
||||
self.log.debug(
|
||||
"ROP node type '{}' is not supported for cleaning up."
|
||||
.format(node_type)
|
||||
)
|
||||
|
||||
if not filepath:
|
||||
self.log.warning("No filepath value to collect.")
|
||||
return
|
||||
|
||||
self.log.debug("Add to clean up list: {}".format(filepath))
|
||||
instance.context.data["cleanupFullPaths"] = filepath
|
||||
|
|
@ -49,6 +49,10 @@ class PublishPluginsModel(BaseSettingsModel):
|
|||
default_factory=CollectChunkSizeModel,
|
||||
title="Collect Chunk Size."
|
||||
)
|
||||
CollectStagingDirsForCleaningUp:BasicValidateModel = SettingsField(
|
||||
default_factory=BasicValidateModel,
|
||||
title="Collect Staging Directories For Cleaning Up."
|
||||
)
|
||||
ValidateContainers: BasicValidateModel = SettingsField(
|
||||
default_factory=BasicValidateModel,
|
||||
title="Validate Latest Containers.",
|
||||
|
|
@ -79,6 +83,11 @@ DEFAULT_HOUDINI_PUBLISH_SETTINGS = {
|
|||
"optional": True,
|
||||
"chunk_size": 999999
|
||||
},
|
||||
"CollectStagingDirsForCleaningUp": {
|
||||
"enabled": True,
|
||||
"optional": True,
|
||||
"active": True
|
||||
},
|
||||
"ValidateContainers": {
|
||||
"enabled": True,
|
||||
"optional": True,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue