From c5ab3e5ebbbdb4c19fc96df6f2fa9f38550cf769 Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Tue, 30 Mar 2021 15:47:20 +0200 Subject: [PATCH] Global: Fix if None in `entity.data.tasks` then they should be dict and not list as it was before --- pype/plugins/publish/extract_hierarchy_avalon.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/pype/plugins/publish/extract_hierarchy_avalon.py b/pype/plugins/publish/extract_hierarchy_avalon.py index 74751c6807..5643f04a76 100644 --- a/pype/plugins/publish/extract_hierarchy_avalon.py +++ b/pype/plugins/publish/extract_hierarchy_avalon.py @@ -99,13 +99,20 @@ class ExtractHierarchyToAvalon(pyblish.api.ContextPlugin): if entity: # Do not override data, only update cur_entity_data = entity.get("data") or {} + entity_tasks = cur_entity_data["tasks"] or {} + + # create tasks as dict by default + if not entity_tasks: + cur_entity_data["tasks"] = entity_tasks + new_tasks = data.pop("tasks", {}) if "tasks" not in cur_entity_data and not new_tasks: continue for task_name in new_tasks: - if task_name in cur_entity_data["tasks"].keys(): + if task_name in entity_tasks.keys(): continue - cur_entity_data["tasks"][task_name] = new_tasks[task_name] + cur_entity_data["tasks"][task_name] = new_tasks[ + task_name] cur_entity_data.update(data) data = cur_entity_data else: