From 6f27fbdcbc960fe47a213b0cd1c506c06a96e7fc Mon Sep 17 00:00:00 2001 From: Petr Kalis Date: Tue, 15 Sep 2020 11:35:53 +0200 Subject: [PATCH 1/9] #180 - Enrich tasks with additional information Tasks in project config or on assets were stored only as names. This changes them into dictionaries to enhance information that could be stored and used elsewhere later. --- pype/modules/ftrack/lib/avalon_sync.py | 41 ++++++++++++++++++++++---- 1 file changed, 35 insertions(+), 6 deletions(-) diff --git a/pype/modules/ftrack/lib/avalon_sync.py b/pype/modules/ftrack/lib/avalon_sync.py index 65a59452da4..7dd4056524b 100644 --- a/pype/modules/ftrack/lib/avalon_sync.py +++ b/pype/modules/ftrack/lib/avalon_sync.py @@ -16,6 +16,7 @@ from bson.errors import InvalidId from pymongo import UpdateOne import ftrack_api +from pype.api import config log = Logger().get_logger(__name__) @@ -238,6 +239,27 @@ def get_hierarchical_attributes(session, entity, attr_names, attr_defaults={}): return hier_values +def get_task_short_name(task_type): + """ + Returns short name (code) for 'task_type'. Short name stored in + metadata dictionary in project.config per each 'task_type'. + Could be used in anatomy, paths etc. + If no appropriate short name is found in mapping, 'task_type' is + returned back unchanged. + + Currently stores data in: + 'pype-config/presets/ftrack/project_defaults.json' + Args: + task_type: (string) - Animation | Modeling ... + + Returns: + (string) - anim | model ... + """ + presets = config.get_presets()['ftrack']['project_defaults']\ + .get("task_short_names") + + return presets.get(task_type, task_type) + class SyncEntitiesFactory: dbcon = AvalonMongoDB() @@ -389,7 +411,9 @@ def launch_setup(self, project_full_name): continue elif entity_type_low == "task": - entities_dict[parent_id]["tasks"].append(entity["name"]) + # enrich task info with additional metadata + task = {"name": entity["name"], "type": entity["type"]["name"]} + entities_dict[parent_id]["tasks"].append(task) continue entity_id = entity["id"] @@ -534,8 +558,9 @@ def duplicity_regex_check(self): name = entity_dict["name"] entity_type = entity_dict["entity_type"] # Tasks must be checked too - for task_name in entity_dict["tasks"]: - passed = task_names.get(task_name) + for task in entity_dict["tasks"]: + task_name = task.get("name") + passed = task_name if passed is None: passed = check_regex( task_name, "task", schema_patterns=_schema_patterns @@ -1014,9 +1039,14 @@ def prepare_ftrack_ent_data(self): if not msg or not items: continue self.report_items["warning"][msg] = items - + tasks = [] + for tt in task_types: + tasks.append({ + "name": tt["name"], + "short_name": get_task_short_name(tt["name"]) + }) self.entities_dict[id]["final_entity"]["config"] = { - "tasks": [{"name": tt["name"]} for tt in task_types], + "tasks": tasks, "apps": proj_apps } continue @@ -1904,7 +1934,6 @@ def update_entities(self): filter = {"_id": ObjectId(mongo_id)} change_data = from_dict_to_set(changes) mongo_changes_bulk.append(UpdateOne(filter, change_data)) - if not mongo_changes_bulk: # TODO LOG return From 998c5383eea87b0eac203bd34504006e5b3508b3 Mon Sep 17 00:00:00 2001 From: Petr Kalis Date: Tue, 15 Sep 2020 14:39:39 +0200 Subject: [PATCH 2/9] Refactor - added a couple of docstrings --- pype/modules/ftrack/lib/avalon_sync.py | 98 ++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) diff --git a/pype/modules/ftrack/lib/avalon_sync.py b/pype/modules/ftrack/lib/avalon_sync.py index 7dd4056524b..e2dfdde0aa3 100644 --- a/pype/modules/ftrack/lib/avalon_sync.py +++ b/pype/modules/ftrack/lib/avalon_sync.py @@ -104,6 +104,14 @@ def get_pype_attr(session, split_hierarchical=True): def from_dict_to_set(data): + """ + Converts 'data' into $set part of MongoDB update command. + Args: + data: (dictionary) - up-to-date data from Ftrack + + Returns: + (dictionary) - { "$set" : "{..}"} + """ result = {"$set": {}} dict_queue = queue.Queue() dict_queue.put((None, data)) @@ -124,6 +132,8 @@ def from_dict_to_set(data): def get_avalon_project_template(project_name): """Get avalon template + Args: + project_name: (string) Returns: dictionary with templates """ @@ -136,6 +146,16 @@ def get_avalon_project_template(project_name): def get_project_apps(in_app_list): + """ + Returns metadata information about apps in 'in_app_list' enhanced + from toml files. + Args: + in_app_list: (list) - names of applications + + Returns: + tuple (list, dictionary) - list of dictionaries about apps + dictionary of warnings + """ apps = [] # TODO report missing_toml_msg = "Missing config file for application" @@ -440,6 +460,13 @@ def launch_setup(self, project_full_name): @property def avalon_ents_by_id(self): + """ + Returns dictionary of avalon tracked entities (assets stored in + MongoDB) accessible by its '_id' + (mongo intenal ID - example ObjectId("5f48de5830a9467b34b69798")) + Returns: + (dictionary) - {"(_id)": whole entity asset} + """ if self._avalon_ents_by_id is None: self._avalon_ents_by_id = {} for entity in self.avalon_entities: @@ -449,6 +476,14 @@ def avalon_ents_by_id(self): @property def avalon_ents_by_ftrack_id(self): + """ + Returns dictionary of Mongo ids of avalon tracked entities + (assets stored in MongoDB) accessible by its 'ftrackId' + (id from ftrack) + (example '431ee3f2-e91a-11ea-bfa4-92591a5b5e3e') + Returns: + (dictionary) - {"(ftrackId)": "_id"} + """ if self._avalon_ents_by_ftrack_id is None: self._avalon_ents_by_ftrack_id = {} for entity in self.avalon_entities: @@ -461,6 +496,13 @@ def avalon_ents_by_ftrack_id(self): @property def avalon_ents_by_name(self): + """ + Returns dictionary of Mongo ids of avalon tracked entities + (assets stored in MongoDB) accessible by its 'name' + (example 'Hero') + Returns: + (dictionary) - {"(name)": "_id"} + """ if self._avalon_ents_by_name is None: self._avalon_ents_by_name = {} for entity in self.avalon_entities: @@ -470,6 +512,15 @@ def avalon_ents_by_name(self): @property def avalon_ents_by_parent_id(self): + """ + Returns dictionary of avalon tracked entities + (assets stored in MongoDB) accessible by its 'visualParent' + (example ObjectId("5f48de5830a9467b34b69798")) + + Fills 'self._avalon_archived_ents' for performance + Returns: + (dictionary) - {"(_id)": whole entity} + """ if self._avalon_ents_by_parent_id is None: self._avalon_ents_by_parent_id = collections.defaultdict(list) for entity in self.avalon_entities: @@ -482,6 +533,14 @@ def avalon_ents_by_parent_id(self): @property def avalon_archived_ents(self): + """ + Returns list of archived assets from DB + (their "type" == 'archived_asset') + + Fills 'self._avalon_archived_ents' for performance + Returns: + (list) of assets + """ if self._avalon_archived_ents is None: self._avalon_archived_ents = [ ent for ent in self.dbcon.find({"type": "archived_asset"}) @@ -490,6 +549,14 @@ def avalon_archived_ents(self): @property def avalon_archived_by_name(self): + """ + Returns list of archived assets from DB + (their "type" == 'archived_asset') + + Fills 'self._avalon_archived_by_name' for performance + Returns: + (dictionary of lists) of assets accessible by asset name + """ if self._avalon_archived_by_name is None: self._avalon_archived_by_name = collections.defaultdict(list) for ent in self.avalon_archived_ents: @@ -498,6 +565,14 @@ def avalon_archived_by_name(self): @property def avalon_archived_by_id(self): + """ + Returns dictionary of archived assets from DB + (their "type" == 'archived_asset') + + Fills 'self._avalon_archived_by_id' for performance + Returns: + (dictionary) of assets accessible by asset mongo _id + """ if self._avalon_archived_by_id is None: self._avalon_archived_by_id = { str(ent["_id"]): ent for ent in self.avalon_archived_ents @@ -506,6 +581,15 @@ def avalon_archived_by_id(self): @property def avalon_archived_by_parent_id(self): + """ + Returns dictionary of archived assets from DB per their's parent + (their "type" == 'archived_asset') + + Fills 'self._avalon_archived_by_parent_id' for performance + Returns: + (dictionary of lists) of assets accessible by asset parent + mongo _id + """ if self._avalon_archived_by_parent_id is None: self._avalon_archived_by_parent_id = collections.defaultdict(list) for entity in self.avalon_archived_ents: @@ -518,6 +602,14 @@ def avalon_archived_by_parent_id(self): @property def subsets_by_parent_id(self): + """ + Returns dictionary of subsets from Mongo ("type": "subset") + grouped by their parent. + + Fills 'self._subsets_by_parent_id' for performance + Returns: + (dictionary of lists) + """ if self._subsets_by_parent_id is None: self._subsets_by_parent_id = collections.defaultdict(list) for subset in self.dbcon.find({"type": "subset"}): @@ -539,6 +631,11 @@ def changeability_by_mongo_id(self): @property def all_ftrack_names(self): + """ + Returns lists of names of all entities in Ftrack + Returns: + (list) + """ return [ ent_dict["name"] for ent_dict in self.entities_dict.values() if ( ent_dict.get("name") @@ -1937,6 +2034,7 @@ def update_entities(self): if not mongo_changes_bulk: # TODO LOG return + log.debug("mongo_changes_bulk:: {}".format(mongo_changes_bulk)) self.dbcon.bulk_write(mongo_changes_bulk) def reload_parents(self, hierarchy_changing_ids): From a135517dcfefc213473925510a60c5d71f60230f Mon Sep 17 00:00:00 2001 From: Petr Kalis Date: Tue, 15 Sep 2020 15:03:27 +0200 Subject: [PATCH 3/9] Hound --- pype/modules/ftrack/lib/avalon_sync.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pype/modules/ftrack/lib/avalon_sync.py b/pype/modules/ftrack/lib/avalon_sync.py index e2dfdde0aa3..e8d5ef00930 100644 --- a/pype/modules/ftrack/lib/avalon_sync.py +++ b/pype/modules/ftrack/lib/avalon_sync.py @@ -259,6 +259,7 @@ def get_hierarchical_attributes(session, entity, attr_names, attr_defaults={}): return hier_values + def get_task_short_name(task_type): """ Returns short name (code) for 'task_type'. Short name stored in @@ -1138,10 +1139,9 @@ def prepare_ftrack_ent_data(self): self.report_items["warning"][msg] = items tasks = [] for tt in task_types: - tasks.append({ - "name": tt["name"], - "short_name": get_task_short_name(tt["name"]) - }) + tasks.append({"name": tt["name"], + "short_name": get_task_short_name(tt["name"]) + }) self.entities_dict[id]["final_entity"]["config"] = { "tasks": tasks, "apps": proj_apps From fec340f5ba5bea5864a95e65ec2c525bcf4c16d0 Mon Sep 17 00:00:00 2001 From: Petr Kalis Date: Fri, 25 Sep 2020 11:20:32 +0200 Subject: [PATCH 4/9] #180 - Changed tasks to dictionaries Changed both for config ("tasks":{TYPE: {"short_name":""}}) and assets ("tasks": {"TASK_NAME": {"type":config.tasks.TYPE}}) --- pype/modules/ftrack/lib/avalon_sync.py | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/pype/modules/ftrack/lib/avalon_sync.py b/pype/modules/ftrack/lib/avalon_sync.py index e8d5ef00930..68b54f94565 100644 --- a/pype/modules/ftrack/lib/avalon_sync.py +++ b/pype/modules/ftrack/lib/avalon_sync.py @@ -24,9 +24,9 @@ # Current schemas for avalon types EntitySchemas = { - "project": "avalon-core:project-2.0", + "project": "avalon-core:project-2.1", "asset": "avalon-core:asset-3.0", - "config": "avalon-core:config-1.0" + "config": "avalon-core:config-1.1" } # Group name of custom attributes @@ -123,7 +123,8 @@ def from_dict_to_set(data): if _key is not None: new_key = "{}.{}".format(_key, key) - if not isinstance(value, dict): + if not isinstance(value, dict) or \ + (isinstance(value, dict) and not bool(value)): # empty dic result["$set"][new_key] = value continue dict_queue.put((new_key, value)) @@ -421,7 +422,7 @@ def launch_setup(self, project_full_name): "custom_attributes": {}, "hier_attrs": {}, "avalon_attrs": {}, - "tasks": [] + "tasks": {} }) for entity in all_project_entities: @@ -433,8 +434,8 @@ def launch_setup(self, project_full_name): elif entity_type_low == "task": # enrich task info with additional metadata - task = {"name": entity["name"], "type": entity["type"]["name"]} - entities_dict[parent_id]["tasks"].append(task) + task = {"type": entity["type"]["name"]} + entities_dict[parent_id]["tasks"][entity["name"]] = task continue entity_id = entity["id"] @@ -656,8 +657,8 @@ def duplicity_regex_check(self): name = entity_dict["name"] entity_type = entity_dict["entity_type"] # Tasks must be checked too - for task in entity_dict["tasks"]: - task_name = task.get("name") + for task in entity_dict["tasks"].items(): + task_name, task = task passed = task_name if passed is None: passed = check_regex( @@ -1137,11 +1138,11 @@ def prepare_ftrack_ent_data(self): if not msg or not items: continue self.report_items["warning"][msg] = items - tasks = [] + tasks = {} for tt in task_types: - tasks.append({"name": tt["name"], + tasks[tt["name"]] = { "short_name": get_task_short_name(tt["name"]) - }) + } self.entities_dict[id]["final_entity"]["config"] = { "tasks": tasks, "apps": proj_apps @@ -1156,7 +1157,7 @@ def prepare_ftrack_ent_data(self): data["parents"] = parents data["hierarchy"] = hierarchy - data["tasks"] = self.entities_dict[id].pop("tasks", []) + data["tasks"] = self.entities_dict[id].pop("tasks", {}) self.entities_dict[id]["final_entity"]["data"] = data self.entities_dict[id]["final_entity"]["type"] = "asset" From f8e558ca42d9a7e758535d7b7a2162788a68801f Mon Sep 17 00:00:00 2001 From: Petr Kalis Date: Fri, 25 Sep 2020 12:24:02 +0200 Subject: [PATCH 5/9] #180 - Changed tasks to dictionaries Modifications based on change --- pype/hosts/nukestudio/tags.py | 4 ++-- .../clockify/launcher_actions/ClockifySync.py | 2 +- .../global/publish/extract_hierarchy_avalon.py | 12 +++++++----- pype/plugins/maya/publish/collect_yeti_cache.py | 2 +- pype/plugins/nukestudio/publish/collect_shots.py | 2 +- 5 files changed, 12 insertions(+), 10 deletions(-) diff --git a/pype/hosts/nukestudio/tags.py b/pype/hosts/nukestudio/tags.py index c2b1d0d728e..36edb16da66 100644 --- a/pype/hosts/nukestudio/tags.py +++ b/pype/hosts/nukestudio/tags.py @@ -71,8 +71,8 @@ def add_tags_from_presets(): # Get project task types. tasks = io.find_one({"type": "project"})["config"]["tasks"] nks_pres_tags["[Tasks]"] = {} - for task in tasks: - nks_pres_tags["[Tasks]"][task["name"]] = { + for task_name, _ in tasks.items(): + nks_pres_tags["[Tasks]"][task_name] = { "editable": "1", "note": "", "icon": { diff --git a/pype/modules/clockify/launcher_actions/ClockifySync.py b/pype/modules/clockify/launcher_actions/ClockifySync.py index a77c0380766..422a3460236 100644 --- a/pype/modules/clockify/launcher_actions/ClockifySync.py +++ b/pype/modules/clockify/launcher_actions/ClockifySync.py @@ -30,7 +30,7 @@ def process(self, session, **kwargs): projects_info = {} for project in projects_to_sync: - task_types = [task['name'] for task in project['config']['tasks']] + task_types = project['config']['tasks'].keys() projects_info[project['name']] = task_types clockify_projects = self.clockapi.get_projects() diff --git a/pype/plugins/global/publish/extract_hierarchy_avalon.py b/pype/plugins/global/publish/extract_hierarchy_avalon.py index 1d8191f2e3d..b43678ff6c9 100644 --- a/pype/plugins/global/publish/extract_hierarchy_avalon.py +++ b/pype/plugins/global/publish/extract_hierarchy_avalon.py @@ -38,7 +38,7 @@ def import_to_avalon(self, input_data, parent=None): data["inputs"] = entity_data.get("inputs", []) # Tasks. - tasks = entity_data.get("tasks", []) + tasks = entity_data.get("tasks", {}) if tasks is not None or len(tasks) > 0: data["tasks"] = tasks parents = [] @@ -78,11 +78,13 @@ def import_to_avalon(self, input_data, parent=None): if entity: # Do not override data, only update cur_entity_data = entity.get("data") or {} - new_tasks = data.pop("tasks", []) + new_tasks = data.pop("tasks", {}) if "tasks" in cur_entity_data and new_tasks: - for task_name in new_tasks: - if task_name not in cur_entity_data["tasks"]: - cur_entity_data["tasks"].append(task_name) + for task_name in new_tasks.keys(): + if task_name \ + not in cur_entity_data["tasks"].keys(): + 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/maya/publish/collect_yeti_cache.py b/pype/plugins/maya/publish/collect_yeti_cache.py index 4af3e1ea18c..e24517951be 100644 --- a/pype/plugins/maya/publish/collect_yeti_cache.py +++ b/pype/plugins/maya/publish/collect_yeti_cache.py @@ -30,7 +30,7 @@ class CollectYetiCache(pyblish.api.InstancePlugin): label = "Collect Yeti Cache" families = ["yetiRig", "yeticache"] hosts = ["maya"] - tasks = ["animation", "fx"] + tasks = {"animation": {"type": "Animation"}, "fx": {"type": "FX"}} def process(self, instance): diff --git a/pype/plugins/nukestudio/publish/collect_shots.py b/pype/plugins/nukestudio/publish/collect_shots.py index 455e25bf82d..42b1ea160d8 100644 --- a/pype/plugins/nukestudio/publish/collect_shots.py +++ b/pype/plugins/nukestudio/publish/collect_shots.py @@ -43,7 +43,7 @@ def process(self, instance): "{} - {} - tasks:{} - assetbuilds:{}".format( data["asset"], data["subset"], - data["tasks"], + data["tasks"].keys(), [x["name"] for x in data.get("assetbuilds", [])] ) ) From c615e7972803300d761e90ee81bf4a5b211e0783 Mon Sep 17 00:00:00 2001 From: Petr Kalis Date: Fri, 25 Sep 2020 12:46:05 +0200 Subject: [PATCH 6/9] #180 - Changed tasks to dictionaries Modifications based on change --- pype/modules/ftrack/lib/avalon_sync.py | 2 +- schema/config-1.1.json | 83 +++++++++++++++++++++++++ schema/inventory-1.1.json | 10 +++ schema/project-2.1.json | 86 ++++++++++++++++++++++++++ 4 files changed, 180 insertions(+), 1 deletion(-) create mode 100644 schema/config-1.1.json create mode 100644 schema/inventory-1.1.json create mode 100644 schema/project-2.1.json diff --git a/pype/modules/ftrack/lib/avalon_sync.py b/pype/modules/ftrack/lib/avalon_sync.py index 68b54f94565..5a5d4897144 100644 --- a/pype/modules/ftrack/lib/avalon_sync.py +++ b/pype/modules/ftrack/lib/avalon_sync.py @@ -51,7 +51,7 @@ def check_regex(name, entity_type, in_schema=None, schema_patterns=None): if in_schema: schema_name = in_schema elif entity_type == "project": - schema_name = "project-2.0" + schema_name = "project-2.1" elif entity_type == "task": schema_name = "task" diff --git a/schema/config-1.1.json b/schema/config-1.1.json new file mode 100644 index 00000000000..5f4fe4b2fb1 --- /dev/null +++ b/schema/config-1.1.json @@ -0,0 +1,83 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + + "title": "avalon-core:config-1.1", + "description": "A project configuration.", + + "type": "object", + + "additionalProperties": false, + "required": [ + "template", + "tasks", + "apps" + ], + + "properties": { + "schema": { + "description": "Schema identifier for payload", + "type": "string" + }, + "template": { + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^.*$": { + "type": "string" + } + } + }, + "tasks": { + "type": "object", + "properties": { + "short_name": {"type": "string"}, + "icon": {"type": "string"}, + "group": {"type": "string"}, + "label": {"type": "string"} + }, + "required": ["short_name"] + }, + "apps": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": {"type": "string"}, + "icon": {"type": "string"}, + "group": {"type": "string"}, + "label": {"type": "string"} + }, + "required": ["name"] + } + }, + "families": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": {"type": "string"}, + "icon": {"type": "string"}, + "label": {"type": "string"}, + "hideFilter": {"type": "boolean"} + }, + "required": ["name"] + } + }, + "groups": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": {"type": "string"}, + "icon": {"type": "string"}, + "color": {"type": "string"}, + "order": {"type": ["integer", "number"]} + }, + "required": ["name"] + } + }, + "copy": { + "type": "object" + } + } +} diff --git a/schema/inventory-1.1.json b/schema/inventory-1.1.json new file mode 100644 index 00000000000..f46df6973dd --- /dev/null +++ b/schema/inventory-1.1.json @@ -0,0 +1,10 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + + "title": "avalon-core:config-1.1", + "description": "A project configuration.", + + "type": "object", + + "additionalProperties": true +} diff --git a/schema/project-2.1.json b/schema/project-2.1.json new file mode 100644 index 00000000000..22327b2f06d --- /dev/null +++ b/schema/project-2.1.json @@ -0,0 +1,86 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + + "title": "avalon-core:project-2.1", + "description": "A unit of data", + + "type": "object", + + "additionalProperties": true, + + "required": [ + "schema", + "type", + "name", + "data", + "config" + ], + + "properties": { + "schema": { + "description": "Schema identifier for payload", + "type": "string", + "enum": ["avalon-core:project-2.1"], + "example": "avalon-core:project-2.1" + }, + "type": { + "description": "The type of document", + "type": "string", + "enum": ["project"], + "example": "project" + }, + "parent": { + "description": "Unique identifier to parent document", + "example": "592c33475f8c1b064c4d1696" + }, + "name": { + "description": "Name of directory", + "type": "string", + "pattern": "^[a-zA-Z0-9_.]*$", + "example": "hulk" + }, + "data": { + "description": "Document metadata", + "type": "object", + "example": { + "fps": 24, + "width": 1920, + "height": 1080 + } + }, + "config": { + "type": "object", + "description": "Document metadata", + "example": { + "schema": "avalon-core:config-1.1", + "apps": [ + { + "name": "maya2016", + "label": "Autodesk Maya 2016" + }, + { + "name": "nuke10", + "label": "The Foundry Nuke 10.0" + } + ], + "tasks": { + "Model": {"short_name": "mdl"}, + "Render": {"short_name": "rnd"}, + "Animate": {"short_name": "anim"}, + "Rig": {"short_name": "rig"}, + "Lookdev": {"short_name": "look"}, + "Layout": {"short_name": "lay"} + }, + "template": { + "work": + "{root}/{project}/{silo}/{asset}/work/{task}/{app}", + "publish": + "{root}/{project}/{silo}/{asset}/publish/{subset}/v{version:0>3}/{subset}.{representation}" + } + }, + "$ref": "config-1.1.json" + } + }, + + "definitions": {} +} From 62888dc38793d74a0c3ce8a39b9b478178e07c5e Mon Sep 17 00:00:00 2001 From: Petr Kalis Date: Fri, 25 Sep 2020 12:54:57 +0200 Subject: [PATCH 7/9] Hound --- pype/modules/ftrack/lib/avalon_sync.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pype/modules/ftrack/lib/avalon_sync.py b/pype/modules/ftrack/lib/avalon_sync.py index 5a5d4897144..40b14a02a88 100644 --- a/pype/modules/ftrack/lib/avalon_sync.py +++ b/pype/modules/ftrack/lib/avalon_sync.py @@ -1141,8 +1141,8 @@ def prepare_ftrack_ent_data(self): tasks = {} for tt in task_types: tasks[tt["name"]] = { - "short_name": get_task_short_name(tt["name"]) - } + "short_name": get_task_short_name(tt["name"]) + } self.entities_dict[id]["final_entity"]["config"] = { "tasks": tasks, "apps": proj_apps From 268a4aaa29f18f4ef15ee6cc7e060b4df21b34df Mon Sep 17 00:00:00 2001 From: Petr Kalis Date: Tue, 29 Sep 2020 11:49:04 +0200 Subject: [PATCH 8/9] Refactor - renamed variable, fixed loop --- pype/hosts/nukestudio/tags.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pype/hosts/nukestudio/tags.py b/pype/hosts/nukestudio/tags.py index 36edb16da66..c8af0cabc1b 100644 --- a/pype/hosts/nukestudio/tags.py +++ b/pype/hosts/nukestudio/tags.py @@ -71,8 +71,8 @@ def add_tags_from_presets(): # Get project task types. tasks = io.find_one({"type": "project"})["config"]["tasks"] nks_pres_tags["[Tasks]"] = {} - for task_name, _ in tasks.items(): - nks_pres_tags["[Tasks]"][task_name] = { + for task_type in tasks.keys(): + nks_pres_tags["[Tasks]"][task_type] = { "editable": "1", "note": "", "icon": { From 3cb2d04e8032a04db5679327a598b33877f961e8 Mon Sep 17 00:00:00 2001 From: Petr Kalis Date: Tue, 29 Sep 2020 12:01:11 +0200 Subject: [PATCH 9/9] Added back print of comments --- pype/plugins/nukestudio/publish/collect_shots.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pype/plugins/nukestudio/publish/collect_shots.py b/pype/plugins/nukestudio/publish/collect_shots.py index 42b1ea160d8..a33e1fad496 100644 --- a/pype/plugins/nukestudio/publish/collect_shots.py +++ b/pype/plugins/nukestudio/publish/collect_shots.py @@ -40,11 +40,12 @@ def process(self, instance): data["name"] = data["subset"] + "_" + data["asset"] data["label"] = ( - "{} - {} - tasks:{} - assetbuilds:{}".format( + "{} - {} - tasks:{} - assetbuilds:{} - comments:{}".format( data["asset"], data["subset"], data["tasks"].keys(), - [x["name"] for x in data.get("assetbuilds", [])] + [x["name"] for x in data.get("assetbuilds", [])], + len(data["comments"]) ) )