mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 16:34:53 +01:00
Split up the difference in name and type Assets/Shots generate
Before it was only working for shots. Now it also works for Assets. I'm ding an elif as Kitsu now also have tasks for sequences, edits and other things. Will try and add those in at a later stage.
This commit is contained in:
parent
d9ac1ee952
commit
d153e6c224
1 changed files with 21 additions and 3 deletions
|
|
@ -500,9 +500,15 @@ class Listener:
|
|||
|
||||
parent_name = None
|
||||
entity_type = None
|
||||
parent_name = episode['name'] + "_"
|
||||
parent_name = parent_name + \
|
||||
task['sequence']['name'] + "_" + task['entity']['name']
|
||||
if task["task_type"]["for_entity"] == "Asset":
|
||||
parent_name = task["entity"]["name"]
|
||||
entity_type = task["entity_type"]["name"]
|
||||
elif task["task_type"]["for_entity"] == "Shot":
|
||||
parent_name = "{ep_name}{sequence_name} - {shot_name}".format(
|
||||
ep_name=ep["name"] + " - " if ep is not None else "",
|
||||
sequence_name=task["sequence"]["name"],
|
||||
shot_name=task["entity"]["name"]
|
||||
)
|
||||
|
||||
# Update asset tasks with new one
|
||||
asset_doc = get_asset_by_name(project_name, parent_name)
|
||||
|
|
@ -558,6 +564,18 @@ class Listener:
|
|||
if ep_id and ep_id != "":
|
||||
ep = gazu.asset.get_episode(ep_id)
|
||||
|
||||
parent_name = None
|
||||
entity_type = None
|
||||
if task["task_type"]["for_entity"] == "Asset":
|
||||
parent_name = task["entity"]["name"]
|
||||
entity_type = task["entity_type"]["name"]
|
||||
elif task["task_type"]["for_entity"] == "Shot":
|
||||
parent_name = "{ep_name}{sequence_name} - {shot_name}".format(
|
||||
ep_name=ep["name"] + " - " if ep is not None else "",
|
||||
sequence_name=task["sequence"]["name"],
|
||||
shot_name=task["entity"]["name"]
|
||||
)
|
||||
|
||||
msg = "Task deleted: {proj_name} - {entity_type}{parent_name}" \
|
||||
" - {task_name}".format(
|
||||
proj_name=task["zou"]["project"]["name"],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue