mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-25 05:14:40 +01:00
Get both json and ma representation with one query
This commit is contained in:
parent
fe6990a647
commit
7375587c87
1 changed files with 8 additions and 5 deletions
|
|
@ -1897,12 +1897,15 @@ def assign_look_by_version(nodes, version_id):
|
|||
project_name = get_current_project_name()
|
||||
|
||||
# Get representations of shader file and relationships
|
||||
look_representation = ayon_api.get_representation_by_name(
|
||||
project_name, "ma", version_id
|
||||
)
|
||||
json_representation = ayon_api.get_representation_by_name(
|
||||
project_name, "json", version_id
|
||||
representations = ayon_api.get_representations(
|
||||
project_name=project_name,
|
||||
representation_names={"ma", "json"},
|
||||
version_ids=[version_id]
|
||||
)
|
||||
look_representation = next(
|
||||
repre for repre in representations if repre["name"] == "ma")
|
||||
json_representation = next(
|
||||
repre for repre in representations if repre["name"] == "json")
|
||||
|
||||
# See if representation is already loaded, if so reuse it.
|
||||
host = registered_host()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue