Skip to content

Commit

Permalink
Do not error on None value in id metadata if a scene object has t…
Browse files Browse the repository at this point in the history
…hat stored
  • Loading branch information
BigRoy committed Jan 22, 2025
1 parent b96d315 commit c5758fe
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
15 changes: 8 additions & 7 deletions client/ayon_harmony/api/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
register_creator_plugin_path,
deregister_loader_plugin_path,
deregister_creator_plugin_path,
AVALON_CONTAINER_ID,
AYON_CONTAINER_ID,
)
from ayon_core.pipeline.load import get_outdated_containers
Expand Down Expand Up @@ -272,6 +273,11 @@ def inject_ayon_js():
harmony.send({"script": script})


def is_container_data(data: dict) -> bool:
"""Return whether data is container data."""
return data and data.get("id") in {AYON_CONTAINER_ID, AVALON_CONTAINER_ID}


def ls():
"""Yields containers from Harmony scene.
Expand All @@ -280,12 +286,7 @@ def ls():
"""
objects = harmony.get_scene_data() or {}
for _, data in objects.items():
# Skip non-tagged objects.
if not data:
continue

# Filter to only containers.
if "container" not in data.get("id", ""):
if not is_container_data(data):
continue

if not data.get("objectName"): # backward compatibility
Expand Down Expand Up @@ -315,7 +316,7 @@ def list_instances(remove_orphaned=True):
continue

# Filter out containers.
if "container" in data.get("id"):
if is_container_data(data):
continue

data['uuid'] = key
Expand Down
3 changes: 2 additions & 1 deletion client/ayon_harmony/plugins/publish/collect_farm_render.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from ayon_core.pipeline import publish
from ayon_core.pipeline.publish import RenderInstance
import ayon_harmony.api as harmony
from ayon_harmony.api.pipeline import is_container_data


@attr.s
Expand Down Expand Up @@ -108,7 +109,7 @@ def get_instances(self, context):
continue

# Skip containers.
if "container" in data["id"]:
if is_container_data(data):
continue

product_type = data.get("productType")
Expand Down
3 changes: 2 additions & 1 deletion client/ayon_harmony/plugins/publish/collect_instances.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import pyblish.api
import ayon_harmony.api as harmony
from ayon_harmony.api.pipeline import is_container_data


class CollectInstances(pyblish.api.ContextPlugin):
Expand Down Expand Up @@ -46,7 +47,7 @@ def process(self, context):
continue

# Skip containers.
if "container" in data["id"]:
if is_container_data(data):
continue

product_type = data.get("productType")
Expand Down

0 comments on commit c5758fe

Please sign in to comment.