mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-02 08:54:53 +01:00
use lib function to get output parameters
This commit is contained in:
parent
492f021ce4
commit
76b38b40b2
1 changed files with 7 additions and 58 deletions
|
|
@ -1,6 +1,7 @@
|
|||
import pyblish.api
|
||||
import os
|
||||
from ayon_core.pipeline import AYONPyblishPluginMixin
|
||||
from ayon_core.hosts.houdini.api import lib
|
||||
|
||||
|
||||
class CollectFilesForCleaningUp(pyblish.api.InstancePlugin,
|
||||
|
|
@ -38,11 +39,13 @@ class CollectFilesForCleaningUp(pyblish.api.InstancePlugin,
|
|||
import hou
|
||||
|
||||
node = hou.node(instance.data["instance_node"])
|
||||
filepath = self.get_filepath(node)
|
||||
|
||||
if not filepath:
|
||||
self.log.warning("No filepath value to collect.")
|
||||
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()
|
||||
|
||||
staging_dir, _ = os.path.split(filepath)
|
||||
files = instance.data.get("frames", [])
|
||||
|
|
@ -56,57 +59,3 @@ class CollectFilesForCleaningUp(pyblish.api.InstancePlugin,
|
|||
|
||||
self.log.debug("Add files to 'cleanupFullPaths': {}".format(files))
|
||||
instance.context.data["cleanupFullPaths"] += files
|
||||
|
||||
def get_filepath(self, node):
|
||||
# Get sop path
|
||||
node_type = node.type().name()
|
||||
filepath = None
|
||||
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":
|
||||
if node.evalParm("soho_outputmode"):
|
||||
filepath = node.evalParm("soho_diskfile")
|
||||
else:
|
||||
filepath = node.evalParm("vm_picture")
|
||||
|
||||
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":
|
||||
if node.evalParm("ar_ass_export_enable"):
|
||||
filepath = node.evalParm("ar_ass_file")
|
||||
else:
|
||||
filepath = node.evalParm("ar_picture")
|
||||
|
||||
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)
|
||||
)
|
||||
|
||||
return filepath
|
||||
Loading…
Add table
Add a link
Reference in a new issue