Skip to content
This repository has been archived by the owner on Oct 10, 2024. It is now read-only.

Commit

Permalink
store layer ids to "members" keys instead of "objectName"
Browse files Browse the repository at this point in the history
  • Loading branch information
iLLiCiTiT committed Dec 2, 2020
1 parent 64fa6c6 commit 62d5bf7
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions avalon/tvpaint/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,11 @@ def containerise(
Returns:
dict: Container data stored to workfile metadata.
"""
# Convert ids to string
layer_ids = [str(layer_id) for layer_id in layer_ids]
object_name = "|".join(layer_ids)

container_data = {
"schema": "avalon-core:container-2.0",
"id": AVALON_CONTAINER_ID,
"objectName": object_name,
"members": layer_ids,
"name": name,
"namespace": namespace,
"loader": str(loader),
Expand Down Expand Up @@ -257,9 +254,13 @@ class Loader(api.Loader):

@staticmethod
def layer_ids_from_container(container):
layer_ids_str = container["objectName"]
layer_ids = [int(layer_id) for layer_id in layer_ids_str.split("|")]
return layer_ids
if "members" not in container and "objectName" in container:
# Backwards compatibility
layer_ids_str = container.get("objectName")
return [
int(layer_id) for layer_id in layer_ids_str.split("|")
]
return container["members"]

def get_unique_layer_name(self, asset_name, name):
"""Layer name with counter as suffix.
Expand Down

0 comments on commit 62d5bf7

Please sign in to comment.