diff --git a/pype/plugins/ftrack/publish/integrate_hierarchy_ftrack.py b/pype/plugins/ftrack/publish/integrate_hierarchy_ftrack.py index 2ee0898711..e4496138bb 100644 --- a/pype/plugins/ftrack/publish/integrate_hierarchy_ftrack.py +++ b/pype/plugins/ftrack/publish/integrate_hierarchy_ftrack.py @@ -142,11 +142,10 @@ class IntegrateHierarchyToFtrack(pyblish.api.ContextPlugin): existing_tasks.append(child['name'].lower()) # existing_tasks.append(child['type']['name']) - for task in tasks: - task_name = next(iter(task)) - task_type = task[task_name]["type"] + for task_name in tasks: + task_type = tasks[task_name]["type"] if task_name.lower() in existing_tasks: - print("Task {} already exists".format(task)) + print("Task {} already exists".format(task_name)) continue tasks_to_create.append((task_name, task_type)) diff --git a/pype/plugins/global/publish/extract_hierarchy_avalon.py b/pype/plugins/global/publish/extract_hierarchy_avalon.py index 64df672709..72cd935c2d 100644 --- a/pype/plugins/global/publish/extract_hierarchy_avalon.py +++ b/pype/plugins/global/publish/extract_hierarchy_avalon.py @@ -102,11 +102,11 @@ class ExtractHierarchyToAvalon(pyblish.api.ContextPlugin): new_tasks = data.pop("tasks", {}) if "tasks" not in cur_entity_data and not new_tasks: continue - for task in new_tasks: + for task_name in new_tasks: task_name = next(iter(task)) if task_name in cur_entity_data["tasks"].keys(): continue - cur_entity_data["tasks"][task_name] = task[task_name] + cur_entity_data["tasks"][task_name] = new_tasks[task_name] cur_entity_data.update(data) data = cur_entity_data else: diff --git a/pype/plugins/hiero/publish/collect_shots.py b/pype/plugins/hiero/publish/collect_shots.py index 6f83e08fbe..ed658a19a9 100644 --- a/pype/plugins/hiero/publish/collect_shots.py +++ b/pype/plugins/hiero/publish/collect_shots.py @@ -43,7 +43,7 @@ class CollectShots(api.InstancePlugin): "{} - {} - tasks:{} - assetbuilds:{} - comments:{}".format( data["asset"], data["subset"], - [task.keys()[0] for task in data["tasks"]], + [task for task in data["tasks"]], [x["name"] for x in data.get("assetbuilds", [])], len(data.get("comments", [])) ) diff --git a/pype/plugins/hiero/publish/collect_tag_tasks.py b/pype/plugins/hiero/publish/collect_tag_tasks.py index dbcf5e5260..ae4578bbf7 100644 --- a/pype/plugins/hiero/publish/collect_tag_tasks.py +++ b/pype/plugins/hiero/publish/collect_tag_tasks.py @@ -13,7 +13,7 @@ class CollectClipTagTasks(api.InstancePlugin): # gets tags tags = instance.data["tags"] - tasks = list() + tasks = dict() for t in tags: t_metadata = dict(t["metadata"]) t_family = t_metadata.get("tag.family", "") @@ -22,7 +22,7 @@ class CollectClipTagTasks(api.InstancePlugin): if "task" in t_family: t_task_name = t_metadata.get("tag.label", "") t_task_type = t_metadata.get("tag.type", "") - tasks.append({t_task_name: {"type": t_task_type}}) + tasks[t_task_name] = {"type": t_task_type} instance.data["tasks"] = tasks