mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-25 05:14:40 +01:00
Merge pull request #3636 from Tilix4/fx_kitsu_movie_fails_and_first_loop_name
Kitsu|Fix: Movie project type fails & first loop children names
This commit is contained in:
commit
422b159d1c
1 changed files with 9 additions and 4 deletions
|
|
@ -219,18 +219,23 @@ def update_op_assets(
|
|||
|
||||
# Add parents for hierarchy
|
||||
item_data["parents"] = []
|
||||
while parent_zou_id is not None:
|
||||
parent_doc = asset_doc_ids[parent_zou_id]
|
||||
ancestor_id = parent_zou_id
|
||||
while ancestor_id is not None:
|
||||
parent_doc = asset_doc_ids[ancestor_id]
|
||||
item_data["parents"].insert(0, parent_doc["name"])
|
||||
|
||||
# Get parent entity
|
||||
parent_entity = parent_doc["data"]["zou"]
|
||||
parent_zou_id = parent_entity.get("parent_id")
|
||||
ancestor_id = parent_entity.get("parent_id")
|
||||
|
||||
if item_type in ["Shot", "Sequence"]:
|
||||
# Build OpenPype compatible name
|
||||
if item_type in ["Shot", "Sequence"] and parent_zou_id is not None:
|
||||
# Name with parents hierarchy "({episode}_){sequence}_{shot}"
|
||||
# to avoid duplicate name issue
|
||||
item_name = f"{item_data['parents'][-1]}_{item['name']}"
|
||||
|
||||
# Update doc name
|
||||
asset_doc_ids[item["id"]]["name"] = item_name
|
||||
else:
|
||||
item_name = item["name"]
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue