From 35533b7f951c9e43f52fed84bf25ca5823813fe8 Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Thu, 7 Nov 2024 09:18:46 +0100 Subject: [PATCH 1/5] Remove unused functions related to publishing attributes. - Removed set_publish_attribute and get_publish_attribute functions from the codebase as they were not being used. --- client/ayon_hiero/api/__init__.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/client/ayon_hiero/api/__init__.py b/client/ayon_hiero/api/__init__.py index e93264c..bd5035e 100644 --- a/client/ayon_hiero/api/__init__.py +++ b/client/ayon_hiero/api/__init__.py @@ -43,8 +43,6 @@ get_trackitem_ayon_tag, set_trackitem_ayon_tag, get_trackitem_ayon_data, - set_publish_attribute, - get_publish_attribute, imprint, get_selected_track_items, set_selected_track_items, @@ -104,8 +102,6 @@ "get_trackitem_ayon_tag", "set_trackitem_ayon_tag", "get_trackitem_ayon_data", - "set_publish_attribute", - "get_publish_attribute", "imprint", "get_selected_track_items", "set_selected_track_items", From fa1daaaf218a686dbc3b66bdd8c396ee88bd225c Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Thu, 7 Nov 2024 09:19:09 +0100 Subject: [PATCH 2/5] Refactor imprint function for better data handling - Updated parameter description in the imprint function to correct spelling error and improve clarity. - Removed unnecessary code related to setting publish attribute and added a call to set_trackitem_ayon_tag within the imprint function. --- client/ayon_hiero/api/lib.py | 48 ++---------------------------------- 1 file changed, 2 insertions(+), 46 deletions(-) diff --git a/client/ayon_hiero/api/lib.py b/client/ayon_hiero/api/lib.py index d0c59a1..44c0b5a 100644 --- a/client/ayon_hiero/api/lib.py +++ b/client/ayon_hiero/api/lib.py @@ -593,7 +593,7 @@ def imprint(track_item, data=None): Arguments: track_item (hiero.core.TrackItem): hiero track item object - data (dict): Any data which needst to be imprinted + data (dict): Any data which needs to be imprinted Examples: data = { @@ -604,51 +604,7 @@ def imprint(track_item, data=None): """ data = data or {} - tag = set_trackitem_ayon_tag(track_item, data) - - # add publish attribute - set_publish_attribute(tag, True) - - -def set_publish_attribute(tag, value): - """ Set Publish attribute in input Tag object - - Attribute: - tag (hiero.core.Tag): a tag object - value (bool): True or False - """ - tag_data = tag.metadata() - try: - tag_json_data = tag_data["tag.json_metadata"] - metadata = json.loads(tag_json_data) - - except (KeyError, json.JSONDecodeError): # missing key or invalid tag data - metadata = {} - - metadata["publish"] = value - tag_data.setValue("tag.json_metadata", json.dumps(metadata)) - - -def get_publish_attribute(tag): - """ Get Publish attribute from input Tag object - - Attribute: - tag (hiero.core.Tag): a tag object - - Returns: - object: data found on publish attribute or None - """ - tag_data = tag.metadata() - - # get data to the publish attribute - try: - tag_json_data = tag_data["tag.json_metadata"] - tag_data = json.loads(tag_json_data) - - except (KeyError, json.JSONDecodeError): # missing key or invalid tag data - return None - - return tag_data["publish"] + set_trackitem_ayon_tag(track_item, data) def sync_avalon_data_to_workfile(): From 22eff126896879b5937ec1ead3a34362a3b32e7c Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Thu, 7 Nov 2024 09:19:21 +0100 Subject: [PATCH 3/5] Refactor pipeline.py for better readability and remove redundant code. - Removed unnecessary function definitions and imports - Refactored existing code for clarity and simplicity --- client/ayon_hiero/api/pipeline.py | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/client/ayon_hiero/api/pipeline.py b/client/ayon_hiero/api/pipeline.py index 94199eb..0f71699 100644 --- a/client/ayon_hiero/api/pipeline.py +++ b/client/ayon_hiero/api/pipeline.py @@ -348,20 +348,3 @@ def reload_config(): except Exception as e: log.warning("Cannot reload module: {}".format(e)) importlib.reload(module) - - -def on_pyblish_instance_toggled(instance, old_value, new_value): - """Toggle node passthrough states on instance toggles.""" - - log.info("instance toggle: {}, old_value: {}, new_value:{} ".format( - instance, old_value, new_value)) - - from ayon_hiero.api import ( - get_trackitem_ayon_tag, - set_publish_attribute - ) - - # Whether instances should be passthrough based on new value - track_item = instance.data["item"] - tag = get_trackitem_ayon_tag(track_item) - set_publish_attribute(tag, new_value) From 941fb0f5c4ab928ddc2448dc4d31bd1d628db5a4 Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Thu, 7 Nov 2024 09:30:48 +0100 Subject: [PATCH 4/5] Remove deprecated "newAssetPublishing" feature. Removed the deprecated "newAssetPublishing" feature from the codebase to ensure compatibility and maintain clean code structure. --- client/ayon_hiero/plugins/create/create_shot_clip.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/client/ayon_hiero/plugins/create/create_shot_clip.py b/client/ayon_hiero/plugins/create/create_shot_clip.py index 38d772e..0dc67ae 100644 --- a/client/ayon_hiero/plugins/create/create_shot_clip.py +++ b/client/ayon_hiero/plugins/create/create_shot_clip.py @@ -103,8 +103,6 @@ def create(self, instance_data, _): "productName": f"{self.product_type}{instance_data['variant']}", "productType": self.product_type, "newHierarchyIntegration": True, - # Backwards compatible (Deprecated since 24/06/06) - "newAssetPublishing": True, }) new_instance = CreatedInstance( From 321e1ceb52747ebe3fd60f1215d94b1103732a3d Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Thu, 7 Nov 2024 09:32:14 +0100 Subject: [PATCH 5/5] Remove deprecated track item Pype functions and aliases. - Removed deprecated track item Pype functions and their aliases from the codebase to clean up unnecessary legacy code. --- client/ayon_hiero/api/__init__.py | 7 ------- client/ayon_hiero/api/lib.py | 18 ------------------ 2 files changed, 25 deletions(-) diff --git a/client/ayon_hiero/api/__init__.py b/client/ayon_hiero/api/__init__.py index bd5035e..9caeef8 100644 --- a/client/ayon_hiero/api/__init__.py +++ b/client/ayon_hiero/api/__init__.py @@ -37,9 +37,6 @@ get_track_ayon_tag, set_track_ayon_tag, get_track_ayon_data, - get_track_item_pype_tag, - set_track_item_pype_tag, - get_track_item_pype_data, get_trackitem_ayon_tag, set_trackitem_ayon_tag, get_trackitem_ayon_data, @@ -111,10 +108,6 @@ "apply_colorspace_project", "apply_colorspace_clips", "get_sequence_pattern_and_padding", - # deprecated - "get_track_item_pype_tag", - "set_track_item_pype_tag", - "get_track_item_pype_data", # plugins "CreatorWidget", diff --git a/client/ayon_hiero/api/lib.py b/client/ayon_hiero/api/lib.py index 44c0b5a..1da4576 100644 --- a/client/ayon_hiero/api/lib.py +++ b/client/ayon_hiero/api/lib.py @@ -459,24 +459,6 @@ def get_track_ayon_data(track, container_name=None): ) -@deprecated("ayon_hiero.api.lib.get_trackitem_ayon_tag") -def get_track_item_pype_tag(track_item): - # backward compatibility alias - return get_trackitem_ayon_tag(track_item) - - -@deprecated("ayon_hiero.api.lib.set_trackitem_ayon_tag") -def set_track_item_pype_tag(track_item, data=None): - # backward compatibility alias - return set_trackitem_ayon_tag(track_item, data) - - -@deprecated("ayon_hiero.api.lib.get_trackitem_ayon_data") -def get_track_item_pype_data(track_item): - # backward compatibility alias - return get_trackitem_ayon_data(track_item) - - def get_trackitem_ayon_tag(track_item, tag_name=AYON_TAG_NAME): """ Get pype track item tag created by creator or loader plugin.