From 72bde0349b0112f558d3b742128d864de13d055f Mon Sep 17 00:00:00 2001 From: Petr Kalis Date: Tue, 8 Jul 2025 17:04:35 +0200 Subject: [PATCH 01/26] Allow to push to other projects not only Library --- .../tools/push_to_project/control.py | 10 +++++++ .../tools/push_to_project/ui/window.py | 26 ++++++++++++++++++- 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/client/ayon_core/tools/push_to_project/control.py b/client/ayon_core/tools/push_to_project/control.py index fb080d158b..f24d11d0b7 100644 --- a/client/ayon_core/tools/push_to_project/control.py +++ b/client/ayon_core/tools/push_to_project/control.py @@ -40,6 +40,8 @@ class PushToContextController: self.set_source(project_name, version_id) + self._library_only = True + # Events system def emit_event(self, topic, data=None, source=None): """Use implemented event system to trigger event.""" @@ -128,6 +130,14 @@ class PushToContextController: self._src_label = self._prepare_source_label() return self._src_label + def get_library_only(self): + """Returns state of library filter""" + return self._library_only + + def set_library_only(self, state: bool): + """Change state of library filter""" + self._library_only = state + def get_project_items(self, sender=None): return self._projects_model.get_project_items(sender) diff --git a/client/ayon_core/tools/push_to_project/ui/window.py b/client/ayon_core/tools/push_to_project/ui/window.py index a69c512fcd..566a0fc605 100644 --- a/client/ayon_core/tools/push_to_project/ui/window.py +++ b/client/ayon_core/tools/push_to_project/ui/window.py @@ -85,6 +85,14 @@ class PushToContextSelectWindow(QtWidgets.QWidget): header_widget = QtWidgets.QWidget(main_context_widget) + library_only = self._controller.get_library_only() + library_only_label = QtWidgets.QLabel( + "Show only libraries", + header_widget + ) + library_only_checkbox = NiceCheckbox( + library_only, parent=header_widget) + header_label = QtWidgets.QLabel( controller.get_source_label(), header_widget @@ -93,6 +101,14 @@ class PushToContextSelectWindow(QtWidgets.QWidget): header_layout = QtWidgets.QHBoxLayout(header_widget) header_layout.setContentsMargins(0, 0, 0, 0) header_layout.addWidget(header_label) + header_layout.addStretch() + + library_only_layout = QtWidgets.QHBoxLayout() + library_only_layout.addWidget(library_only_label) + library_only_layout.addWidget(library_only_checkbox) + library_only_layout.setSpacing(5) # or whatever spacing you prefer + + header_layout.addLayout(library_only_layout) main_splitter = QtWidgets.QSplitter( QtCore.Qt.Horizontal, main_context_widget @@ -102,7 +118,7 @@ class PushToContextSelectWindow(QtWidgets.QWidget): projects_combobox = ProjectsCombobox(controller, context_widget) projects_combobox.set_select_item_visible(True) - projects_combobox.set_standard_filter_enabled(True) + projects_combobox.set_standard_filter_enabled(library_only) context_splitter = QtWidgets.QSplitter( QtCore.Qt.Vertical, context_widget @@ -240,6 +256,7 @@ class PushToContextSelectWindow(QtWidgets.QWidget): folder_name_input.textChanged.connect(self._on_new_folder_change) variant_input.textChanged.connect(self._on_variant_change) comment_input.textChanged.connect(self._on_comment_change) + library_only_checkbox.stateChanged.connect(self._on_library_only_change) publish_btn.clicked.connect(self._on_select_click) cancel_btn.clicked.connect(self._on_close_click) @@ -394,6 +411,13 @@ class PushToContextSelectWindow(QtWidgets.QWidget): self._comment_input_text = text self._user_input_changed_timer.start() + def _on_library_only_change(self, state: int) -> None: + """Change toggle state, reset filter, recalculate dropdown""" + state = bool(state) + self._controller.set_library_only(state) + self._projects_combobox.set_standard_filter_enabled(state) + self._projects_combobox.refresh() + def _on_user_input_timer(self): folder_name_enabled = self._new_folder_name_enabled folder_name = self._new_folder_name_input_text From e880b2983896cb79493266c61f08089e16d109a4 Mon Sep 17 00:00:00 2001 From: Petr Kalis Date: Tue, 8 Jul 2025 17:06:11 +0200 Subject: [PATCH 02/26] Changed label of action Push to --- client/ayon_core/plugins/load/push_to_library.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/ayon_core/plugins/load/push_to_library.py b/client/ayon_core/plugins/load/push_to_library.py index 981028d734..825192c15e 100644 --- a/client/ayon_core/plugins/load/push_to_library.py +++ b/client/ayon_core/plugins/load/push_to_library.py @@ -14,7 +14,7 @@ class PushToLibraryProject(load.ProductLoaderPlugin): representations = {"*"} product_types = {"*"} - label = "Push to Library project" + label = "Push to (Library) project" order = 35 icon = "send" color = "#d8d8d8" From c35c86440bedd9d15475cd7db9d9685965c1777c Mon Sep 17 00:00:00 2001 From: Petr Kalis Date: Thu, 10 Jul 2025 11:39:01 +0200 Subject: [PATCH 03/26] Used different layout Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> --- client/ayon_core/tools/push_to_project/ui/window.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/client/ayon_core/tools/push_to_project/ui/window.py b/client/ayon_core/tools/push_to_project/ui/window.py index 566a0fc605..49093b8a00 100644 --- a/client/ayon_core/tools/push_to_project/ui/window.py +++ b/client/ayon_core/tools/push_to_project/ui/window.py @@ -101,14 +101,9 @@ class PushToContextSelectWindow(QtWidgets.QWidget): header_layout = QtWidgets.QHBoxLayout(header_widget) header_layout.setContentsMargins(0, 0, 0, 0) header_layout.addWidget(header_label) - header_layout.addStretch() - - library_only_layout = QtWidgets.QHBoxLayout() - library_only_layout.addWidget(library_only_label) - library_only_layout.addWidget(library_only_checkbox) - library_only_layout.setSpacing(5) # or whatever spacing you prefer - - header_layout.addLayout(library_only_layout) + header_layout.addStretch(1) + header_layout.addWidget(library_only_label, 0) + header_layout.addWidget(library_only_checkbox, 0) main_splitter = QtWidgets.QSplitter( QtCore.Qt.Horizontal, main_context_widget From 63da40c2025739bdfc864ae38e5031fe20dcc0a9 Mon Sep 17 00:00:00 2001 From: Petr Kalis Date: Fri, 11 Jul 2025 13:59:34 +0200 Subject: [PATCH 04/26] Added thumbnail copy from source to target --- .../tools/push_to_project/models/integrate.py | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/client/ayon_core/tools/push_to_project/models/integrate.py b/client/ayon_core/tools/push_to_project/models/integrate.py index 6bd4279219..fd20a7faba 100644 --- a/client/ayon_core/tools/push_to_project/models/integrate.py +++ b/client/ayon_core/tools/push_to_project/models/integrate.py @@ -3,6 +3,7 @@ import re import copy import itertools import sys +import tempfile import traceback import uuid @@ -484,6 +485,7 @@ class ProjectPushItemProcess: self._make_sure_version_exists() self._log_info("Prerequirements were prepared") self._integrate_representations() + self._copy_version_thumbnail() self._log_info("Integration finished") except PushToProjectError as exc: @@ -1145,8 +1147,39 @@ class ProjectPushItemProcess: "representation", repre_entity["id"], {"active": False} + + def _copy_version_thumbnail(self): + version_thumbnail = ayon_api.get_version_thumbnail( + self._item.src_project_name, self._src_version_entity["id"]) + if not version_thumbnail or not version_thumbnail.id: + return + + temp_file_name = None + try: + with tempfile.NamedTemporaryFile(mode='w+b', delete=False) as fp: + fp.write(version_thumbnail.content) + temp_file_name = fp.name + + new_thumbnail_id = ayon_api.create_thumbnail( + self._item.dst_project_name, + temp_file_name ) + task_id = None + if self._task_info: + task_id = self._task_info["id"] + + self._operations.update_version( + project_name=self._item.dst_project_name, + version_id=self._version_entity["id"], + task_id=task_id, + thumbnail_id=new_thumbnail_id + ) + self._operations.commit() + finally: + if temp_file_name and os.path.exists(temp_file_name): + os.remove(temp_file_name) + class IntegrateModel: def __init__(self, controller): From 7161de78fabaddd55d5d9e1c1d6f01e167da7910 Mon Sep 17 00:00:00 2001 From: Petr Kalis Date: Mon, 14 Jul 2025 16:33:44 +0200 Subject: [PATCH 05/26] Fix typo --- client/ayon_core/tools/push_to_project/models/integrate.py | 1 + 1 file changed, 1 insertion(+) diff --git a/client/ayon_core/tools/push_to_project/models/integrate.py b/client/ayon_core/tools/push_to_project/models/integrate.py index fd20a7faba..341858148b 100644 --- a/client/ayon_core/tools/push_to_project/models/integrate.py +++ b/client/ayon_core/tools/push_to_project/models/integrate.py @@ -1147,6 +1147,7 @@ class ProjectPushItemProcess: "representation", repre_entity["id"], {"active": False} + ) def _copy_version_thumbnail(self): version_thumbnail = ayon_api.get_version_thumbnail( From bcea66c9314eb9f2796cefeb6176c2f9fc485fdc Mon Sep 17 00:00:00 2001 From: Petr Kalis Date: Thu, 17 Jul 2025 14:31:23 +0200 Subject: [PATCH 06/26] Label update Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> --- client/ayon_core/plugins/load/push_to_library.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/ayon_core/plugins/load/push_to_library.py b/client/ayon_core/plugins/load/push_to_library.py index 825192c15e..22c10bbad7 100644 --- a/client/ayon_core/plugins/load/push_to_library.py +++ b/client/ayon_core/plugins/load/push_to_library.py @@ -14,7 +14,7 @@ class PushToLibraryProject(load.ProductLoaderPlugin): representations = {"*"} product_types = {"*"} - label = "Push to (Library) project" + label = "Push to project" order = 35 icon = "send" color = "#d8d8d8" From 1c4f466181a892ecb954f523de061e791d435e7e Mon Sep 17 00:00:00 2001 From: Petr Kalis Date: Thu, 17 Jul 2025 14:31:34 +0200 Subject: [PATCH 07/26] Formatting change Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> --- client/ayon_core/tools/push_to_project/models/integrate.py | 1 + 1 file changed, 1 insertion(+) diff --git a/client/ayon_core/tools/push_to_project/models/integrate.py b/client/ayon_core/tools/push_to_project/models/integrate.py index 341858148b..20fa5c98e5 100644 --- a/client/ayon_core/tools/push_to_project/models/integrate.py +++ b/client/ayon_core/tools/push_to_project/models/integrate.py @@ -1148,6 +1148,7 @@ class ProjectPushItemProcess: repre_entity["id"], {"active": False} ) + ) def _copy_version_thumbnail(self): version_thumbnail = ayon_api.get_version_thumbnail( From fd26c2039495b3f83bf8c3c08de2edc5b449c257 Mon Sep 17 00:00:00 2001 From: Petr Kalis Date: Mon, 28 Jul 2025 15:00:44 +0200 Subject: [PATCH 08/26] Fix typo --- client/ayon_core/tools/push_to_project/models/integrate.py | 1 - 1 file changed, 1 deletion(-) diff --git a/client/ayon_core/tools/push_to_project/models/integrate.py b/client/ayon_core/tools/push_to_project/models/integrate.py index 20fa5c98e5..341858148b 100644 --- a/client/ayon_core/tools/push_to_project/models/integrate.py +++ b/client/ayon_core/tools/push_to_project/models/integrate.py @@ -1148,7 +1148,6 @@ class ProjectPushItemProcess: repre_entity["id"], {"active": False} ) - ) def _copy_version_thumbnail(self): version_thumbnail = ayon_api.get_version_thumbnail( From bcf87dec1060d1dfef2e8d4249f4ebee698829ba Mon Sep 17 00:00:00 2001 From: Petr Kalis Date: Mon, 28 Jul 2025 15:01:12 +0200 Subject: [PATCH 09/26] Removed unnecessary _library_only --- client/ayon_core/tools/push_to_project/control.py | 8 -------- client/ayon_core/tools/push_to_project/ui/window.py | 6 ++---- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/client/ayon_core/tools/push_to_project/control.py b/client/ayon_core/tools/push_to_project/control.py index f24d11d0b7..eb985a3f8c 100644 --- a/client/ayon_core/tools/push_to_project/control.py +++ b/client/ayon_core/tools/push_to_project/control.py @@ -130,14 +130,6 @@ class PushToContextController: self._src_label = self._prepare_source_label() return self._src_label - def get_library_only(self): - """Returns state of library filter""" - return self._library_only - - def set_library_only(self, state: bool): - """Change state of library filter""" - self._library_only = state - def get_project_items(self, sender=None): return self._projects_model.get_project_items(sender) diff --git a/client/ayon_core/tools/push_to_project/ui/window.py b/client/ayon_core/tools/push_to_project/ui/window.py index 49093b8a00..6b0363adee 100644 --- a/client/ayon_core/tools/push_to_project/ui/window.py +++ b/client/ayon_core/tools/push_to_project/ui/window.py @@ -85,13 +85,12 @@ class PushToContextSelectWindow(QtWidgets.QWidget): header_widget = QtWidgets.QWidget(main_context_widget) - library_only = self._controller.get_library_only() library_only_label = QtWidgets.QLabel( "Show only libraries", header_widget ) library_only_checkbox = NiceCheckbox( - library_only, parent=header_widget) + True, parent=header_widget) header_label = QtWidgets.QLabel( controller.get_source_label(), @@ -113,7 +112,7 @@ class PushToContextSelectWindow(QtWidgets.QWidget): projects_combobox = ProjectsCombobox(controller, context_widget) projects_combobox.set_select_item_visible(True) - projects_combobox.set_standard_filter_enabled(library_only) + projects_combobox.set_standard_filter_enabled(True) context_splitter = QtWidgets.QSplitter( QtCore.Qt.Vertical, context_widget @@ -409,7 +408,6 @@ class PushToContextSelectWindow(QtWidgets.QWidget): def _on_library_only_change(self, state: int) -> None: """Change toggle state, reset filter, recalculate dropdown""" state = bool(state) - self._controller.set_library_only(state) self._projects_combobox.set_standard_filter_enabled(state) self._projects_combobox.refresh() From 65d03327b8af6e630b41f17bd629115e6fd1a83d Mon Sep 17 00:00:00 2001 From: Petr Kalis Date: Wed, 13 Aug 2025 15:18:46 +0200 Subject: [PATCH 10/26] Fix typo --- client/ayon_core/tools/push_to_project/ui/window.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/ayon_core/tools/push_to_project/ui/window.py b/client/ayon_core/tools/push_to_project/ui/window.py index 6b0363adee..344295f177 100644 --- a/client/ayon_core/tools/push_to_project/ui/window.py +++ b/client/ayon_core/tools/push_to_project/ui/window.py @@ -551,7 +551,7 @@ class PushToContextSelectWindow(QtWidgets.QWidget): self._main_thread_timer_can_stop = False self._main_thread_timer.start() self._main_layout.setCurrentWidget(self._overlay_widget) - self._overlay_label.setText("Submittion started") + self._overlay_label.setText("Submission started") def _on_controller_submit_end(self): self._main_thread_timer_can_stop = True From 60558e440c93a167c1c58e8614178ff15e9af23f Mon Sep 17 00:00:00 2001 From: Petr Kalis Date: Mon, 18 Aug 2025 13:16:17 +0200 Subject: [PATCH 11/26] Removed unnecessary field --- client/ayon_core/tools/push_to_project/control.py | 1 - 1 file changed, 1 deletion(-) diff --git a/client/ayon_core/tools/push_to_project/control.py b/client/ayon_core/tools/push_to_project/control.py index eb985a3f8c..b52eeb5fad 100644 --- a/client/ayon_core/tools/push_to_project/control.py +++ b/client/ayon_core/tools/push_to_project/control.py @@ -40,7 +40,6 @@ class PushToContextController: self.set_source(project_name, version_id) - self._library_only = True # Events system def emit_event(self, topic, data=None, source=None): From 86130207186b40667ff436d077712958cecab31f Mon Sep 17 00:00:00 2001 From: Petr Kalis Date: Mon, 18 Aug 2025 13:17:10 +0200 Subject: [PATCH 12/26] Change formatting --- client/ayon_core/tools/push_to_project/ui/window.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/client/ayon_core/tools/push_to_project/ui/window.py b/client/ayon_core/tools/push_to_project/ui/window.py index 344295f177..b2f3983557 100644 --- a/client/ayon_core/tools/push_to_project/ui/window.py +++ b/client/ayon_core/tools/push_to_project/ui/window.py @@ -99,8 +99,7 @@ class PushToContextSelectWindow(QtWidgets.QWidget): header_layout = QtWidgets.QHBoxLayout(header_widget) header_layout.setContentsMargins(0, 0, 0, 0) - header_layout.addWidget(header_label) - header_layout.addStretch(1) + header_layout.addWidget(header_label, 1) header_layout.addWidget(library_only_label, 0) header_layout.addWidget(library_only_checkbox, 0) From e7c0c8dab4fb91b010e587ac5f43694ac2beed50 Mon Sep 17 00:00:00 2001 From: Petr Kalis Date: Mon, 18 Aug 2025 13:19:04 +0200 Subject: [PATCH 13/26] Removed unnecessary refresh --- client/ayon_core/tools/push_to_project/ui/window.py | 1 + 1 file changed, 1 insertion(+) diff --git a/client/ayon_core/tools/push_to_project/ui/window.py b/client/ayon_core/tools/push_to_project/ui/window.py index b2f3983557..38c343b023 100644 --- a/client/ayon_core/tools/push_to_project/ui/window.py +++ b/client/ayon_core/tools/push_to_project/ui/window.py @@ -410,6 +410,7 @@ class PushToContextSelectWindow(QtWidgets.QWidget): self._projects_combobox.set_standard_filter_enabled(state) self._projects_combobox.refresh() + def _on_user_input_timer(self): folder_name_enabled = self._new_folder_name_enabled folder_name = self._new_folder_name_input_text From 92ecc854c9396e6bef33d9b68619320cc4ecf08e Mon Sep 17 00:00:00 2001 From: Petr Kalis Date: Mon, 18 Aug 2025 13:23:51 +0200 Subject: [PATCH 14/26] Simplified _copy_version_thumbnail logic Used cached get_thumbnail_path --- .../tools/push_to_project/models/integrate.py | 50 ++++++++----------- 1 file changed, 21 insertions(+), 29 deletions(-) diff --git a/client/ayon_core/tools/push_to_project/models/integrate.py b/client/ayon_core/tools/push_to_project/models/integrate.py index 341858148b..b180892d62 100644 --- a/client/ayon_core/tools/push_to_project/models/integrate.py +++ b/client/ayon_core/tools/push_to_project/models/integrate.py @@ -22,6 +22,7 @@ from ayon_core.lib import ( source_hash, ) from ayon_core.lib.file_transaction import FileTransaction +from ayon_core.pipeline.thumbnails import get_thumbnail_path from ayon_core.settings import get_project_settings from ayon_core.pipeline import Anatomy from ayon_core.pipeline.version_start import get_versioning_start @@ -1150,36 +1151,27 @@ class ProjectPushItemProcess: ) def _copy_version_thumbnail(self): - version_thumbnail = ayon_api.get_version_thumbnail( - self._item.src_project_name, self._src_version_entity["id"]) - if not version_thumbnail or not version_thumbnail.id: + thumbnail_id = self._src_version_entity["thumbnailId"] + if not thumbnail_id: return - - temp_file_name = None - try: - with tempfile.NamedTemporaryFile(mode='w+b', delete=False) as fp: - fp.write(version_thumbnail.content) - temp_file_name = fp.name - - new_thumbnail_id = ayon_api.create_thumbnail( - self._item.dst_project_name, - temp_file_name - ) - - task_id = None - if self._task_info: - task_id = self._task_info["id"] - - self._operations.update_version( - project_name=self._item.dst_project_name, - version_id=self._version_entity["id"], - task_id=task_id, - thumbnail_id=new_thumbnail_id - ) - self._operations.commit() - finally: - if temp_file_name and os.path.exists(temp_file_name): - os.remove(temp_file_name) + path = get_thumbnail_path( + self._item.src_project_name, + "version", + self._src_version_entity["id"], + thumbnail_id + ) + if not path: + return + new_thumbnail_id = ayon_api.create_thumbnail( + self._item.dst_project_name, + path + ) + self._operations.update_version( + project_name=self._item.dst_project_name, + version_id=self._version_entity["id"], + thumbnail_id=new_thumbnail_id + ) + self._operations.commit() class IntegrateModel: From 6c6be3508f5292324123fad320d78d98644b7de9 Mon Sep 17 00:00:00 2001 From: Petr Kalis Date: Mon, 18 Aug 2025 13:53:14 +0200 Subject: [PATCH 15/26] Propagate taskId to limit json parse issue --- client/ayon_core/tools/push_to_project/models/integrate.py | 1 + 1 file changed, 1 insertion(+) diff --git a/client/ayon_core/tools/push_to_project/models/integrate.py b/client/ayon_core/tools/push_to_project/models/integrate.py index b180892d62..0c654a5495 100644 --- a/client/ayon_core/tools/push_to_project/models/integrate.py +++ b/client/ayon_core/tools/push_to_project/models/integrate.py @@ -1169,6 +1169,7 @@ class ProjectPushItemProcess: self._operations.update_version( project_name=self._item.dst_project_name, version_id=self._version_entity["id"], + task_id=self._version_entity.get("taskId"), thumbnail_id=new_thumbnail_id ) self._operations.commit() From 7860c7d875c539f52bfdd78c590ebc77a80c5af6 Mon Sep 17 00:00:00 2001 From: Petr Kalis Date: Mon, 18 Aug 2025 13:55:49 +0200 Subject: [PATCH 16/26] Removed unnecessary refresh --- client/ayon_core/tools/push_to_project/ui/window.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/client/ayon_core/tools/push_to_project/ui/window.py b/client/ayon_core/tools/push_to_project/ui/window.py index 38c343b023..495ef83ce6 100644 --- a/client/ayon_core/tools/push_to_project/ui/window.py +++ b/client/ayon_core/tools/push_to_project/ui/window.py @@ -408,8 +408,6 @@ class PushToContextSelectWindow(QtWidgets.QWidget): """Change toggle state, reset filter, recalculate dropdown""" state = bool(state) self._projects_combobox.set_standard_filter_enabled(state) - self._projects_combobox.refresh() - def _on_user_input_timer(self): folder_name_enabled = self._new_folder_name_enabled From d79bd055bcf771553076016b5cfd02e9ad4c5468 Mon Sep 17 00:00:00 2001 From: Petr Kalis Date: Mon, 18 Aug 2025 14:03:08 +0200 Subject: [PATCH 17/26] Removed unnecessary import --- client/ayon_core/tools/push_to_project/models/integrate.py | 1 - 1 file changed, 1 deletion(-) diff --git a/client/ayon_core/tools/push_to_project/models/integrate.py b/client/ayon_core/tools/push_to_project/models/integrate.py index 0c654a5495..ac2f506112 100644 --- a/client/ayon_core/tools/push_to_project/models/integrate.py +++ b/client/ayon_core/tools/push_to_project/models/integrate.py @@ -3,7 +3,6 @@ import re import copy import itertools import sys -import tempfile import traceback import uuid From 930439ba12990611d8b01a7114fc4cdd5a77dab2 Mon Sep 17 00:00:00 2001 From: Petr Kalis Date: Mon, 18 Aug 2025 14:26:28 +0200 Subject: [PATCH 18/26] Fix copy of frames based representations --- client/ayon_core/tools/push_to_project/models/integrate.py | 1 - 1 file changed, 1 deletion(-) diff --git a/client/ayon_core/tools/push_to_project/models/integrate.py b/client/ayon_core/tools/push_to_project/models/integrate.py index ac2f506112..40c418e513 100644 --- a/client/ayon_core/tools/push_to_project/models/integrate.py +++ b/client/ayon_core/tools/push_to_project/models/integrate.py @@ -372,7 +372,6 @@ class ProjectPushRepreItem: resource_files.append(ResourceFile(filepath, relative_path)) continue - filepath = os.path.join(src_dirpath, basename) frame = None udim = None for item in src_basename_regex.finditer(basename): From 18ad64e2260124407cef7d01d37e5ceba0527f20 Mon Sep 17 00:00:00 2001 From: Petr Kalis Date: Mon, 18 Aug 2025 14:43:29 +0200 Subject: [PATCH 19/26] Updated _copy_version_thumbnail logic --- .../tools/push_to_project/models/integrate.py | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/client/ayon_core/tools/push_to_project/models/integrate.py b/client/ayon_core/tools/push_to_project/models/integrate.py index 40c418e513..08fafcbf2d 100644 --- a/client/ayon_core/tools/push_to_project/models/integrate.py +++ b/client/ayon_core/tools/push_to_project/models/integrate.py @@ -484,7 +484,6 @@ class ProjectPushItemProcess: self._make_sure_version_exists() self._log_info("Prerequirements were prepared") self._integrate_representations() - self._copy_version_thumbnail() self._log_info("Integration finished") except PushToProjectError as exc: @@ -918,14 +917,19 @@ class ProjectPushItemProcess: task_name=self._task_info["name"], task_type=self._task_info["taskType"], product_type=product_type, - product_name=product_entity["name"] + product_name=product_entity["name"], ) existing_version_entity = ayon_api.get_version_by_name( project_name, version, product_id ) + thumbnail_id = self._copy_version_thumbnail() + # Update existing version if existing_version_entity: + updata_data = {"attrib": dst_attrib} + if thumbnail_id: + updata_data["thumbnailId"] = thumbnail_id self._operations.update_entity( project_name, "version", @@ -940,6 +944,7 @@ class ProjectPushItemProcess: version, product_id, attribs=dst_attrib, + thumbnail_id=thumbnail_id, ) self._operations.create_entity( project_name, "version", version_entity @@ -1160,17 +1165,10 @@ class ProjectPushItemProcess: ) if not path: return - new_thumbnail_id = ayon_api.create_thumbnail( + return ayon_api.create_thumbnail( self._item.dst_project_name, path ) - self._operations.update_version( - project_name=self._item.dst_project_name, - version_id=self._version_entity["id"], - task_id=self._version_entity.get("taskId"), - thumbnail_id=new_thumbnail_id - ) - self._operations.commit() class IntegrateModel: From c2b6204c0a1c10b463e9810009015b3e326df8ba Mon Sep 17 00:00:00 2001 From: Petr Kalis Date: Mon, 18 Aug 2025 15:09:17 +0200 Subject: [PATCH 20/26] Formatting change --- client/ayon_core/tools/push_to_project/control.py | 1 - 1 file changed, 1 deletion(-) diff --git a/client/ayon_core/tools/push_to_project/control.py b/client/ayon_core/tools/push_to_project/control.py index b52eeb5fad..fb080d158b 100644 --- a/client/ayon_core/tools/push_to_project/control.py +++ b/client/ayon_core/tools/push_to_project/control.py @@ -40,7 +40,6 @@ class PushToContextController: self.set_source(project_name, version_id) - # Events system def emit_event(self, topic, data=None, source=None): """Use implemented event system to trigger event.""" From 629794f6d64d4569fa03f48b13e5d2013697ff4e Mon Sep 17 00:00:00 2001 From: Petr Kalis Date: Mon, 18 Aug 2025 16:41:08 +0200 Subject: [PATCH 21/26] Return formatting change Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> --- client/ayon_core/tools/push_to_project/models/integrate.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/ayon_core/tools/push_to_project/models/integrate.py b/client/ayon_core/tools/push_to_project/models/integrate.py index 08fafcbf2d..73a00a5cd9 100644 --- a/client/ayon_core/tools/push_to_project/models/integrate.py +++ b/client/ayon_core/tools/push_to_project/models/integrate.py @@ -1156,7 +1156,7 @@ class ProjectPushItemProcess: def _copy_version_thumbnail(self): thumbnail_id = self._src_version_entity["thumbnailId"] if not thumbnail_id: - return + return None path = get_thumbnail_path( self._item.src_project_name, "version", From 78cd71138337f54fef8544a34625cf5d06b9e53b Mon Sep 17 00:00:00 2001 From: Petr Kalis Date: Mon, 18 Aug 2025 16:41:18 +0200 Subject: [PATCH 22/26] Return formatting change Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> --- client/ayon_core/tools/push_to_project/models/integrate.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/ayon_core/tools/push_to_project/models/integrate.py b/client/ayon_core/tools/push_to_project/models/integrate.py index 73a00a5cd9..197cefe819 100644 --- a/client/ayon_core/tools/push_to_project/models/integrate.py +++ b/client/ayon_core/tools/push_to_project/models/integrate.py @@ -1164,7 +1164,7 @@ class ProjectPushItemProcess: thumbnail_id ) if not path: - return + return None return ayon_api.create_thumbnail( self._item.dst_project_name, path From 8d4bcd1310c5c71e74785fbb11a421f8a8c45e72 Mon Sep 17 00:00:00 2001 From: Petr Kalis Date: Mon, 18 Aug 2025 16:41:31 +0200 Subject: [PATCH 23/26] Typing Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> --- client/ayon_core/tools/push_to_project/models/integrate.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/ayon_core/tools/push_to_project/models/integrate.py b/client/ayon_core/tools/push_to_project/models/integrate.py index 197cefe819..c512d3ef68 100644 --- a/client/ayon_core/tools/push_to_project/models/integrate.py +++ b/client/ayon_core/tools/push_to_project/models/integrate.py @@ -1153,7 +1153,7 @@ class ProjectPushItemProcess: {"active": False} ) - def _copy_version_thumbnail(self): + def _copy_version_thumbnail(self) -> Optional[str]: thumbnail_id = self._src_version_entity["thumbnailId"] if not thumbnail_id: return None From 3b9b5e8063d3c44615ffa8cda43cd2fcd279cc98 Mon Sep 17 00:00:00 2001 From: Petr Kalis Date: Mon, 18 Aug 2025 16:50:55 +0200 Subject: [PATCH 24/26] Removed run argument to not filter out project argument Current develop filters out 'project' cli argument as it is now used as key world for bundle per project implementation. --- client/ayon_core/plugins/load/push_to_library.py | 1 - 1 file changed, 1 deletion(-) diff --git a/client/ayon_core/plugins/load/push_to_library.py b/client/ayon_core/plugins/load/push_to_library.py index 22c10bbad7..3c7c7e503d 100644 --- a/client/ayon_core/plugins/load/push_to_library.py +++ b/client/ayon_core/plugins/load/push_to_library.py @@ -44,7 +44,6 @@ class PushToLibraryProject(load.ProductLoaderPlugin): version_id = context["version"]["id"] args = get_ayon_launcher_args( - "run", push_tool_script_path, "--project", project_name, "--version", version_id From ef34e9f79eebe12f3f1fdf845e1963a8dd83cd0b Mon Sep 17 00:00:00 2001 From: Petr Kalis Date: Mon, 18 Aug 2025 16:53:33 +0200 Subject: [PATCH 25/26] Renamed loader --- .../plugins/load/{push_to_library.py => push_to_project.py} | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename client/ayon_core/plugins/load/{push_to_library.py => push_to_project.py} (91%) diff --git a/client/ayon_core/plugins/load/push_to_library.py b/client/ayon_core/plugins/load/push_to_project.py similarity index 91% rename from client/ayon_core/plugins/load/push_to_library.py rename to client/ayon_core/plugins/load/push_to_project.py index 3c7c7e503d..dccac42444 100644 --- a/client/ayon_core/plugins/load/push_to_library.py +++ b/client/ayon_core/plugins/load/push_to_project.py @@ -6,8 +6,8 @@ from ayon_core.pipeline import load from ayon_core.pipeline.load import LoadError -class PushToLibraryProject(load.ProductLoaderPlugin): - """Export selected versions to folder structure from Template""" +class PushToProject(load.ProductLoaderPlugin): + """Export selected versions to different project""" is_multiple_contexts_compatible = True From bae1f64a91d8b4ec74bdb059048d42b96b4e346e Mon Sep 17 00:00:00 2001 From: Petr Kalis Date: Mon, 18 Aug 2025 16:55:28 +0200 Subject: [PATCH 26/26] Fix typing --- client/ayon_core/tools/push_to_project/models/integrate.py | 1 + 1 file changed, 1 insertion(+) diff --git a/client/ayon_core/tools/push_to_project/models/integrate.py b/client/ayon_core/tools/push_to_project/models/integrate.py index c512d3ef68..89cd78cb0e 100644 --- a/client/ayon_core/tools/push_to_project/models/integrate.py +++ b/client/ayon_core/tools/push_to_project/models/integrate.py @@ -5,6 +5,7 @@ import itertools import sys import traceback import uuid +from typing import Optional import ayon_api from ayon_api.utils import create_entity_id