From ff20964dc061f5384eb2a28b3ede6906d2543fc0 Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Fri, 8 Mar 2024 12:38:46 +0100 Subject: [PATCH] hiero use representation entity --- client/ayon_core/hosts/hiero/api/pipeline.py | 2 +- client/ayon_core/hosts/hiero/api/plugin.py | 2 +- client/ayon_core/hosts/hiero/plugins/load/load_clip.py | 7 ++++--- client/ayon_core/hosts/hiero/plugins/load/load_effects.py | 8 ++++---- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/client/ayon_core/hosts/hiero/api/pipeline.py b/client/ayon_core/hosts/hiero/api/pipeline.py index a9ba2e4df3..327a4ae29c 100644 --- a/client/ayon_core/hosts/hiero/api/pipeline.py +++ b/client/ayon_core/hosts/hiero/api/pipeline.py @@ -101,7 +101,7 @@ def containerise(track_item, "name": str(name), "namespace": str(namespace), "loader": str(loader), - "representation": str(context["representation"]["_id"]), + "representation": context["representation"]["id"], }) if data: diff --git a/client/ayon_core/hosts/hiero/api/plugin.py b/client/ayon_core/hosts/hiero/api/plugin.py index cf3b4dadaf..6a665dc9c5 100644 --- a/client/ayon_core/hosts/hiero/api/plugin.py +++ b/client/ayon_core/hosts/hiero/api/plugin.py @@ -458,7 +458,7 @@ class ClipLoader: # gets file path file = get_representation_path_from_context(self.context) if not file: - repr_id = repr["_id"] + repr_id = repr["id"] log.warning( "Representation id `{}` is failing to load".format(repr_id)) return None diff --git a/client/ayon_core/hosts/hiero/plugins/load/load_clip.py b/client/ayon_core/hosts/hiero/plugins/load/load_clip.py index b35c5b2f1f..c2ff907650 100644 --- a/client/ayon_core/hosts/hiero/plugins/load/load_clip.py +++ b/client/ayon_core/hosts/hiero/plugins/load/load_clip.py @@ -150,7 +150,7 @@ class LoadClip(phiero.SequenceLoader): """ Updating previously loaded clips """ version_entity = context["version"] - repre_doc = context["representation"] + repre_entity = context["representation"] # load clip to timeline and get main variables name = container["name"] @@ -162,7 +162,8 @@ class LoadClip(phiero.SequenceLoader): version_name = version_entity["version"] colorspace = version_attributes.get("colorSpace") object_name = "{}_{}".format(name, namespace) - file = get_representation_path(repre_doc).replace("\\", "/") + + file = get_representation_path(repre_entity).replace("\\", "/") clip = track_item.source() # reconnect media to new path @@ -191,7 +192,7 @@ class LoadClip(phiero.SequenceLoader): # add variables related to version context data_imprint.update({ - "representation": str(repre_doc["_id"]), + "representation": repre_entity["id"], "version": version_name, "colorspace": colorspace, "objectName": object_name diff --git a/client/ayon_core/hosts/hiero/plugins/load/load_effects.py b/client/ayon_core/hosts/hiero/plugins/load/load_effects.py index 90666406fd..521a7c4494 100644 --- a/client/ayon_core/hosts/hiero/plugins/load/load_effects.py +++ b/client/ayon_core/hosts/hiero/plugins/load/load_effects.py @@ -156,9 +156,9 @@ class LoadEffects(load.LoaderPlugin): """ Updating previously loaded effects """ version_entity = context["version"] - repre_doc = context["representation"] + repre_entity = context["representation"] active_track = container["_item"] - file = get_representation_path(repre_doc).replace("\\", "/") + file = get_representation_path(repre_entity).replace("\\", "/") # get main variables name = container['name'] @@ -192,7 +192,7 @@ class LoadEffects(load.LoaderPlugin): data_imprint = { "objectName": object_name, "name": name, - "representation": str(repre_doc["_id"]), + "representation": repre_entity["id"], "children_names": [] } @@ -293,7 +293,7 @@ class LoadEffects(load.LoaderPlugin): "name": str(name), "namespace": str(namespace), "loader": str(loader), - "representation": str(context["representation"]["_id"]), + "representation": context["representation"]["id"], } }