mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-02 00:44:52 +01:00
Add all file and alembic path to Deadline submissions.
This commit is contained in:
parent
579d9e0162
commit
3cb5c7c6ac
2 changed files with 38 additions and 3 deletions
28
pype/plugins/maya/publish/collect_file_dependencies.py
Normal file
28
pype/plugins/maya/publish/collect_file_dependencies.py
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
import json
|
||||
|
||||
from maya import cmds
|
||||
|
||||
import pyblish.api
|
||||
|
||||
|
||||
class CollectFileDependencies(pyblish.api.ContextPlugin):
|
||||
"""Gather all files referenced in this scene."""
|
||||
|
||||
label = "Collect File Dependencies"
|
||||
order = pyblish.api.CollectorOrder - 0.49
|
||||
hosts = ["maya"]
|
||||
|
||||
def process(self, context):
|
||||
dependencies = []
|
||||
for node in cmds.ls(type="file"):
|
||||
path = cmds.getAttr("{}.{}".format(node, "fileTextureName"))
|
||||
if path not in dependencies:
|
||||
dependencies.append(path)
|
||||
|
||||
for node in cmds.ls(type="AlembicNode"):
|
||||
path = cmds.getAttr("{}.{}".format(node, "abc_File"))
|
||||
if path not in dependencies:
|
||||
dependencies.append(path)
|
||||
|
||||
context.data["fileDependencies"] = dependencies
|
||||
self.log.debug(json.dumps(dependencies, indent=4))
|
||||
|
|
@ -213,9 +213,6 @@ class MayaSubmitDeadline(pyblish.api.InstancePlugin):
|
|||
# Top-level group name
|
||||
"BatchName": filename,
|
||||
|
||||
# Asset dependency to wait for at least the scene file to sync.
|
||||
"AssetDependency0": filepath,
|
||||
|
||||
# Job name, as seen in Monitor
|
||||
"Name": jobname,
|
||||
|
||||
|
|
@ -264,6 +261,16 @@ class MayaSubmitDeadline(pyblish.api.InstancePlugin):
|
|||
"AuxFiles": []
|
||||
}
|
||||
|
||||
# Adding file dependencies.
|
||||
dependencies = instance.context.data["fileDependencies"]
|
||||
dependencies.append(filepath)
|
||||
for dependency in dependencies:
|
||||
self.log.info(dependency)
|
||||
key = "AssetDependency" + str(dependencies.index(dependency))
|
||||
self.log.info(key)
|
||||
payload["JobInfo"][key] = dependency
|
||||
|
||||
# Expected files.
|
||||
exp = instance.data.get("expectedFiles")
|
||||
|
||||
OutputFilenames = {}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue