mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-26 22:02:15 +01:00
Only collect file dependencies if enabled in settings and only collect if renderlayer family is present
This commit is contained in:
parent
6af300e6ee
commit
e73a4ef4bf
1 changed files with 11 additions and 7 deletions
|
|
@ -1,5 +1,3 @@
|
|||
import json
|
||||
|
||||
from maya import cmds
|
||||
|
||||
import pyblish.api
|
||||
|
|
@ -11,18 +9,24 @@ class CollectFileDependencies(pyblish.api.ContextPlugin):
|
|||
label = "Collect File Dependencies"
|
||||
order = pyblish.api.CollectorOrder - 0.49
|
||||
hosts = ["maya"]
|
||||
families = ["renderlayer"]
|
||||
|
||||
@classmethod
|
||||
def apply_settings(cls, project_settings, system_settings):
|
||||
# Disable plug-in if not used for deadline submission anyway
|
||||
settings = project_settings["deadline"]["publish"]["MayaSubmitDeadline"] # noqa
|
||||
cls.enabled = settings.get("asset_dependencies", True)
|
||||
|
||||
def process(self, context):
|
||||
dependencies = []
|
||||
dependencies = set()
|
||||
for node in cmds.ls(type="file"):
|
||||
path = cmds.getAttr("{}.{}".format(node, "fileTextureName"))
|
||||
if path not in dependencies:
|
||||
dependencies.append(path)
|
||||
dependencies.add(path)
|
||||
|
||||
for node in cmds.ls(type="AlembicNode"):
|
||||
path = cmds.getAttr("{}.{}".format(node, "abc_File"))
|
||||
if path not in dependencies:
|
||||
dependencies.append(path)
|
||||
dependencies.add(path)
|
||||
|
||||
context.data["fileDependencies"] = dependencies
|
||||
self.log.debug(json.dumps(dependencies, indent=4))
|
||||
context.data["fileDependencies"] = list(dependencies)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue