From 57e1af7ba8677da789e6c822ea62524a53cb3b66 Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Mon, 21 Feb 2022 17:09:28 +0100 Subject: [PATCH] changed 'uuid' to 'instance_id' as 'uuid' may not work in maya --- openpype/hosts/testhost/api/instances.json | 12 ++++++------ openpype/hosts/testhost/api/pipeline.py | 6 +++--- openpype/pipeline/create/README.md | 4 ++-- openpype/pipeline/create/context.py | 8 ++++---- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/openpype/hosts/testhost/api/instances.json b/openpype/hosts/testhost/api/instances.json index 84021eff91..d955012514 100644 --- a/openpype/hosts/testhost/api/instances.json +++ b/openpype/hosts/testhost/api/instances.json @@ -8,7 +8,7 @@ "asset": "sq01_sh0010", "task": "Compositing", "variant": "myVariant", - "uuid": "a485f148-9121-46a5-8157-aa64df0fb449", + "instance_id": "a485f148-9121-46a5-8157-aa64df0fb449", "creator_attributes": { "number_key": 10, "ha": 10 @@ -29,8 +29,8 @@ "asset": "sq01_sh0010", "task": "Compositing", "variant": "myVariant2", - "uuid": "a485f148-9121-46a5-8157-aa64df0fb444", "creator_attributes": {}, + "instance_id": "a485f148-9121-46a5-8157-aa64df0fb444", "publish_attributes": { "CollectFtrackApi": { "add_ftrack_family": true @@ -47,8 +47,8 @@ "asset": "sq01_sh0010", "task": "Compositing", "variant": "Main", - "uuid": "3607bc95-75f6-4648-a58d-e699f413d09f", "creator_attributes": {}, + "instance_id": "3607bc95-75f6-4648-a58d-e699f413d09f", "publish_attributes": { "CollectFtrackApi": { "add_ftrack_family": true @@ -65,7 +65,7 @@ "asset": "sq01_sh0020", "task": "Compositing", "variant": "Main2", - "uuid": "4ccf56f6-9982-4837-967c-a49695dbe8eb", + "instance_id": "4ccf56f6-9982-4837-967c-a49695dbe8eb", "creator_attributes": {}, "publish_attributes": { "CollectFtrackApi": { @@ -83,7 +83,7 @@ "asset": "sq01_sh0020", "task": "Compositing", "variant": "Main2", - "uuid": "4ccf56f6-9982-4837-967c-a49695dbe8ec", + "instance_id": "4ccf56f6-9982-4837-967c-a49695dbe8ec", "creator_attributes": {}, "publish_attributes": { "CollectFtrackApi": { @@ -101,7 +101,7 @@ "asset": "Alpaca_01", "task": "modeling", "variant": "Main", - "uuid": "7c9ddfc7-9f9c-4c1c-b233-38c966735fb6", + "instance_id": "7c9ddfc7-9f9c-4c1c-b233-38c966735fb6", "creator_attributes": {}, "publish_attributes": {} } diff --git a/openpype/hosts/testhost/api/pipeline.py b/openpype/hosts/testhost/api/pipeline.py index 49f1d3f33d..1f5d680705 100644 --- a/openpype/hosts/testhost/api/pipeline.py +++ b/openpype/hosts/testhost/api/pipeline.py @@ -114,7 +114,7 @@ def update_instances(update_list): instances = HostContext.get_instances() for instance_data in instances: - instance_id = instance_data["uuid"] + instance_id = instance_data["instance_id"] if instance_id in updated_instances: new_instance_data = updated_instances[instance_id] old_keys = set(instance_data.keys()) @@ -132,10 +132,10 @@ def remove_instances(instances): current_instances = HostContext.get_instances() for instance in instances: - instance_id = instance.data["uuid"] + instance_id = instance.data["instance_id"] found_idx = None for idx, _instance in enumerate(current_instances): - if instance_id == _instance["uuid"]: + if instance_id == _instance["instance_id"]: found_idx = idx break diff --git a/openpype/pipeline/create/README.md b/openpype/pipeline/create/README.md index 9eef7c72a7..02b64e52ea 100644 --- a/openpype/pipeline/create/README.md +++ b/openpype/pipeline/create/README.md @@ -14,7 +14,7 @@ Except creating and removing instances are all changes not automatically propaga ## CreatedInstance -Product of creation is "instance" which holds basic data defying it. Core data are `creator_identifier`, `family` and `subset`. Other data can be keys used to fill subset name or metadata modifying publishing process of the instance (more described later). All instances have `id` which holds constant `pyblish.avalon.instance` and `uuid` which is identifier of the instance. +Product of creation is "instance" which holds basic data defying it. Core data are `creator_identifier`, `family` and `subset`. Other data can be keys used to fill subset name or metadata modifying publishing process of the instance (more described later). All instances have `id` which holds constant `pyblish.avalon.instance` and `instance_id` which is identifier of the instance. Family tells how should be instance processed and subset what name will published item have. - There are cases when subset is not fully filled during creation and may change during publishing. That is in most of cases caused because instance is related to other instance or instance data do not represent final product. @@ -26,7 +26,7 @@ Family tells how should be instance processed and subset what name will publishe ## Identifier that this data represents instance for publishing (automatically assigned) "id": "pyblish.avalon.instance", ## Identifier of this specific instance (automatically assigned) - "uuid": , + "instance_id": , ## Instance family (used from Creator) "family": , diff --git a/openpype/pipeline/create/context.py b/openpype/pipeline/create/context.py index 4454d31d83..e11d32091f 100644 --- a/openpype/pipeline/create/context.py +++ b/openpype/pipeline/create/context.py @@ -361,7 +361,7 @@ class CreatedInstance: # their individual children but not on their own __immutable_keys = ( "id", - "uuid", + "instance_id", "family", "creator_identifier", "creator_attributes", @@ -434,8 +434,8 @@ class CreatedInstance: if data: self._data.update(data) - if not self._data.get("uuid"): - self._data["uuid"] = str(uuid4()) + if not self._data.get("instance_id"): + self._data["instance_id"] = str(uuid4()) self._asset_is_valid = self.has_set_asset self._task_is_valid = self.has_set_task @@ -551,7 +551,7 @@ class CreatedInstance: @property def id(self): """Instance identifier.""" - return self._data["uuid"] + return self._data["instance_id"] @property def data(self):