mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-02 00:44:52 +01:00
add essential publish plugins for model product type
This commit is contained in:
parent
ade52e7897
commit
ba57d6db6d
7 changed files with 72 additions and 10 deletions
|
|
@ -10,7 +10,7 @@ class CollectDataforCache(pyblish.api.InstancePlugin):
|
|||
order = pyblish.api.CollectorOrder + 0.04
|
||||
families = ["ass", "pointcache",
|
||||
"mantraifd", "redshiftproxy",
|
||||
"vdbcache"]
|
||||
"vdbcache", "model"]
|
||||
hosts = ["houdini"]
|
||||
targets = ["local", "remote"]
|
||||
label = "Collect Data for Cache"
|
||||
|
|
@ -42,10 +42,7 @@ class CollectDataforCache(pyblish.api.InstancePlugin):
|
|||
cache_files = {"_": instance.data["files"]}
|
||||
# Convert instance family to pointcache if it is bgeo or abc
|
||||
# because ???
|
||||
for family in instance.data["families"]:
|
||||
if family == "bgeo" or "abc":
|
||||
instance.data["productType"] = "pointcache"
|
||||
break
|
||||
self.log.debug(instance.data["families"])
|
||||
instance.data.update({
|
||||
"plugin": "Houdini",
|
||||
"publish": True
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ class CollectChunkSize(pyblish.api.InstancePlugin,
|
|||
order = pyblish.api.CollectorOrder + 0.05
|
||||
families = ["ass", "pointcache",
|
||||
"vdbcache", "mantraifd",
|
||||
"redshiftproxy"]
|
||||
"redshiftproxy", "model"]
|
||||
hosts = ["houdini"]
|
||||
targets = ["local", "remote"]
|
||||
label = "Collect Chunk Size"
|
||||
|
|
|
|||
|
|
@ -15,7 +15,8 @@ class CollectOutputSOPPath(pyblish.api.InstancePlugin):
|
|||
"usd",
|
||||
"usdrender",
|
||||
"redshiftproxy",
|
||||
"staticMesh"
|
||||
"staticMesh",
|
||||
"model"
|
||||
]
|
||||
|
||||
hosts = ["houdini"]
|
||||
|
|
|
|||
|
|
@ -0,0 +1,60 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
"""Validator for checking that export is a single frame."""
|
||||
import pyblish.api
|
||||
from ayon_core.pipeline import (
|
||||
PublishValidationError,
|
||||
OptionalPyblishPluginMixin
|
||||
)
|
||||
from ayon_core.pipeline.publish import ValidateContentsOrder
|
||||
from ayon_core.hosts.houdini.api.action import SelectInvalidAction
|
||||
|
||||
|
||||
class ValidateSingleFrame(pyblish.api.InstancePlugin,
|
||||
OptionalPyblishPluginMixin):
|
||||
"""Validate Export is a Single Frame.
|
||||
|
||||
It checks if rop node is exporting one frame.
|
||||
This is mainly for Model product type.
|
||||
"""
|
||||
|
||||
families = ["model"]
|
||||
hosts = ["houdini"]
|
||||
label = "Validate Single Frame"
|
||||
order = ValidateContentsOrder + 0.1
|
||||
actions = [SelectInvalidAction]
|
||||
|
||||
def process(self, instance):
|
||||
|
||||
invalid = self.get_invalid(instance)
|
||||
if invalid:
|
||||
nodes = [n.path() for n in invalid]
|
||||
raise PublishValidationError(
|
||||
"See log for details. "
|
||||
"Invalid nodes: {0}".format(nodes)
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def get_invalid(cls, instance):
|
||||
|
||||
invalid = []
|
||||
|
||||
frame_start = instance.data.get("frameStartHandle")
|
||||
frame_end = instance.data.get("frameEndHandle")
|
||||
|
||||
# This happens if instance node has no 'trange' parameter.
|
||||
if (frame_start or frame_end) is None:
|
||||
cls.log.debug(
|
||||
"No frame data, skipping check.."
|
||||
)
|
||||
return
|
||||
|
||||
if frame_start != frame_end:
|
||||
invalid.append(instance.data["instance_node"])
|
||||
cls.log.error(
|
||||
"Invalid frame range on '%s'."
|
||||
"You should use the same frame number for 'f1' "
|
||||
"and 'f2' parameters.",
|
||||
instance.data["instance_node"].path()
|
||||
)
|
||||
|
||||
return invalid
|
||||
|
|
@ -16,9 +16,13 @@ class ValidateMeshIsStatic(pyblish.api.InstancePlugin,
|
|||
"""Validate mesh is static.
|
||||
|
||||
It checks if output node is time dependent.
|
||||
this avoids getting different output from ROP node when extracted
|
||||
from a different frame than the first frame.
|
||||
(Might be overly restrictive though)
|
||||
"""
|
||||
|
||||
families = ["staticMesh"]
|
||||
families = ["staticMesh",
|
||||
"model"]
|
||||
hosts = ["houdini"]
|
||||
label = "Validate Mesh is Static"
|
||||
order = ValidateContentsOrder + 0.1
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ class ValidateIntermediateDirectoriesChecked(pyblish.api.InstancePlugin):
|
|||
"""Validate Create Intermediate Directories is enabled on ROP node."""
|
||||
|
||||
order = pyblish.api.ValidatorOrder
|
||||
families = ["pointcache", "camera", "vdbcache"]
|
||||
families = ["pointcache", "camera", "vdbcache", "model"]
|
||||
hosts = ["houdini"]
|
||||
label = "Create Intermediate Directories Checked"
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ class ValidateSopOutputNode(pyblish.api.InstancePlugin):
|
|||
"""
|
||||
|
||||
order = pyblish.api.ValidatorOrder
|
||||
families = ["pointcache", "vdbcache"]
|
||||
families = ["pointcache", "vdbcache", "model"]
|
||||
hosts = ["houdini"]
|
||||
label = "Validate Output Node (SOP)"
|
||||
actions = [SelectROPAction, SelectInvalidAction]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue