Skip to content

Commit

Permalink
add missing file
Browse files Browse the repository at this point in the history
  • Loading branch information
iLLiCiTiT committed Jul 3, 2024
1 parent a8c776b commit 9ec090a
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions client/ayon_blender/plugins/publish/collect_file_dependencies.py
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)

0 comments on commit 9ec090a

Please sign in to comment.