Skip to content

Commit

Permalink
Merge pull request #505 from ynput/enhancement/AY-991_Blender-Deadlin…
Browse files Browse the repository at this point in the history
…e-asset-dependencies

Blender: Deadline asset dependencies
  • Loading branch information
simonebarbieri authored Jun 18, 2024
2 parents d9518b6 + b485f32 commit a96258f
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
from pathlib import Path

import pyblish.api

import bpy


class CollectFileDependencies(pyblish.api.ContextPlugin):
"""Gather all files referenced in this scene."""

label = "Collect File Dependencies"
order = pyblish.api.CollectorOrder - 0.49
hosts = ["blender"]
families = ["render"]

@classmethod
def apply_settings(cls, project_settings):
# Disable plug-in if not used for deadline submission anyway
settings = project_settings["deadline"]["publish"]["BlenderSubmitDeadline"] # noqa
cls.enabled = settings.get("asset_dependencies", True)

def process(self, context):
dependencies = set()

# Add alembic files as dependencies
for cache in bpy.data.cache_files:
dependencies.add(
Path(bpy.path.abspath(cache.filepath)).resolve().as_posix())

# Add image files as dependencies
for image in bpy.data.images:
if image.filepath:
dependencies.add(Path(
bpy.path.abspath(image.filepath)).resolve().as_posix())

context.data["fileDependencies"] = list(dependencies)
2 changes: 1 addition & 1 deletion server_addon/blender/client/ayon_blender/version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# -*- coding: utf-8 -*-
"""Package declaring AYON addon 'blender' version."""
__version__ = "0.2.0"
__version__ = "0.2.1"
2 changes: 1 addition & 1 deletion server_addon/blender/package.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "blender"
title = "Blender"
version = "0.2.0"
version = "0.2.1"

client_dir = "ayon_blender"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ def get_plugin_info(self):

return plugin_payload

def process_submission(self):
def process_submission(self, auth=None):
instance = self._instance

expected_files = instance.data["expectedFiles"]
Expand Down
2 changes: 1 addition & 1 deletion server_addon/deadline/client/ayon_deadline/version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# -*- coding: utf-8 -*-
"""Package declaring AYON addon 'deadline' version."""
__version__ = "0.2.0"
__version__ = "0.2.1"
2 changes: 1 addition & 1 deletion server_addon/deadline/package.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "deadline"
title = "Deadline"
version = "0.2.0"
version = "0.2.1"

client_dir = "ayon_deadline"

Expand Down
2 changes: 2 additions & 0 deletions server_addon/deadline/server/settings/publish_plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ class BlenderSubmitDeadlineModel(BaseSettingsModel):
optional: bool = SettingsField(title="Optional")
active: bool = SettingsField(title="Active")
use_published: bool = SettingsField(title="Use Published scene")
asset_dependencies: bool = SettingsField(title="Use Asset dependencies")
priority: int = SettingsField(title="Priority")
chunk_size: int = SettingsField(title="Frame per Task")
group: str = SettingsField("", title="Group Name")
Expand Down Expand Up @@ -413,6 +414,7 @@ class PublishPluginsModel(BaseSettingsModel):
"optional": False,
"active": True,
"use_published": True,
"asset_dependencies": True,
"priority": 50,
"chunk_size": 10,
"group": "none",
Expand Down

0 comments on commit a96258f

Please sign in to comment.