hiero use representation entity

This commit is contained in:
Jakub Trllo 2024-03-08 12:38:46 +01:00
parent 67572d56c0
commit ff20964dc0
4 changed files with 10 additions and 9 deletions

View file

@ -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:

View file

@ -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

View file

@ -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

View file

@ -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"],
}
}