mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 12:54:40 +01:00
Merge branch 'develop' into enhancement/AY-6586_Thumbnail_presets
This commit is contained in:
commit
6558af5ff1
2 changed files with 30 additions and 1 deletions
|
|
@ -1,3 +1,5 @@
|
|||
from __future__ import annotations
|
||||
from typing import Any
|
||||
import ayon_api
|
||||
import ayon_api.utils
|
||||
|
||||
|
|
@ -32,6 +34,8 @@ class CollectSceneLoadedVersions(pyblish.api.ContextPlugin):
|
|||
self.log.debug("No loaded containers found in scene.")
|
||||
return
|
||||
|
||||
containers = self._filter_invalid_containers(containers)
|
||||
|
||||
repre_ids = {
|
||||
container["representation"]
|
||||
for container in containers
|
||||
|
|
@ -78,3 +82,28 @@ class CollectSceneLoadedVersions(pyblish.api.ContextPlugin):
|
|||
|
||||
self.log.debug(f"Collected {len(loaded_versions)} loaded versions.")
|
||||
context.data["loadedVersions"] = loaded_versions
|
||||
|
||||
def _filter_invalid_containers(
|
||||
self,
|
||||
containers: list[dict[str, Any]]
|
||||
) -> list[dict[str, Any]]:
|
||||
"""Filter out invalid containers lacking required keys.
|
||||
|
||||
Skip any invalid containers that lack 'representation' or 'name'
|
||||
keys to avoid KeyError.
|
||||
"""
|
||||
# Only filter by what's required for this plug-in instead of validating
|
||||
# a full container schema.
|
||||
required_keys = {"name", "representation"}
|
||||
valid = []
|
||||
for container in containers:
|
||||
missing = [key for key in required_keys if key not in container]
|
||||
if missing:
|
||||
self.log.warning(
|
||||
"Skipping invalid container, missing required keys:"
|
||||
" {}. {}".format(", ".join(missing), container)
|
||||
)
|
||||
continue
|
||||
valid.append(container)
|
||||
|
||||
return valid
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ opentimelineio = "^0.17.0"
|
|||
speedcopy = "^2.1"
|
||||
qtpy="^2.4.3"
|
||||
pyside6 = "^6.5.2"
|
||||
pytest-ayon = { git = "https://github.com/ynput/pytest-ayon.git", branch = "chore/align-dependencies" }
|
||||
pytest-ayon = { git = "https://github.com/ynput/pytest-ayon.git", branch = "develop" }
|
||||
|
||||
[tool.codespell]
|
||||
# Ignore words that are not in the dictionary.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue