mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-25 21:32:15 +01:00
implemented get_representation_parents for single representation
This commit is contained in:
parent
7109d932ec
commit
9829410932
2 changed files with 11 additions and 0 deletions
|
|
@ -22,6 +22,7 @@ from .entities import (
|
|||
get_representation,
|
||||
get_representation_by_name,
|
||||
get_representations,
|
||||
get_representation_parents,
|
||||
get_representations_parents,
|
||||
|
||||
get_thumbnail,
|
||||
|
|
@ -52,6 +53,7 @@ __all__ = (
|
|||
"get_representation",
|
||||
"get_representation_by_name",
|
||||
"get_representations",
|
||||
"get_representation_parents",
|
||||
"get_representations_parents",
|
||||
|
||||
"get_thubmnail",
|
||||
|
|
|
|||
|
|
@ -641,6 +641,15 @@ def get_representations_parents(project_name, representations):
|
|||
return output
|
||||
|
||||
|
||||
def get_representation_parents(project_name, representation):
|
||||
if not representation:
|
||||
return None
|
||||
|
||||
repre_id = representation["_id"]
|
||||
parents_by_repre_id = get_representations(project_name, [representation])
|
||||
return parents_by_repre_id.get(repre_id)
|
||||
|
||||
|
||||
def get_thumbnail_id_from_source(project_name, src_type, src_id):
|
||||
if not src_type or not src_id:
|
||||
return None
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue