From 6f2191128dc6b8fc14a6ba419c4f5ffa848aa132 Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Mon, 11 Dec 2023 10:42:34 +0100 Subject: [PATCH 01/47] Refactor create_editorial.py for better track handling - Refactored the code to filter tracks based on their kind being "Video" - Added a comment to clarify the purpose of media_data variable - Added a comment to explain setting track name - Removed an unnecessary blank line --- .../plugins/create/create_editorial.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/openpype/hosts/traypublisher/plugins/create/create_editorial.py b/openpype/hosts/traypublisher/plugins/create/create_editorial.py index dce4a051fd..e6f29af40f 100644 --- a/openpype/hosts/traypublisher/plugins/create/create_editorial.py +++ b/openpype/hosts/traypublisher/plugins/create/create_editorial.py @@ -381,15 +381,19 @@ or updating already created. Publishing will create OTIO file. """ self.asset_name_check = [] - tracks = otio_timeline.each_child( - descended_from_type=otio.schema.Track - ) + tracks = [ + track for track in otio_timeline.each_child( + descended_from_type=otio.schema.Track) + if track.kind == "Video" + ] - # media data for audio sream and reference solving + # media data for audio stream and reference solving media_data = self._get_media_source_metadata(media_path) for track in tracks: + # set track name track.name = f"{sequence_file_name} - {otio_timeline.name}" + try: track_start_frame = ( abs(track.source_range.start_time.value) @@ -398,7 +402,6 @@ or updating already created. Publishing will create OTIO file. except AttributeError: track_start_frame = 0 - for clip in track.each_child(): if not self._validate_clip_for_processing(clip): continue From fc179befc24469b39325e0ec12517263cb313410 Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Mon, 11 Dec 2023 10:43:11 +0100 Subject: [PATCH 02/47] improving plugin label so it is easier to read --- openpype/plugins/publish/validate_resources.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openpype/plugins/publish/validate_resources.py b/openpype/plugins/publish/validate_resources.py index 7911c70c2d..ce03515400 100644 --- a/openpype/plugins/publish/validate_resources.py +++ b/openpype/plugins/publish/validate_resources.py @@ -17,7 +17,7 @@ class ValidateResources(pyblish.api.InstancePlugin): """ order = ValidateContentsOrder - label = "Resources" + label = "Validate Resources" def process(self, instance): From dadf8989be620616cdebc0bc3ee99dc3ba9d9ebd Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Fri, 26 Jan 2024 16:45:44 +0100 Subject: [PATCH 03/47] Use QDialog as super class and pass parent to init --- openpype/tools/publisher/window.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openpype/tools/publisher/window.py b/openpype/tools/publisher/window.py index 5dd6998b24..de1a6249ad 100644 --- a/openpype/tools/publisher/window.py +++ b/openpype/tools/publisher/window.py @@ -42,7 +42,7 @@ from .widgets import ( ) -class PublisherWindow(QtWidgets.QWidget): +class PublisherWindow(QtWidgets.QDialog): """Main window of publisher.""" default_width = 1300 default_height = 800 @@ -50,7 +50,7 @@ class PublisherWindow(QtWidgets.QWidget): publish_footer_spacer = 2 def __init__(self, parent=None, controller=None, reset_on_show=None): - super(PublisherWindow, self).__init__() + super(PublisherWindow, self).__init__(parent) self.setObjectName("PublishWindow") From 34b42c132d56a69c190681b6b3aad0c4c8f06369 Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Fri, 26 Jan 2024 16:46:03 +0100 Subject: [PATCH 04/47] ignore enter and return event key --- openpype/tools/publisher/window.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/openpype/tools/publisher/window.py b/openpype/tools/publisher/window.py index de1a6249ad..ab337c9b32 100644 --- a/openpype/tools/publisher/window.py +++ b/openpype/tools/publisher/window.py @@ -328,7 +328,6 @@ class PublisherWindow(QtWidgets.QDialog): "copy_report.request", self._copy_report ) - # Store extra header widget for TrayPublisher # - can be used to add additional widgets to header between context # label and help button @@ -492,7 +491,11 @@ class PublisherWindow(QtWidgets.QDialog): def keyPressEvent(self, event): # Ignore escape button to close window - if event.key() == QtCore.Qt.Key_Escape: + if event.key() in { + QtCore.Qt.Key_Escape, + QtCore.Qt.Key_Enter, + QtCore.Qt.Key_Return, + }: event.accept() return From 87b4b6e483de6dfc5db677a8fbc848f24cedda3a Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Fri, 26 Jan 2024 17:43:09 +0100 Subject: [PATCH 05/47] removed '_make_sure_on_top' --- openpype/tools/publisher/window.py | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/openpype/tools/publisher/window.py b/openpype/tools/publisher/window.py index ab337c9b32..5b56802055 100644 --- a/openpype/tools/publisher/window.py +++ b/openpype/tools/publisher/window.py @@ -294,12 +294,6 @@ class PublisherWindow(QtWidgets.QDialog): controller.event_system.add_callback( "publish.process.stopped", self._on_publish_stop ) - controller.event_system.add_callback( - "publish.process.instance.changed", self._on_instance_change - ) - controller.event_system.add_callback( - "publish.process.plugin.changed", self._on_plugin_change - ) controller.event_system.add_callback( "show.card.message", self._on_overlay_message ) @@ -561,18 +555,6 @@ class PublisherWindow(QtWidgets.QDialog): self._reset_on_show = False self.reset() - def _make_sure_on_top(self): - """Raise window to top and activate it. - - This may not work for some DCCs without Qt. - """ - - if not self._window_is_visible: - self.show() - - self.setWindowState(QtCore.Qt.WindowActive) - self.raise_() - def _checks_before_save(self, explicit_save): """Save of changes may trigger some issues. @@ -885,12 +867,6 @@ class PublisherWindow(QtWidgets.QDialog): if self._is_on_create_tab(): self._go_to_publish_tab() - def _on_instance_change(self): - self._make_sure_on_top() - - def _on_plugin_change(self): - self._make_sure_on_top() - def _on_publish_validated_change(self, event): if event["value"]: self._validate_btn.setEnabled(False) @@ -901,7 +877,6 @@ class PublisherWindow(QtWidgets.QDialog): self._comment_input.setText("") def _on_publish_stop(self): - self._make_sure_on_top() self._set_publish_overlay_visibility(False) self._reset_btn.setEnabled(True) self._stop_btn.setEnabled(False) From 781bd615a6506dd36d5c69c90393596a3a35e299 Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Fri, 26 Jan 2024 17:53:30 +0100 Subject: [PATCH 06/47] add comments to enter and return keys --- openpype/tools/publisher/window.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/openpype/tools/publisher/window.py b/openpype/tools/publisher/window.py index 5b56802055..82c7b167b7 100644 --- a/openpype/tools/publisher/window.py +++ b/openpype/tools/publisher/window.py @@ -484,9 +484,11 @@ class PublisherWindow(QtWidgets.QDialog): app.removeEventFilter(self) def keyPressEvent(self, event): - # Ignore escape button to close window if event.key() in { + # Ignore escape button to close window QtCore.Qt.Key_Escape, + # Ignore enter keyboard event which by default triggers + # first available button in QDialog QtCore.Qt.Key_Enter, QtCore.Qt.Key_Return, }: From 0bbe25fab1b7259c118c03f37748a4bc570eb530 Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Mon, 29 Jan 2024 16:57:15 +0100 Subject: [PATCH 07/47] Refactor code for creating and publishing editorial clips - renaming variable to specify correctly value type - Added a condition in `collect_shot_instances.py` to check if the parent kind is "Video" before collecting shot instances. --- .../plugins/create/create_editorial.py | 13 +++++++------ .../plugins/publish/collect_shot_instances.py | 1 + 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/openpype/hosts/traypublisher/plugins/create/create_editorial.py b/openpype/hosts/traypublisher/plugins/create/create_editorial.py index e6f29af40f..3898635254 100644 --- a/openpype/hosts/traypublisher/plugins/create/create_editorial.py +++ b/openpype/hosts/traypublisher/plugins/create/create_editorial.py @@ -402,18 +402,19 @@ or updating already created. Publishing will create OTIO file. except AttributeError: track_start_frame = 0 - for clip in track.each_child(): - if not self._validate_clip_for_processing(clip): + for otio_clip in track.each_child(): + if not self._validate_clip_for_processing(otio_clip): continue + # get available frames info to clip data - self._create_otio_reference(clip, media_path, media_data) + self._create_otio_reference(otio_clip, media_path, media_data) # convert timeline range to source range - self._restore_otio_source_range(clip) + self._restore_otio_source_range(otio_clip) base_instance_data = self._get_base_instance_data( - clip, + otio_clip, instance_data, track_start_frame ) @@ -432,7 +433,7 @@ or updating already created. Publishing will create OTIO file. continue instance = self._make_subset_instance( - clip, + otio_clip, _fpreset, deepcopy(base_instance_data), parenting_data diff --git a/openpype/hosts/traypublisher/plugins/publish/collect_shot_instances.py b/openpype/hosts/traypublisher/plugins/publish/collect_shot_instances.py index b99b634da1..43f6518374 100644 --- a/openpype/hosts/traypublisher/plugins/publish/collect_shot_instances.py +++ b/openpype/hosts/traypublisher/plugins/publish/collect_shot_instances.py @@ -79,6 +79,7 @@ class CollectShotInstance(pyblish.api.InstancePlugin): clip for clip in otio_timeline.each_child( descended_from_type=otio.schema.Clip) if clip.name == otio_clip.name + if clip.parent().kind == "Video" ] otio_clip = clips.pop() From 449e601a5fe37617d7c663b47f9d0bd45b083aec Mon Sep 17 00:00:00 2001 From: Toke Stuart Jepsen Date: Mon, 29 Jan 2024 17:39:28 +0000 Subject: [PATCH 08/47] Show message with error on action failure. --- openpype/tools/publisher/control.py | 15 +++++++++++++++ openpype/tools/publisher/window.py | 15 +++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/openpype/tools/publisher/control.py b/openpype/tools/publisher/control.py index 47e374edf2..0137d5c95f 100644 --- a/openpype/tools/publisher/control.py +++ b/openpype/tools/publisher/control.py @@ -2329,6 +2329,21 @@ class PublisherController(BasePublisherController): result = pyblish.plugin.process( plugin, self._publish_context, None, action.id ) + exception = result.get("error") + if exception: + self._emit_event( + "action.failed", + { + "title": "Action failed", + "message": "Action failed.", + "traceback": "".join( + traceback.format_exception(exception) + ), + "label": "", + "identifier": action.__name__ + } + ) + self._publish_report.add_action_result(action, result) def _publish_next_process(self): diff --git a/openpype/tools/publisher/window.py b/openpype/tools/publisher/window.py index 5dd6998b24..e5b47f4309 100644 --- a/openpype/tools/publisher/window.py +++ b/openpype/tools/publisher/window.py @@ -321,6 +321,9 @@ class PublisherWindow(QtWidgets.QWidget): controller.event_system.add_callback( "convertors.find.failed", self._on_convertor_error ) + controller.event_system.add_callback( + "action.failed", self._on_action_error + ) controller.event_system.add_callback( "export_report.request", self._export_report ) @@ -1012,6 +1015,18 @@ class PublisherWindow(QtWidgets.QWidget): event["title"], new_failed_info, "Convertor:" ) + def _on_action_error(self, event): + self.add_error_message_dialog( + event["title"], + [{ + "message": event["message"], + "traceback": event["traceback"], + "label": event["label"], + "identifier": event["identifier"] + }], + "Action:" + ) + def _update_create_overlay_size(self): metrics = self._create_overlay_button.fontMetrics() height = int(metrics.height()) From 2b3160773332c53cc4e923e897ea532e06d7c968 Mon Sep 17 00:00:00 2001 From: Toke Stuart Jepsen Date: Tue, 30 Jan 2024 10:57:59 +0000 Subject: [PATCH 09/47] Feedback action finished. --- openpype/tools/publisher/control.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/openpype/tools/publisher/control.py b/openpype/tools/publisher/control.py index 0137d5c95f..61528c7c88 100644 --- a/openpype/tools/publisher/control.py +++ b/openpype/tools/publisher/control.py @@ -2346,6 +2346,8 @@ class PublisherController(BasePublisherController): self._publish_report.add_action_result(action, result) + self.emit_card_message("Action finished.") + def _publish_next_process(self): # Validations of progress before using iterator # - same conditions may be inside iterator but they may be used From d0a09bcad47299e341152cb47a600abc3d269f43 Mon Sep 17 00:00:00 2001 From: Toke Stuart Jepsen Date: Wed, 31 Jan 2024 07:15:36 +0000 Subject: [PATCH 10/47] Illicit suggestion --- openpype/tools/publisher/control.py | 2 +- openpype/tools/publisher/window.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/openpype/tools/publisher/control.py b/openpype/tools/publisher/control.py index 61528c7c88..9bae0deac8 100644 --- a/openpype/tools/publisher/control.py +++ b/openpype/tools/publisher/control.py @@ -2332,7 +2332,7 @@ class PublisherController(BasePublisherController): exception = result.get("error") if exception: self._emit_event( - "action.failed", + "publish.action.failed", { "title": "Action failed", "message": "Action failed.", diff --git a/openpype/tools/publisher/window.py b/openpype/tools/publisher/window.py index e5b47f4309..193b6948a5 100644 --- a/openpype/tools/publisher/window.py +++ b/openpype/tools/publisher/window.py @@ -322,7 +322,7 @@ class PublisherWindow(QtWidgets.QWidget): "convertors.find.failed", self._on_convertor_error ) controller.event_system.add_callback( - "action.failed", self._on_action_error + "publish.action.failed", self._on_action_error ) controller.event_system.add_callback( "export_report.request", self._export_report From 149f53daff8a4267fc0a45370bcd414db00d7981 Mon Sep 17 00:00:00 2001 From: Toke Stuart Jepsen Date: Wed, 31 Jan 2024 09:15:11 +0000 Subject: [PATCH 11/47] identifier > name --- openpype/tools/publisher/control.py | 2 +- openpype/tools/publisher/window.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/openpype/tools/publisher/control.py b/openpype/tools/publisher/control.py index 9bae0deac8..23ef6ae6c1 100644 --- a/openpype/tools/publisher/control.py +++ b/openpype/tools/publisher/control.py @@ -2340,7 +2340,7 @@ class PublisherController(BasePublisherController): traceback.format_exception(exception) ), "label": "", - "identifier": action.__name__ + "name": action.__name__ } ) diff --git a/openpype/tools/publisher/window.py b/openpype/tools/publisher/window.py index 193b6948a5..f4de3a08f7 100644 --- a/openpype/tools/publisher/window.py +++ b/openpype/tools/publisher/window.py @@ -1022,7 +1022,7 @@ class PublisherWindow(QtWidgets.QWidget): "message": event["message"], "traceback": event["traceback"], "label": event["label"], - "identifier": event["identifier"] + "identifier": event["name"] }], "Action:" ) From b39c41f98a5ece76b6466ab08e8e55e7462df8a3 Mon Sep 17 00:00:00 2001 From: Toke Stuart Jepsen Date: Wed, 31 Jan 2024 10:01:02 +0000 Subject: [PATCH 12/47] Use label --- openpype/tools/publisher/control.py | 4 ++-- openpype/tools/publisher/window.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/openpype/tools/publisher/control.py b/openpype/tools/publisher/control.py index 23ef6ae6c1..13d007dd35 100644 --- a/openpype/tools/publisher/control.py +++ b/openpype/tools/publisher/control.py @@ -2339,8 +2339,8 @@ class PublisherController(BasePublisherController): "traceback": "".join( traceback.format_exception(exception) ), - "label": "", - "name": action.__name__ + "label": action.__name__, + "identifier": action.id } ) diff --git a/openpype/tools/publisher/window.py b/openpype/tools/publisher/window.py index f4de3a08f7..193b6948a5 100644 --- a/openpype/tools/publisher/window.py +++ b/openpype/tools/publisher/window.py @@ -1022,7 +1022,7 @@ class PublisherWindow(QtWidgets.QWidget): "message": event["message"], "traceback": event["traceback"], "label": event["label"], - "identifier": event["name"] + "identifier": event["identifier"] }], "Action:" ) From 27f869e204662ba9a0dd78400269499145a60ec1 Mon Sep 17 00:00:00 2001 From: Toke Stuart Jepsen Date: Thu, 1 Feb 2024 11:49:25 +0000 Subject: [PATCH 13/47] Fix error report --- openpype/hosts/nuke/plugins/publish/validate_write_nodes.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openpype/hosts/nuke/plugins/publish/validate_write_nodes.py b/openpype/hosts/nuke/plugins/publish/validate_write_nodes.py index f490b580d6..648025adad 100644 --- a/openpype/hosts/nuke/plugins/publish/validate_write_nodes.py +++ b/openpype/hosts/nuke/plugins/publish/validate_write_nodes.py @@ -129,7 +129,7 @@ class ValidateNukeWriteNode( and key != "file" and key != "tile_color" ): - check.append([key, node_value, write_node[key].value()]) + check.append([key, fixed_values, write_node[key].value()]) if check: self._make_error(check) @@ -137,7 +137,7 @@ class ValidateNukeWriteNode( def _make_error(self, check): # sourcery skip: merge-assign-and-aug-assign, move-assign-in-block dbg_msg = "Write node's knobs values are not correct!\n" - msg_add = "Knob '{0}' > Correct: `{1}` > Wrong: `{2}`" + msg_add = "Knob '{0}' > Expected: `{1}` > Current: `{2}`" details = [ msg_add.format(item[0], item[1], item[2]) From b26ea7a62039ba766085377bf51b8b521f8014a9 Mon Sep 17 00:00:00 2001 From: Toke Stuart Jepsen Date: Thu, 1 Feb 2024 12:18:46 +0000 Subject: [PATCH 14/47] Fix getting node and node name. --- openpype/hosts/nuke/plugins/load/load_camera_abc.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/openpype/hosts/nuke/plugins/load/load_camera_abc.py b/openpype/hosts/nuke/plugins/load/load_camera_abc.py index 898c5e4e7b..7f0452d6d4 100644 --- a/openpype/hosts/nuke/plugins/load/load_camera_abc.py +++ b/openpype/hosts/nuke/plugins/load/load_camera_abc.py @@ -112,8 +112,6 @@ class AlembicCameraLoader(load.LoaderPlugin): project_name = get_current_project_name() version_doc = get_version_by_id(project_name, representation["parent"]) - object_name = container["node"] - # get main variables version_data = version_doc.get("data", {}) vname = version_doc.get("name", None) @@ -139,7 +137,7 @@ class AlembicCameraLoader(load.LoaderPlugin): file = get_representation_path(representation).replace("\\", "/") with maintained_selection(): - camera_node = nuke.toNode(object_name) + camera_node = container["node"] camera_node['selected'].setValue(True) # collect input output dependencies @@ -154,9 +152,10 @@ class AlembicCameraLoader(load.LoaderPlugin): xpos = camera_node.xpos() ypos = camera_node.ypos() nuke.nodeCopy("%clipboard%") + camera_name = camera_node.name() nuke.delete(camera_node) nuke.nodePaste("%clipboard%") - camera_node = nuke.toNode(object_name) + camera_node = nuke.toNode(camera_name) camera_node.setXYpos(xpos, ypos) # link to original input nodes From f5c38eb8d794fc6f3f3517322a796d18d8036d82 Mon Sep 17 00:00:00 2001 From: Toke Stuart Jepsen Date: Mon, 5 Feb 2024 10:25:01 +0000 Subject: [PATCH 15/47] Thumbnail subset filtering --- openpype/plugins/publish/extract_thumbnail.py | 30 +++++++++++++++++-- .../defaults/project_settings/global.json | 1 + .../schemas/schema_global_publish.json | 6 ++++ .../core/server/settings/publish_plugins.py | 5 ++++ server_addon/core/server/version.py | 2 +- 5 files changed, 40 insertions(+), 4 deletions(-) diff --git a/openpype/plugins/publish/extract_thumbnail.py b/openpype/plugins/publish/extract_thumbnail.py index 10eb261482..6008b8323d 100644 --- a/openpype/plugins/publish/extract_thumbnail.py +++ b/openpype/plugins/publish/extract_thumbnail.py @@ -2,6 +2,7 @@ import copy import os import subprocess import tempfile +import re import pyblish.api from openpype.lib import ( @@ -14,9 +15,10 @@ from openpype.lib import ( path_to_subprocess_arg, run_subprocess, ) -from openpype.lib.transcoding import convert_colorspace - -from openpype.lib.transcoding import VIDEO_EXTENSIONS +from openpype.lib.transcoding import ( + convert_colorspace, + VIDEO_EXTENSIONS, +) class ExtractThumbnail(pyblish.api.InstancePlugin): @@ -49,6 +51,8 @@ class ExtractThumbnail(pyblish.api.InstancePlugin): # attribute presets from settings oiiotool_defaults = None ffmpeg_args = None + subsets = [] + product_names = [] def process(self, instance): # run main process @@ -103,6 +107,26 @@ class ExtractThumbnail(pyblish.api.InstancePlugin): self.log.debug("Skipping crypto passes.") return + # We only want to process the subsets needed from settings. + def validate_string_against_patterns(input_str, patterns): + for pattern in patterns: + if re.match(pattern, input_str): + return True + return False + + product_names = self.subsets + self.product_names + if product_names: + result = validate_string_against_patterns( + instance.data["subset"], product_names + ) + if not result: + self.log.debug( + "Subset \"{}\" did not match any valid subsets: {}".format( + instance.data["subset"], product_names + ) + ) + return + # first check for any explicitly marked representations for thumbnail explicit_repres = self._get_explicit_repres_for_thumbnail(instance) if explicit_repres: diff --git a/openpype/settings/defaults/project_settings/global.json b/openpype/settings/defaults/project_settings/global.json index bb7e3266bd..782fff1052 100644 --- a/openpype/settings/defaults/project_settings/global.json +++ b/openpype/settings/defaults/project_settings/global.json @@ -70,6 +70,7 @@ }, "ExtractThumbnail": { "enabled": true, + "subsets": [], "integrate_thumbnail": false, "background_color": [ 0, diff --git a/openpype/settings/entities/schemas/projects_schema/schemas/schema_global_publish.json b/openpype/settings/entities/schemas/projects_schema/schemas/schema_global_publish.json index 64f292a140..226a190dd4 100644 --- a/openpype/settings/entities/schemas/projects_schema/schemas/schema_global_publish.json +++ b/openpype/settings/entities/schemas/projects_schema/schemas/schema_global_publish.json @@ -202,6 +202,12 @@ "key": "enabled", "label": "Enabled" }, + { + "type": "list", + "object_type": "text", + "key": "subsets", + "label": "Subsets" + }, { "type": "boolean", "key": "integrate_thumbnail", diff --git a/server_addon/core/server/settings/publish_plugins.py b/server_addon/core/server/settings/publish_plugins.py index 7aa86aafa6..8506801e7e 100644 --- a/server_addon/core/server/settings/publish_plugins.py +++ b/server_addon/core/server/settings/publish_plugins.py @@ -176,6 +176,10 @@ class ExtractThumbnailOIIODefaultsModel(BaseSettingsModel): class ExtractThumbnailModel(BaseSettingsModel): _isGroup = True enabled: bool = SettingsField(True) + product_names: list[str] = SettingsField( + default_factory=list, + title="Product names" + ) integrate_thumbnail: bool = SettingsField( True, title="Integrate Thumbnail Representation" @@ -844,6 +848,7 @@ DEFAULT_PUBLISH_VALUES = { }, "ExtractThumbnail": { "enabled": True, + "product_names": [], "integrate_thumbnail": True, "target_size": { "type": "source" diff --git a/server_addon/core/server/version.py b/server_addon/core/server/version.py index bbab0242f6..1276d0254f 100644 --- a/server_addon/core/server/version.py +++ b/server_addon/core/server/version.py @@ -1 +1 @@ -__version__ = "0.1.4" +__version__ = "0.1.5" From 6290343ce7b9b1facebcb7148fc41f775d9ae5fe Mon Sep 17 00:00:00 2001 From: Petr Kalis Date: Mon, 5 Feb 2024 12:24:48 +0100 Subject: [PATCH 16/47] Use better resolution of Ayon apps on 4k display Special get_qt_app is used instead of shared get_openpype_qt_app as we don't want to set application icon. --- openpype/hosts/fusion/api/menu.py | 32 ++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/openpype/hosts/fusion/api/menu.py b/openpype/hosts/fusion/api/menu.py index 0b9ad1a43b..53ff5af767 100644 --- a/openpype/hosts/fusion/api/menu.py +++ b/openpype/hosts/fusion/api/menu.py @@ -173,8 +173,38 @@ class OpenPypeMenu(QtWidgets.QWidget): set_asset_framerange() +def get_qt_app(): + """Main Qt application.""" + + app = QtWidgets.QApplication.instance() + if app is None: + for attr_name in ( + "AA_EnableHighDpiScaling", + "AA_UseHighDpiPixmaps", + ): + attr = getattr(QtCore.Qt, attr_name, None) + if attr is not None: + QtWidgets.QApplication.setAttribute(attr) + + policy = os.getenv("QT_SCALE_FACTOR_ROUNDING_POLICY") + if ( + hasattr( + QtWidgets.QApplication, "setHighDpiScaleFactorRoundingPolicy" + ) + and not policy + ): + QtWidgets.QApplication.setHighDpiScaleFactorRoundingPolicy( + QtCore.Qt.HighDpiScaleFactorRoundingPolicy.PassThrough + ) + + app = QtWidgets.QApplication(sys.argv) + + return app + + def launch_openpype_menu(): - app = QtWidgets.QApplication(sys.argv) + + app = get_qt_app() pype_menu = OpenPypeMenu() From 9452cdb06d289aced41d4bffb0104f6fc24d2ab5 Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Mon, 5 Feb 2024 13:45:04 +0100 Subject: [PATCH 17/47] define 'get_qt_app' in tools utils --- openpype/hosts/fusion/api/menu.py | 30 +----------------------------- openpype/tools/utils/__init__.py | 1 + openpype/tools/utils/lib.py | 23 +++++++++++++++++++---- 3 files changed, 21 insertions(+), 33 deletions(-) diff --git a/openpype/hosts/fusion/api/menu.py b/openpype/hosts/fusion/api/menu.py index 53ff5af767..ff4a734928 100644 --- a/openpype/hosts/fusion/api/menu.py +++ b/openpype/hosts/fusion/api/menu.py @@ -15,6 +15,7 @@ from openpype.hosts.fusion.api.lib import ( ) from openpype.pipeline import get_current_asset_name from openpype.resources import get_openpype_icon_filepath +from openpype.tools.utils import get_qt_app from .pipeline import FusionEventHandler from .pulse import FusionPulse @@ -173,35 +174,6 @@ class OpenPypeMenu(QtWidgets.QWidget): set_asset_framerange() -def get_qt_app(): - """Main Qt application.""" - - app = QtWidgets.QApplication.instance() - if app is None: - for attr_name in ( - "AA_EnableHighDpiScaling", - "AA_UseHighDpiPixmaps", - ): - attr = getattr(QtCore.Qt, attr_name, None) - if attr is not None: - QtWidgets.QApplication.setAttribute(attr) - - policy = os.getenv("QT_SCALE_FACTOR_ROUNDING_POLICY") - if ( - hasattr( - QtWidgets.QApplication, "setHighDpiScaleFactorRoundingPolicy" - ) - and not policy - ): - QtWidgets.QApplication.setHighDpiScaleFactorRoundingPolicy( - QtCore.Qt.HighDpiScaleFactorRoundingPolicy.PassThrough - ) - - app = QtWidgets.QApplication(sys.argv) - - return app - - def launch_openpype_menu(): app = get_qt_app() diff --git a/openpype/tools/utils/__init__.py b/openpype/tools/utils/__init__.py index 50d50f467a..74702a2a10 100644 --- a/openpype/tools/utils/__init__.py +++ b/openpype/tools/utils/__init__.py @@ -32,6 +32,7 @@ from .lib import ( set_style_property, DynamicQThread, qt_app_context, + get_qt_app, get_openpype_qt_app, get_asset_icon, get_asset_icon_by_name, diff --git a/openpype/tools/utils/lib.py b/openpype/tools/utils/lib.py index 365caaafd9..c7f92dd26e 100644 --- a/openpype/tools/utils/lib.py +++ b/openpype/tools/utils/lib.py @@ -154,11 +154,15 @@ def qt_app_context(): yield app -def get_openpype_qt_app(): - """Main Qt application initialized for OpenPype processed. +def get_qt_app(): + """Get Qt application. - This function should be used only inside OpenPype process and never inside - other processes. + The function initializes new Qt application if it is not already + initialized. It also sets some attributes to the application to + ensure that it will work properly on high DPI displays. + + Returns: + QtWidgets.QApplication: Current Qt application. """ app = QtWidgets.QApplication.instance() @@ -184,6 +188,17 @@ def get_openpype_qt_app(): app = QtWidgets.QApplication(sys.argv) + return app + + +def get_openpype_qt_app(): + """Main Qt application initialized for OpenPype processed. + + This function should be used only inside OpenPype process and never inside + other processes. + """ + + app = get_qt_app() app.setWindowIcon(QtGui.QIcon(get_app_icon_path())) return app From 1c9c125dc2dcb6662c69cff95f881263b49711c5 Mon Sep 17 00:00:00 2001 From: Braden Jennings Date: Wed, 7 Feb 2024 11:00:33 +1300 Subject: [PATCH 18/47] enhancement/OP-8033 --- openpype/modules/timers_manager/timers_manager.py | 5 +++-- openpype/modules/timers_manager/widget_user_idle.py | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/openpype/modules/timers_manager/timers_manager.py b/openpype/modules/timers_manager/timers_manager.py index 674d834a1d..e684737d5e 100644 --- a/openpype/modules/timers_manager/timers_manager.py +++ b/openpype/modules/timers_manager/timers_manager.py @@ -162,6 +162,7 @@ class TimersManager( def tray_start(self, *_a, **_kw): if self._idle_manager: self._idle_manager.start() + self.show_message() def tray_exit(self): if self._idle_manager: @@ -373,8 +374,8 @@ class TimersManager( ).format(module.name)) def show_message(self): - if self.is_running is False: - return + # if self.is_running is False: + # return if not self._widget_user_idle.is_showed(): self._widget_user_idle.reset_countdown() self._widget_user_idle.show() diff --git a/openpype/modules/timers_manager/widget_user_idle.py b/openpype/modules/timers_manager/widget_user_idle.py index 9df328e6b2..8cc78cf102 100644 --- a/openpype/modules/timers_manager/widget_user_idle.py +++ b/openpype/modules/timers_manager/widget_user_idle.py @@ -17,6 +17,7 @@ class WidgetUserIdle(QtWidgets.QWidget): self.setWindowFlags( QtCore.Qt.WindowCloseButtonHint | QtCore.Qt.WindowMinimizeButtonHint + | QtCore.Qt.WindowStaysOnTopHint ) self._is_showed = False From 1d3c1c7c6c0bb5a0a4bd3c62e91c7a58e1a72c86 Mon Sep 17 00:00:00 2001 From: Braden Jennings Date: Wed, 7 Feb 2024 11:06:28 +1300 Subject: [PATCH 19/47] enhancement/OP-8033 --- openpype/modules/timers_manager/timers_manager.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/openpype/modules/timers_manager/timers_manager.py b/openpype/modules/timers_manager/timers_manager.py index e684737d5e..674d834a1d 100644 --- a/openpype/modules/timers_manager/timers_manager.py +++ b/openpype/modules/timers_manager/timers_manager.py @@ -162,7 +162,6 @@ class TimersManager( def tray_start(self, *_a, **_kw): if self._idle_manager: self._idle_manager.start() - self.show_message() def tray_exit(self): if self._idle_manager: @@ -374,8 +373,8 @@ class TimersManager( ).format(module.name)) def show_message(self): - # if self.is_running is False: - # return + if self.is_running is False: + return if not self._widget_user_idle.is_showed(): self._widget_user_idle.reset_countdown() self._widget_user_idle.show() From bac4f6d9bd2b53b97c01eb7d40bda7415b062e0b Mon Sep 17 00:00:00 2001 From: Ynbot Date: Wed, 7 Feb 2024 03:25:17 +0000 Subject: [PATCH 20/47] [Automated] Bump version --- openpype/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openpype/version.py b/openpype/version.py index db6da9f656..d105b0169e 100644 --- a/openpype/version.py +++ b/openpype/version.py @@ -1,3 +1,3 @@ # -*- coding: utf-8 -*- """Package declaring Pype version.""" -__version__ = "3.18.7-nightly.1" +__version__ = "3.18.7-nightly.2" From 4243ee427cd24d9eb67fdd38c051c2388eb45e27 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 7 Feb 2024 03:25:56 +0000 Subject: [PATCH 21/47] chore(): update bug report / version --- .github/ISSUE_TEMPLATE/bug_report.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 54a9d69bdc..f751a54116 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -35,6 +35,7 @@ body: label: Version description: What version are you running? Look to OpenPype Tray options: + - 3.18.7-nightly.2 - 3.18.7-nightly.1 - 3.18.6 - 3.18.6-nightly.2 @@ -134,7 +135,6 @@ body: - 3.15.10-nightly.1 - 3.15.9 - 3.15.9-nightly.2 - - 3.15.9-nightly.1 validations: required: true - type: dropdown From 5b9b26050d071b48c5141faffa46d439473f5f20 Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Wed, 7 Feb 2024 10:47:41 +0100 Subject: [PATCH 22/47] feat: Add settings category for Tray Publisher This commit adds a new settings category for the Tray Publisher plugin in order to organize its configuration options more effectively. --- openpype/hosts/traypublisher/api/plugin.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/openpype/hosts/traypublisher/api/plugin.py b/openpype/hosts/traypublisher/api/plugin.py index 6859b85a46..a6075f0eb5 100644 --- a/openpype/hosts/traypublisher/api/plugin.py +++ b/openpype/hosts/traypublisher/api/plugin.py @@ -32,6 +32,7 @@ SHARED_DATA_KEY = "openpype.traypublisher.instances" class HiddenTrayPublishCreator(HiddenCreator): host_name = "traypublisher" + settings_category = "traypublisher" def collect_instances(self): instances_by_identifier = cache_and_get_instances( @@ -68,6 +69,7 @@ class HiddenTrayPublishCreator(HiddenCreator): class TrayPublishCreator(Creator): create_allow_context_change = True host_name = "traypublisher" + settings_category = "traypublisher" def collect_instances(self): instances_by_identifier = cache_and_get_instances( From 1fcdde0a9cc3a8b31697540ce320286d83d30e99 Mon Sep 17 00:00:00 2001 From: Petr Kalis Date: Thu, 8 Feb 2024 13:46:56 +0100 Subject: [PATCH 23/47] AfterEffects: added toggle for applying values from DB during creation (#6204) * OP-8130 - After Effects added flag to force values from Asset to composition during creation This allows controlling setting of values (resolution, duration) from Asset (DB) to the created instance. Default is to set it automatically. * OP-8130 - Ayon version of Settings for AE creator --- openpype/hosts/aftereffects/plugins/create/create_render.py | 6 +++++- .../settings/defaults/project_settings/aftereffects.json | 3 ++- .../projects_schema/schema_project_aftereffects.json | 6 ++++++ .../aftereffects/server/settings/creator_plugins.py | 2 ++ server_addon/aftereffects/server/version.py | 2 +- 5 files changed, 16 insertions(+), 3 deletions(-) diff --git a/openpype/hosts/aftereffects/plugins/create/create_render.py b/openpype/hosts/aftereffects/plugins/create/create_render.py index fadfc0c206..b4fb20f922 100644 --- a/openpype/hosts/aftereffects/plugins/create/create_render.py +++ b/openpype/hosts/aftereffects/plugins/create/create_render.py @@ -29,6 +29,7 @@ class RenderCreator(Creator): # Settings mark_for_review = True + force_setting_values = True def create(self, subset_name_from_ui, data, pre_create_data): stub = api.get_stub() # only after After Effects is up @@ -96,7 +97,9 @@ class RenderCreator(Creator): self._add_instance_to_context(new_instance) stub.rename_item(comp.id, subset_name) - set_settings(True, True, [comp.id], print_msg=False) + + if self.force_setting_values: + set_settings(True, True, [comp.id], print_msg=False) def get_pre_create_attr_defs(self): output = [ @@ -173,6 +176,7 @@ class RenderCreator(Creator): ) self.mark_for_review = plugin_settings["mark_for_review"] + self.force_setting_values = plugin_settings["force_setting_values"] self.default_variants = plugin_settings.get( "default_variants", plugin_settings.get("defaults") or [] diff --git a/openpype/settings/defaults/project_settings/aftereffects.json b/openpype/settings/defaults/project_settings/aftereffects.json index 77ccb74410..9e2ab7334b 100644 --- a/openpype/settings/defaults/project_settings/aftereffects.json +++ b/openpype/settings/defaults/project_settings/aftereffects.json @@ -15,7 +15,8 @@ "default_variants": [ "Main" ], - "mark_for_review": true + "mark_for_review": true, + "force_setting_values": true } }, "publish": { diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_aftereffects.json b/openpype/settings/entities/schemas/projects_schema/schema_project_aftereffects.json index 72f09a641d..b0f8a7357f 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_aftereffects.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_aftereffects.json @@ -42,6 +42,12 @@ "key": "mark_for_review", "label": "Review", "default": true + }, + { + "type": "boolean", + "key": "force_setting_values", + "label": "Force resolution and duration values from Asset", + "default": true } ] } diff --git a/server_addon/aftereffects/server/settings/creator_plugins.py b/server_addon/aftereffects/server/settings/creator_plugins.py index 988a036589..5d4ba30cd0 100644 --- a/server_addon/aftereffects/server/settings/creator_plugins.py +++ b/server_addon/aftereffects/server/settings/creator_plugins.py @@ -7,6 +7,8 @@ class CreateRenderPlugin(BaseSettingsModel): default_factory=list, title="Default Variants" ) + force_setting_values: bool = SettingsField( + True, title="Force resolution and duration values from Asset") class AfterEffectsCreatorPlugins(BaseSettingsModel): diff --git a/server_addon/aftereffects/server/version.py b/server_addon/aftereffects/server/version.py index df0c92f1e2..e57ad00718 100644 --- a/server_addon/aftereffects/server/version.py +++ b/server_addon/aftereffects/server/version.py @@ -1,3 +1,3 @@ # -*- coding: utf-8 -*- """Package declaring addon version.""" -__version__ = "0.1.2" +__version__ = "0.1.3" From b70b418dee0a08b320eed557490edc237a48a0ed Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Thu, 8 Feb 2024 14:34:41 +0100 Subject: [PATCH 24/47] update ayon unreal plugin --- openpype/hosts/unreal/integration | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openpype/hosts/unreal/integration b/openpype/hosts/unreal/integration index 63266607ce..a4755d2869 160000 --- a/openpype/hosts/unreal/integration +++ b/openpype/hosts/unreal/integration @@ -1 +1 @@ -Subproject commit 63266607ceb972a61484f046634ddfc9eb0b5757 +Subproject commit a4755d2869694fcf58c98119298cde8d204e2ce4 From 509f2b677e65750fea65ecf8f87df9d06685fe18 Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Fri, 9 Feb 2024 11:50:35 +0800 Subject: [PATCH 25/47] ported OP PR #6200 to ayon_core --- client/ayon_core/hosts/max/api/pipeline.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/client/ayon_core/hosts/max/api/pipeline.py b/client/ayon_core/hosts/max/api/pipeline.py index ff5ef0640b..ff0267b39a 100644 --- a/client/ayon_core/hosts/max/api/pipeline.py +++ b/client/ayon_core/hosts/max/api/pipeline.py @@ -60,6 +60,9 @@ class MaxHost(HostBase, IWorkfileHost, ILoadHost, IPublishHost): rt.callbacks.addScript(rt.Name('filePostOpen'), lib.check_colorspace) + rt.callbacks.addScript(rt.Name('postWorkspaceChange'), + self._deferred_menu_creation) + def has_unsaved_changes(self): # TODO: how to get it from 3dsmax? return True From 2c4e22a65a7012e8e35fdabf1327f2c6e8b8e980 Mon Sep 17 00:00:00 2001 From: Toke Stuart Jepsen Date: Fri, 9 Feb 2024 07:58:43 +0000 Subject: [PATCH 26/47] Add submodule --- client/ayon_core/hosts/unreal/integration | 1 + 1 file changed, 1 insertion(+) create mode 160000 client/ayon_core/hosts/unreal/integration diff --git a/client/ayon_core/hosts/unreal/integration b/client/ayon_core/hosts/unreal/integration new file mode 160000 index 0000000000..6d2793170e --- /dev/null +++ b/client/ayon_core/hosts/unreal/integration @@ -0,0 +1 @@ +Subproject commit 6d2793170ed57187842f683a943593973abcc337 From 6d2a6e4d5d36fc8848346a5b50ebc116aa7ce1fd Mon Sep 17 00:00:00 2001 From: Toke Stuart Jepsen Date: Fri, 9 Feb 2024 08:01:10 +0000 Subject: [PATCH 27/47] Fix AE json --- .../settings/defaults/project_settings/aftereffects.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/client/ayon_core/settings/defaults/project_settings/aftereffects.json b/client/ayon_core/settings/defaults/project_settings/aftereffects.json index 9e2ab7334b..77ccb74410 100644 --- a/client/ayon_core/settings/defaults/project_settings/aftereffects.json +++ b/client/ayon_core/settings/defaults/project_settings/aftereffects.json @@ -15,8 +15,7 @@ "default_variants": [ "Main" ], - "mark_for_review": true, - "force_setting_values": true + "mark_for_review": true } }, "publish": { From d356c3f46bc9a1e40c9f4bd7d90d9ae601cec371 Mon Sep 17 00:00:00 2001 From: Toke Stuart Jepsen Date: Fri, 9 Feb 2024 08:33:21 +0000 Subject: [PATCH 28/47] Add submodule --- client/ayon_core/hosts/unreal/integration | 1 + 1 file changed, 1 insertion(+) create mode 160000 client/ayon_core/hosts/unreal/integration diff --git a/client/ayon_core/hosts/unreal/integration b/client/ayon_core/hosts/unreal/integration new file mode 160000 index 0000000000..6d2793170e --- /dev/null +++ b/client/ayon_core/hosts/unreal/integration @@ -0,0 +1 @@ +Subproject commit 6d2793170ed57187842f683a943593973abcc337 From fed249f43f8f034cdbad42a75ed94a96b297547c Mon Sep 17 00:00:00 2001 From: Toke Stuart Jepsen Date: Fri, 9 Feb 2024 08:35:06 +0000 Subject: [PATCH 29/47] Fix AE json --- .../settings/defaults/project_settings/aftereffects.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/client/ayon_core/settings/defaults/project_settings/aftereffects.json b/client/ayon_core/settings/defaults/project_settings/aftereffects.json index 9e2ab7334b..77ccb74410 100644 --- a/client/ayon_core/settings/defaults/project_settings/aftereffects.json +++ b/client/ayon_core/settings/defaults/project_settings/aftereffects.json @@ -15,8 +15,7 @@ "default_variants": [ "Main" ], - "mark_for_review": true, - "force_setting_values": true + "mark_for_review": true } }, "publish": { From 1a9c8f61535046b4966d7e4c6396b210a70201e0 Mon Sep 17 00:00:00 2001 From: Toke Stuart Jepsen Date: Fri, 9 Feb 2024 08:39:13 +0000 Subject: [PATCH 30/47] Add submodule --- client/ayon_core/hosts/unreal/integration | 1 + 1 file changed, 1 insertion(+) create mode 160000 client/ayon_core/hosts/unreal/integration diff --git a/client/ayon_core/hosts/unreal/integration b/client/ayon_core/hosts/unreal/integration new file mode 160000 index 0000000000..6d2793170e --- /dev/null +++ b/client/ayon_core/hosts/unreal/integration @@ -0,0 +1 @@ +Subproject commit 6d2793170ed57187842f683a943593973abcc337 From aabe18ea04de15e0d303a21c305cc8067ce70d6b Mon Sep 17 00:00:00 2001 From: Toke Stuart Jepsen Date: Fri, 9 Feb 2024 09:00:39 +0000 Subject: [PATCH 31/47] Increment version --- client/ayon_core/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/ayon_core/version.py b/client/ayon_core/version.py index 914e415b8c..a173569ef3 100644 --- a/client/ayon_core/version.py +++ b/client/ayon_core/version.py @@ -1,3 +1,3 @@ # -*- coding: utf-8 -*- """Package declaring AYON core addon version.""" -__version__ = "0.2.1-dev.1" +__version__ = "0.2.2" From 4da6f25b47f09ee0ef85dbabcd46b960c1d78823 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Fri, 9 Feb 2024 11:02:59 +0200 Subject: [PATCH 32/47] rearrange deadline settings --- .../server/settings/publish_plugins.py | 160 +++++++++--------- server_addon/deadline/server/version.py | 2 +- 2 files changed, 82 insertions(+), 80 deletions(-) diff --git a/server_addon/deadline/server/settings/publish_plugins.py b/server_addon/deadline/server/settings/publish_plugins.py index 8abe59674b..3f5ac3108d 100644 --- a/server_addon/deadline/server/settings/publish_plugins.py +++ b/server_addon/deadline/server/settings/publish_plugins.py @@ -306,36 +306,38 @@ class PublishPluginsModel(BaseSettingsModel): default_factory=ValidateExpectedFilesModel, title="Validate Expected Files" ) - MayaSubmitDeadline: MayaSubmitDeadlineModel = SettingsField( - default_factory=MayaSubmitDeadlineModel, - title="Maya Submit to deadline") - MaxSubmitDeadline: MaxSubmitDeadlineModel = SettingsField( - default_factory=MaxSubmitDeadlineModel, - title="Max Submit to deadline") - FusionSubmitDeadline: FusionSubmitDeadlineModel = SettingsField( - default_factory=FusionSubmitDeadlineModel, - title="Fusion submit to Deadline") - NukeSubmitDeadline: NukeSubmitDeadlineModel = SettingsField( - default_factory=NukeSubmitDeadlineModel, - title="Nuke Submit to deadline") - HarmonySubmitDeadline: HarmonySubmitDeadlineModel = SettingsField( - default_factory=HarmonySubmitDeadlineModel, - title="Harmony Submit to deadline") AfterEffectsSubmitDeadline: AfterEffectsSubmitDeadlineModel = ( SettingsField( default_factory=AfterEffectsSubmitDeadlineModel, - title="After Effects to deadline" + title="After Effects to deadline", + section="Hosts" ) ) - CelactionSubmitDeadline: CelactionSubmitDeadlineModel = SettingsField( - default_factory=CelactionSubmitDeadlineModel, - title="Celaction Submit Deadline") BlenderSubmitDeadline: BlenderSubmitDeadlineModel = SettingsField( default_factory=BlenderSubmitDeadlineModel, title="Blender Submit Deadline") + CelactionSubmitDeadline: CelactionSubmitDeadlineModel = SettingsField( + default_factory=CelactionSubmitDeadlineModel, + title="Celaction Submit Deadline") + FusionSubmitDeadline: FusionSubmitDeadlineModel = SettingsField( + default_factory=FusionSubmitDeadlineModel, + title="Fusion submit to Deadline") + HarmonySubmitDeadline: HarmonySubmitDeadlineModel = SettingsField( + default_factory=HarmonySubmitDeadlineModel, + title="Harmony Submit to deadline") + MaxSubmitDeadline: MaxSubmitDeadlineModel = SettingsField( + default_factory=MaxSubmitDeadlineModel, + title="Max Submit to deadline") + MayaSubmitDeadline: MayaSubmitDeadlineModel = SettingsField( + default_factory=MayaSubmitDeadlineModel, + title="Maya Submit to deadline") + NukeSubmitDeadline: NukeSubmitDeadlineModel = SettingsField( + default_factory=NukeSubmitDeadlineModel, + title="Nuke Submit to deadline") ProcessSubmittedCacheJobOnFarm: ProcessCacheJobFarmModel = SettingsField( default_factory=ProcessCacheJobFarmModel, - title="Process submitted cache Job on farm.") + title="Process submitted cache Job on farm.", + section="Publish Jobs") ProcessSubmittedJobOnFarm: ProcessSubmittedJobOnFarmModel = SettingsField( default_factory=ProcessSubmittedJobOnFarmModel, title="Process submitted job on farm.") @@ -357,6 +359,65 @@ DEFAULT_DEADLINE_PLUGINS_SETTINGS = { "deadline" ] }, + "AfterEffectsSubmitDeadline": { + "enabled": True, + "optional": False, + "active": True, + "use_published": True, + "priority": 50, + "chunk_size": 10000, + "group": "", + "department": "", + "multiprocess": True + }, + "BlenderSubmitDeadline": { + "enabled": True, + "optional": False, + "active": True, + "use_published": True, + "priority": 50, + "chunk_size": 10, + "group": "none", + "job_delay": "00:00:00:00" + }, + "CelactionSubmitDeadline": { + "enabled": True, + "deadline_department": "", + "deadline_priority": 50, + "deadline_pool": "", + "deadline_pool_secondary": "", + "deadline_group": "", + "deadline_chunk_size": 10, + "deadline_job_delay": "00:00:00:00" + }, + "FusionSubmitDeadline": { + "enabled": True, + "optional": False, + "active": True, + "priority": 50, + "chunk_size": 10, + "concurrent_tasks": 1, + "group": "" + }, + "HarmonySubmitDeadline": { + "enabled": True, + "optional": False, + "active": True, + "use_published": True, + "priority": 50, + "chunk_size": 10000, + "group": "", + "department": "" + }, + "MaxSubmitDeadline": { + "enabled": True, + "optional": False, + "active": True, + "use_published": True, + "priority": 50, + "chunk_size": 10, + "group": "none" + }, "MayaSubmitDeadline": { "enabled": True, "optional": False, @@ -376,24 +437,6 @@ DEFAULT_DEADLINE_PLUGINS_SETTINGS = { "pluginInfo": "", "scene_patches": [] }, - "MaxSubmitDeadline": { - "enabled": True, - "optional": False, - "active": True, - "use_published": True, - "priority": 50, - "chunk_size": 10, - "group": "none" - }, - "FusionSubmitDeadline": { - "enabled": True, - "optional": False, - "active": True, - "priority": 50, - "chunk_size": 10, - "concurrent_tasks": 1, - "group": "" - }, "NukeSubmitDeadline": { "enabled": True, "optional": False, @@ -410,47 +453,6 @@ DEFAULT_DEADLINE_PLUGINS_SETTINGS = { "env_search_replace_values": [], "limit_groups": [] }, - "HarmonySubmitDeadline": { - "enabled": True, - "optional": False, - "active": True, - "use_published": True, - "priority": 50, - "chunk_size": 10000, - "group": "", - "department": "" - }, - "AfterEffectsSubmitDeadline": { - "enabled": True, - "optional": False, - "active": True, - "use_published": True, - "priority": 50, - "chunk_size": 10000, - "group": "", - "department": "", - "multiprocess": True - }, - "CelactionSubmitDeadline": { - "enabled": True, - "deadline_department": "", - "deadline_priority": 50, - "deadline_pool": "", - "deadline_pool_secondary": "", - "deadline_group": "", - "deadline_chunk_size": 10, - "deadline_job_delay": "00:00:00:00" - }, - "BlenderSubmitDeadline": { - "enabled": True, - "optional": False, - "active": True, - "use_published": True, - "priority": 50, - "chunk_size": 10, - "group": "none", - "job_delay": "00:00:00:00" - }, "ProcessSubmittedCacheJobOnFarm": { "enabled": True, "deadline_department": "", diff --git a/server_addon/deadline/server/version.py b/server_addon/deadline/server/version.py index 9cb17e7976..c11f861afb 100644 --- a/server_addon/deadline/server/version.py +++ b/server_addon/deadline/server/version.py @@ -1 +1 @@ -__version__ = "0.1.8" +__version__ = "0.1.9" From b245941f158389bebb76522b692816fc3f4a1c9e Mon Sep 17 00:00:00 2001 From: Toke Jepsen Date: Fri, 9 Feb 2024 09:10:30 +0000 Subject: [PATCH 33/47] Update client/ayon_core/version.py Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> --- client/ayon_core/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/ayon_core/version.py b/client/ayon_core/version.py index a173569ef3..914e415b8c 100644 --- a/client/ayon_core/version.py +++ b/client/ayon_core/version.py @@ -1,3 +1,3 @@ # -*- coding: utf-8 -*- """Package declaring AYON core addon version.""" -__version__ = "0.2.2" +__version__ = "0.2.1-dev.1" From c79151e5d7fa8d0d7ecf7e345e377e5612d70c4c Mon Sep 17 00:00:00 2001 From: Toke Jepsen Date: Fri, 9 Feb 2024 09:10:35 +0000 Subject: [PATCH 34/47] Update client/ayon_core/plugins/publish/extract_thumbnail.py Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> --- client/ayon_core/plugins/publish/extract_thumbnail.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/ayon_core/plugins/publish/extract_thumbnail.py b/client/ayon_core/plugins/publish/extract_thumbnail.py index 9fbf97b275..f63dbe7f58 100644 --- a/client/ayon_core/plugins/publish/extract_thumbnail.py +++ b/client/ayon_core/plugins/publish/extract_thumbnail.py @@ -113,7 +113,7 @@ class ExtractThumbnail(pyblish.api.InstancePlugin): return True return False - product_names = self.subsets + self.product_names + product_names = self.product_names if product_names: result = validate_string_against_patterns( instance.data["subset"], product_names From 17dd2d1e2780085980f8cb0fe1fef4438c685a0f Mon Sep 17 00:00:00 2001 From: Toke Jepsen Date: Fri, 9 Feb 2024 09:10:41 +0000 Subject: [PATCH 35/47] Update client/ayon_core/plugins/publish/extract_thumbnail.py Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> --- client/ayon_core/plugins/publish/extract_thumbnail.py | 1 - 1 file changed, 1 deletion(-) diff --git a/client/ayon_core/plugins/publish/extract_thumbnail.py b/client/ayon_core/plugins/publish/extract_thumbnail.py index f63dbe7f58..f3dd8369f3 100644 --- a/client/ayon_core/plugins/publish/extract_thumbnail.py +++ b/client/ayon_core/plugins/publish/extract_thumbnail.py @@ -50,7 +50,6 @@ class ExtractThumbnail(pyblish.api.InstancePlugin): # attribute presets from settings oiiotool_defaults = None ffmpeg_args = None - subsets = [] product_names = [] def process(self, instance): From 53b27915d5ff34924da7e8b6b71c12b9ce131aac Mon Sep 17 00:00:00 2001 From: Toke Jepsen Date: Fri, 9 Feb 2024 15:03:46 +0000 Subject: [PATCH 36/47] Update client/ayon_core/plugins/publish/extract_thumbnail.py Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> --- client/ayon_core/plugins/publish/extract_thumbnail.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/ayon_core/plugins/publish/extract_thumbnail.py b/client/ayon_core/plugins/publish/extract_thumbnail.py index f3dd8369f3..1471a5fb78 100644 --- a/client/ayon_core/plugins/publish/extract_thumbnail.py +++ b/client/ayon_core/plugins/publish/extract_thumbnail.py @@ -119,7 +119,7 @@ class ExtractThumbnail(pyblish.api.InstancePlugin): ) if not result: self.log.debug( - "Subset \"{}\" did not match any valid subsets: {}".format( + "Product name \"{}\" did not match settings filters: {}".format( instance.data["subset"], product_names ) ) From ab3b62b842092c2066430f1a97b20aeb7b73b4e9 Mon Sep 17 00:00:00 2001 From: Petr Kalis Date: Fri, 9 Feb 2024 17:09:42 +0100 Subject: [PATCH 37/47] OP-8165 - fix AE local render doesnt push thumbnail to Ftrack Without thumbnail review is not clickable from main Versions list. Clone of PR to legacy OP. --- openpype/plugins/publish/extract_thumbnail.py | 1 + 1 file changed, 1 insertion(+) diff --git a/openpype/plugins/publish/extract_thumbnail.py b/openpype/plugins/publish/extract_thumbnail.py index 10eb261482..291345abb1 100644 --- a/openpype/plugins/publish/extract_thumbnail.py +++ b/openpype/plugins/publish/extract_thumbnail.py @@ -35,6 +35,7 @@ class ExtractThumbnail(pyblish.api.InstancePlugin): "traypublisher", "substancepainter", "nuke", + "aftereffects" ] enabled = False From bae63d5e015df8d09f59354899accd58d35d6512 Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Fri, 9 Feb 2024 17:49:54 +0100 Subject: [PATCH 38/47] fix houdini lib --- client/ayon_core/hosts/houdini/api/lib.py | 1 + 1 file changed, 1 insertion(+) diff --git a/client/ayon_core/hosts/houdini/api/lib.py b/client/ayon_core/hosts/houdini/api/lib.py index 7163aebdec..bf66890285 100644 --- a/client/ayon_core/hosts/houdini/api/lib.py +++ b/client/ayon_core/hosts/houdini/api/lib.py @@ -6,6 +6,7 @@ import re import uuid import logging import json +from contextlib import contextmanager import six From cafbff361bfa4de76fe345d9b7e1839d2d2e13ed Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Fri, 9 Feb 2024 17:51:15 +0100 Subject: [PATCH 39/47] use 'SetCurrentProcessExplicitAppUserModelID' only when running from code --- client/ayon_core/tools/traypublisher/window.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/ayon_core/tools/traypublisher/window.py b/client/ayon_core/tools/traypublisher/window.py index dad314e510..4335b9e92b 100644 --- a/client/ayon_core/tools/traypublisher/window.py +++ b/client/ayon_core/tools/traypublisher/window.py @@ -12,7 +12,7 @@ from qtpy import QtWidgets, QtCore import qtawesome import appdirs -from ayon_core.lib import JSONSettingRegistry +from ayon_core.lib import JSONSettingRegistry, is_running_from_build from ayon_core.pipeline import install_host from ayon_core.hosts.traypublisher.api import TrayPublisherHost from ayon_core.tools.publisher.control_qt import QtPublisherController @@ -265,7 +265,7 @@ def main(): app_instance = get_ayon_qt_app() - if platform.system().lower() == "windows": + if not is_running_from_build() and platform.system().lower() == "windows": import ctypes ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID( u"traypublisher" From 7f462c73246bf1390f83c5abc315fda78b200165 Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Fri, 9 Feb 2024 17:55:01 +0100 Subject: [PATCH 40/47] Use AYON in docstrings and labels --- client/ayon_core/hosts/resolve/startup.py | 6 +++--- client/ayon_core/lib/local_settings.py | 4 ++-- client/ayon_core/modules/job_queue/module.py | 4 ++-- client/ayon_core/modules/timers_manager/widget_user_idle.py | 2 +- client/ayon_core/modules/webserver/webserver_module.py | 2 +- client/ayon_core/style/__init__.py | 4 ++-- client/ayon_core/tools/traypublisher/window.py | 2 +- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/client/ayon_core/hosts/resolve/startup.py b/client/ayon_core/hosts/resolve/startup.py index 174a2878c5..b3c1a024d9 100644 --- a/client/ayon_core/hosts/resolve/startup.py +++ b/client/ayon_core/hosts/resolve/startup.py @@ -33,7 +33,7 @@ def ensure_installed_host(): def launch_menu(): - print("Launching Resolve OpenPype menu..") + print("Launching Resolve AYON menu..") ensure_installed_host() ayon_core.hosts.resolve.api.launch_pype_menu() @@ -54,7 +54,7 @@ def main(): else: log.info("No last workfile set to open. Skipping..") - # Launch OpenPype menu + # Launch AYON menu from ayon_core.settings import get_project_settings from ayon_core.pipeline.context_tools import get_current_project_name project_name = get_current_project_name() @@ -62,7 +62,7 @@ def main(): settings = get_project_settings(project_name) if settings.get("resolve", {}).get("launch_openpype_menu_on_start", True): - log.info("Launching OpenPype menu..") + log.info("Launching AYON menu..") launch_menu() diff --git a/client/ayon_core/lib/local_settings.py b/client/ayon_core/lib/local_settings.py index 33b3232128..022f63a618 100644 --- a/client/ayon_core/lib/local_settings.py +++ b/client/ayon_core/lib/local_settings.py @@ -38,8 +38,8 @@ class AYONSecureRegistry: Registry should be used for private data that should be available only for user. - All passed registry names will have added prefix `OpenPype/` to easier - identify which data were created by OpenPype. + All passed registry names will have added prefix `AYON/` to easier + identify which data were created by AYON. Args: name(str): Name of registry used as identifier for data. diff --git a/client/ayon_core/modules/job_queue/module.py b/client/ayon_core/modules/job_queue/module.py index 1cecd62de5..f2b022069b 100644 --- a/client/ayon_core/modules/job_queue/module.py +++ b/client/ayon_core/modules/job_queue/module.py @@ -1,4 +1,4 @@ -"""Job queue OpenPype module was created for remote execution of commands. +"""Job queue AYON addon was created for remote execution of commands. ## Why is needed Primarily created for hosts which are not easilly controlled from command line @@ -30,7 +30,7 @@ workstations know where to send or receive jobs. ### start_worker - start worker which will process jobs -- has required possitional argument which is application name from OpenPype +- has required possitional argument which is application name from AYON settings e.g. 'tvpaint/11-5' ('tvpaint' is group '11-5' is variant) - it is possible to specify server url but url from settings is used when not passed (this is added mainly for developing purposes) diff --git a/client/ayon_core/modules/timers_manager/widget_user_idle.py b/client/ayon_core/modules/timers_manager/widget_user_idle.py index 94d7a606ed..c59ab15b38 100644 --- a/client/ayon_core/modules/timers_manager/widget_user_idle.py +++ b/client/ayon_core/modules/timers_manager/widget_user_idle.py @@ -9,7 +9,7 @@ class WidgetUserIdle(QtWidgets.QWidget): def __init__(self, module): super(WidgetUserIdle, self).__init__() - self.setWindowTitle("OpenPype - Stop timers") + self.setWindowTitle("AYON - Stop timers") icon = QtGui.QIcon(resources.get_ayon_icon_filepath()) self.setWindowIcon(icon) diff --git a/client/ayon_core/modules/webserver/webserver_module.py b/client/ayon_core/modules/webserver/webserver_module.py index ec143d0866..c324e0dd18 100644 --- a/client/ayon_core/modules/webserver/webserver_module.py +++ b/client/ayon_core/modules/webserver/webserver_module.py @@ -1,6 +1,6 @@ """WebServerAddon spawns aiohttp server in asyncio loop. -Main usage of the module is in OpenPype tray where make sense to add ability +Main usage of the module is in AYON tray where make sense to add ability of other modules to add theirs routes. Module which would want use that option must have implemented method `webserver_initialization` which must expect `WebServerManager` object where is possible to add routes or paths diff --git a/client/ayon_core/style/__init__.py b/client/ayon_core/style/__init__.py index 8b2dfa1bcb..8d3089ef86 100644 --- a/client/ayon_core/style/__init__.py +++ b/client/ayon_core/style/__init__.py @@ -198,7 +198,7 @@ def _load_font(): def load_stylesheet(): - """Load and return OpenPype Qt stylesheet.""" + """Load and return AYON Qt stylesheet.""" if _Cache.stylesheet is None: _Cache.stylesheet = _load_stylesheet() @@ -207,7 +207,7 @@ def load_stylesheet(): def get_app_icon_path(): - """Path to OpenPype icon.""" + """Path to AYON icon.""" return resources.get_ayon_icon_filepath() diff --git a/client/ayon_core/tools/traypublisher/window.py b/client/ayon_core/tools/traypublisher/window.py index 4335b9e92b..79386d7ea0 100644 --- a/client/ayon_core/tools/traypublisher/window.py +++ b/client/ayon_core/tools/traypublisher/window.py @@ -35,7 +35,7 @@ class TrayPublisherController(QtPublisherController): class TrayPublisherRegistry(JSONSettingRegistry): - """Class handling OpenPype general settings registry. + """Class handling AYON general settings registry. Attributes: vendor (str): Name used for path construction. From 01ac49c8b315e8013ddaf649686751797e5e67ad Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Fri, 9 Feb 2024 17:55:21 +0100 Subject: [PATCH 41/47] fix docstring argument name --- client/ayon_core/pipeline/farm/patterning.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/ayon_core/pipeline/farm/patterning.py b/client/ayon_core/pipeline/farm/patterning.py index 1e4b5bf37d..d7b046113b 100644 --- a/client/ayon_core/pipeline/farm/patterning.py +++ b/client/ayon_core/pipeline/farm/patterning.py @@ -11,7 +11,7 @@ def match_aov_pattern(host_name, aov_patterns, render_file_name): that we have grabbed from `exp_files`. Args: - app (str): Host name. + host_name (str): Host name. aov_patterns (dict): AOV patterns from AOV filters. render_file_name (str): Incoming file name to match against. From 3365919d966b7ddfd687d12e53153e9d3a9205fd Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Fri, 9 Feb 2024 18:31:54 +0100 Subject: [PATCH 42/47] host addons inherit from AYONAddon --- client/ayon_core/hosts/aftereffects/addon.py | 7 ++----- client/ayon_core/hosts/blender/addon.py | 7 ++----- client/ayon_core/hosts/celaction/addon.py | 7 ++----- client/ayon_core/hosts/flame/addon.py | 7 ++----- client/ayon_core/hosts/fusion/addon.py | 7 ++----- client/ayon_core/hosts/harmony/addon.py | 7 ++----- client/ayon_core/hosts/hiero/addon.py | 7 ++----- client/ayon_core/hosts/houdini/addon.py | 7 ++----- client/ayon_core/hosts/max/addon.py | 7 ++----- client/ayon_core/hosts/maya/addon.py | 7 ++----- client/ayon_core/hosts/nuke/addon.py | 7 ++----- client/ayon_core/hosts/photoshop/addon.py | 7 ++----- client/ayon_core/hosts/resolve/addon.py | 7 ++----- client/ayon_core/hosts/substancepainter/addon.py | 7 ++----- client/ayon_core/hosts/traypublisher/addon.py | 11 +++++------ client/ayon_core/hosts/tvpaint/addon.py | 7 ++----- client/ayon_core/hosts/unreal/addon.py | 7 ++----- 17 files changed, 37 insertions(+), 86 deletions(-) diff --git a/client/ayon_core/hosts/aftereffects/addon.py b/client/ayon_core/hosts/aftereffects/addon.py index 278f836a72..46d0818247 100644 --- a/client/ayon_core/hosts/aftereffects/addon.py +++ b/client/ayon_core/hosts/aftereffects/addon.py @@ -1,13 +1,10 @@ -from ayon_core.modules import OpenPypeModule, IHostAddon +from ayon_core.addon import AYONAddon, IHostAddon -class AfterEffectsAddon(OpenPypeModule, IHostAddon): +class AfterEffectsAddon(AYONAddon, IHostAddon): name = "aftereffects" host_name = "aftereffects" - def initialize(self, module_settings): - self.enabled = True - def add_implementation_envs(self, env, _app): """Modify environments to contain all required for implementation.""" defaults = { diff --git a/client/ayon_core/hosts/blender/addon.py b/client/ayon_core/hosts/blender/addon.py index c3804382e5..b7484de243 100644 --- a/client/ayon_core/hosts/blender/addon.py +++ b/client/ayon_core/hosts/blender/addon.py @@ -1,16 +1,13 @@ import os -from ayon_core.modules import OpenPypeModule, IHostAddon +from ayon_core.addon import AYONAddon, IHostAddon BLENDER_ROOT_DIR = os.path.dirname(os.path.abspath(__file__)) -class BlenderAddon(OpenPypeModule, IHostAddon): +class BlenderAddon(AYONAddon, IHostAddon): name = "blender" host_name = "blender" - def initialize(self, module_settings): - self.enabled = True - def add_implementation_envs(self, env, _app): """Modify environments to contain all required for implementation.""" # Prepare path to implementation script diff --git a/client/ayon_core/hosts/celaction/addon.py b/client/ayon_core/hosts/celaction/addon.py index 4573ee7e56..d00401a2e0 100644 --- a/client/ayon_core/hosts/celaction/addon.py +++ b/client/ayon_core/hosts/celaction/addon.py @@ -1,16 +1,13 @@ import os -from ayon_core.modules import OpenPypeModule, IHostAddon +from ayon_core.addon import AYONAddon, IHostAddon CELACTION_ROOT_DIR = os.path.dirname(os.path.abspath(__file__)) -class CelactionAddon(OpenPypeModule, IHostAddon): +class CelactionAddon(AYONAddon, IHostAddon): name = "celaction" host_name = "celaction" - def initialize(self, module_settings): - self.enabled = True - def get_launch_hook_paths(self, app): if app.host_name != self.host_name: return [] diff --git a/client/ayon_core/hosts/flame/addon.py b/client/ayon_core/hosts/flame/addon.py index e30d7cab08..f5560cde7a 100644 --- a/client/ayon_core/hosts/flame/addon.py +++ b/client/ayon_core/hosts/flame/addon.py @@ -1,16 +1,13 @@ import os -from ayon_core.modules import OpenPypeModule, IHostAddon +from ayon_core.addon import AYONAddon, IHostAddon HOST_DIR = os.path.dirname(os.path.abspath(__file__)) -class FlameAddon(OpenPypeModule, IHostAddon): +class FlameAddon(AYONAddon, IHostAddon): name = "flame" host_name = "flame" - def initialize(self, module_settings): - self.enabled = True - def add_implementation_envs(self, env, _app): # Add requirements to DL_PYTHON_HOOK_PATH env["DL_PYTHON_HOOK_PATH"] = os.path.join(HOST_DIR, "startup") diff --git a/client/ayon_core/hosts/fusion/addon.py b/client/ayon_core/hosts/fusion/addon.py index 7eff2d93c8..391ee770c4 100644 --- a/client/ayon_core/hosts/fusion/addon.py +++ b/client/ayon_core/hosts/fusion/addon.py @@ -1,6 +1,6 @@ import os import re -from ayon_core.modules import OpenPypeModule, IHostAddon +from ayon_core.addon import AYONAddon, IHostAddon from ayon_core.lib import Logger FUSION_HOST_DIR = os.path.dirname(os.path.abspath(__file__)) @@ -48,13 +48,10 @@ def get_fusion_version(app_name): ) -class FusionAddon(OpenPypeModule, IHostAddon): +class FusionAddon(AYONAddon, IHostAddon): name = "fusion" host_name = "fusion" - def initialize(self, module_settings): - self.enabled = True - def get_launch_hook_paths(self, app): if app.host_name != self.host_name: return [] diff --git a/client/ayon_core/hosts/harmony/addon.py b/client/ayon_core/hosts/harmony/addon.py index 172a1f104f..476d569415 100644 --- a/client/ayon_core/hosts/harmony/addon.py +++ b/client/ayon_core/hosts/harmony/addon.py @@ -1,16 +1,13 @@ import os -from ayon_core.modules import OpenPypeModule, IHostAddon +from ayon_core.addon import AYONAddon, IHostAddon HARMONY_HOST_DIR = os.path.dirname(os.path.abspath(__file__)) -class HarmonyAddon(OpenPypeModule, IHostAddon): +class HarmonyAddon(AYONAddon, IHostAddon): name = "harmony" host_name = "harmony" - def initialize(self, module_settings): - self.enabled = True - def add_implementation_envs(self, env, _app): """Modify environments to contain all required for implementation.""" openharmony_path = os.path.join( diff --git a/client/ayon_core/hosts/hiero/addon.py b/client/ayon_core/hosts/hiero/addon.py index 447700e2e1..f612493ca1 100644 --- a/client/ayon_core/hosts/hiero/addon.py +++ b/client/ayon_core/hosts/hiero/addon.py @@ -1,17 +1,14 @@ import os import platform -from ayon_core.modules import OpenPypeModule, IHostAddon +from ayon_core.addon import AYONAddon, IHostAddon HIERO_ROOT_DIR = os.path.dirname(os.path.abspath(__file__)) -class HieroAddon(OpenPypeModule, IHostAddon): +class HieroAddon(AYONAddon, IHostAddon): name = "hiero" host_name = "hiero" - def initialize(self, module_settings): - self.enabled = True - def add_implementation_envs(self, env, _app): # Add requirements to HIERO_PLUGIN_PATH new_hiero_paths = [ diff --git a/client/ayon_core/hosts/houdini/addon.py b/client/ayon_core/hosts/houdini/addon.py index 34d140db3c..95d714aea1 100644 --- a/client/ayon_core/hosts/houdini/addon.py +++ b/client/ayon_core/hosts/houdini/addon.py @@ -1,16 +1,13 @@ import os -from ayon_core.modules import OpenPypeModule, IHostAddon +from ayon_core.addon import AYONAddon, IHostAddon HOUDINI_HOST_DIR = os.path.dirname(os.path.abspath(__file__)) -class HoudiniAddon(OpenPypeModule, IHostAddon): +class HoudiniAddon(AYONAddon, IHostAddon): name = "houdini" host_name = "houdini" - def initialize(self, module_settings): - self.enabled = True - def add_implementation_envs(self, env, _app): # Add requirements to HOUDINI_PATH and HOUDINI_MENU_PATH startup_path = os.path.join(HOUDINI_HOST_DIR, "startup") diff --git a/client/ayon_core/hosts/max/addon.py b/client/ayon_core/hosts/max/addon.py index 416014025c..12f5f7eca0 100644 --- a/client/ayon_core/hosts/max/addon.py +++ b/client/ayon_core/hosts/max/addon.py @@ -1,17 +1,14 @@ # -*- coding: utf-8 -*- import os -from ayon_core.modules import OpenPypeModule, IHostAddon +from ayon_core.addon import AYONAddon, IHostAddon MAX_HOST_DIR = os.path.dirname(os.path.abspath(__file__)) -class MaxAddon(OpenPypeModule, IHostAddon): +class MaxAddon(AYONAddon, IHostAddon): name = "max" host_name = "max" - def initialize(self, module_settings): - self.enabled = True - def add_implementation_envs(self, env, _app): # Remove auto screen scale factor for Qt # - let 3dsmax decide it's value diff --git a/client/ayon_core/hosts/maya/addon.py b/client/ayon_core/hosts/maya/addon.py index 745850f6a8..c68aa4c911 100644 --- a/client/ayon_core/hosts/maya/addon.py +++ b/client/ayon_core/hosts/maya/addon.py @@ -1,16 +1,13 @@ import os -from ayon_core.modules import OpenPypeModule, IHostAddon +from ayon_core.addon import AYONAddon, IHostAddon MAYA_ROOT_DIR = os.path.dirname(os.path.abspath(__file__)) -class MayaAddon(OpenPypeModule, IHostAddon): +class MayaAddon(AYONAddon, IHostAddon): name = "maya" host_name = "maya" - def initialize(self, module_settings): - self.enabled = True - def add_implementation_envs(self, env, _app): # Add requirements to PYTHONPATH new_python_paths = [ diff --git a/client/ayon_core/hosts/nuke/addon.py b/client/ayon_core/hosts/nuke/addon.py index 4ca4408271..8e640624f0 100644 --- a/client/ayon_core/hosts/nuke/addon.py +++ b/client/ayon_core/hosts/nuke/addon.py @@ -1,17 +1,14 @@ import os import platform -from ayon_core.modules import OpenPypeModule, IHostAddon +from ayon_core.addon import AYONAddon, IHostAddon NUKE_ROOT_DIR = os.path.dirname(os.path.abspath(__file__)) -class NukeAddon(OpenPypeModule, IHostAddon): +class NukeAddon(AYONAddon, IHostAddon): name = "nuke" host_name = "nuke" - def initialize(self, module_settings): - self.enabled = True - def add_implementation_envs(self, env, _app): # Add requirements to NUKE_PATH new_nuke_paths = [ diff --git a/client/ayon_core/hosts/photoshop/addon.py b/client/ayon_core/hosts/photoshop/addon.py index 0c7efdb317..3016912960 100644 --- a/client/ayon_core/hosts/photoshop/addon.py +++ b/client/ayon_core/hosts/photoshop/addon.py @@ -1,16 +1,13 @@ import os -from ayon_core.modules import OpenPypeModule, IHostAddon +from ayon_core.addon import AYONAddon, IHostAddon PHOTOSHOP_HOST_DIR = os.path.dirname(os.path.abspath(__file__)) -class PhotoshopAddon(OpenPypeModule, IHostAddon): +class PhotoshopAddon(AYONAddon, IHostAddon): name = "photoshop" host_name = "photoshop" - def initialize(self, module_settings): - self.enabled = True - def add_implementation_envs(self, env, _app): """Modify environments to contain all required for implementation.""" defaults = { diff --git a/client/ayon_core/hosts/resolve/addon.py b/client/ayon_core/hosts/resolve/addon.py index 9c9932826b..1354caabb2 100644 --- a/client/ayon_core/hosts/resolve/addon.py +++ b/client/ayon_core/hosts/resolve/addon.py @@ -1,17 +1,14 @@ import os -from ayon_core.modules import OpenPypeModule, IHostAddon +from ayon_core.addon import AYONAddon, IHostAddon from .utils import RESOLVE_ROOT_DIR -class ResolveAddon(OpenPypeModule, IHostAddon): +class ResolveAddon(AYONAddon, IHostAddon): name = "resolve" host_name = "resolve" - def initialize(self, module_settings): - self.enabled = True - def get_launch_hook_paths(self, app): if app.host_name != self.host_name: return [] diff --git a/client/ayon_core/hosts/substancepainter/addon.py b/client/ayon_core/hosts/substancepainter/addon.py index a7f21c2288..26829d3153 100644 --- a/client/ayon_core/hosts/substancepainter/addon.py +++ b/client/ayon_core/hosts/substancepainter/addon.py @@ -1,16 +1,13 @@ import os -from ayon_core.modules import OpenPypeModule, IHostAddon +from ayon_core.addon import AYONAddon, IHostAddon SUBSTANCE_HOST_DIR = os.path.dirname(os.path.abspath(__file__)) -class SubstanceAddon(OpenPypeModule, IHostAddon): +class SubstanceAddon(AYONAddon, IHostAddon): name = "substancepainter" host_name = "substancepainter" - def initialize(self, module_settings): - self.enabled = True - def add_implementation_envs(self, env, _app): # Add requirements to SUBSTANCE_PAINTER_PLUGINS_PATH plugin_path = os.path.join(SUBSTANCE_HOST_DIR, "deploy") diff --git a/client/ayon_core/hosts/traypublisher/addon.py b/client/ayon_core/hosts/traypublisher/addon.py index d8fc5ed105..70bdfe9a64 100644 --- a/client/ayon_core/hosts/traypublisher/addon.py +++ b/client/ayon_core/hosts/traypublisher/addon.py @@ -2,9 +2,9 @@ import os from ayon_core.lib import get_ayon_launcher_args from ayon_core.lib.execute import run_detached_process -from ayon_core.modules import ( +from ayon_core.addon import ( click_wrap, - OpenPypeModule, + AYONAddon, ITrayAction, IHostAddon, ) @@ -12,13 +12,12 @@ from ayon_core.modules import ( TRAYPUBLISH_ROOT_DIR = os.path.dirname(os.path.abspath(__file__)) -class TrayPublishAddon(OpenPypeModule, IHostAddon, ITrayAction): +class TrayPublishAddon(AYONAddon, IHostAddon, ITrayAction): label = "Publisher" name = "traypublisher" host_name = "traypublisher" - def initialize(self, modules_settings): - self.enabled = True + def initialize(self, settings): self.publish_paths = [ os.path.join(TRAYPUBLISH_ROOT_DIR, "plugins", "publish") ] @@ -36,7 +35,7 @@ class TrayPublishAddon(OpenPypeModule, IHostAddon, ITrayAction): def run_traypublisher(self): args = get_ayon_launcher_args( - "module", self.name, "launch" + "addon", self.name, "launch" ) run_detached_process(args) diff --git a/client/ayon_core/hosts/tvpaint/addon.py b/client/ayon_core/hosts/tvpaint/addon.py index 375f7266ae..6756b274f9 100644 --- a/client/ayon_core/hosts/tvpaint/addon.py +++ b/client/ayon_core/hosts/tvpaint/addon.py @@ -1,5 +1,5 @@ import os -from ayon_core.modules import OpenPypeModule, IHostAddon +from ayon_core.addon import AYONAddon, IHostAddon TVPAINT_ROOT_DIR = os.path.dirname(os.path.abspath(__file__)) @@ -12,13 +12,10 @@ def get_launch_script_path(): ) -class TVPaintAddon(OpenPypeModule, IHostAddon): +class TVPaintAddon(AYONAddon, IHostAddon): name = "tvpaint" host_name = "tvpaint" - def initialize(self, module_settings): - self.enabled = True - def add_implementation_envs(self, env, _app): """Modify environments to contain all required for implementation.""" diff --git a/client/ayon_core/hosts/unreal/addon.py b/client/ayon_core/hosts/unreal/addon.py index 745df951c1..c65490bd8c 100644 --- a/client/ayon_core/hosts/unreal/addon.py +++ b/client/ayon_core/hosts/unreal/addon.py @@ -1,17 +1,14 @@ import os import re -from ayon_core.modules import IHostAddon, OpenPypeModule +from ayon_core.addon import AYONAddon, IHostAddon UNREAL_ROOT_DIR = os.path.dirname(os.path.abspath(__file__)) -class UnrealAddon(OpenPypeModule, IHostAddon): +class UnrealAddon(AYONAddon, IHostAddon): name = "unreal" host_name = "unreal" - def initialize(self, module_settings): - self.enabled = True - def get_global_environments(self): return { "AYON_UNREAL_ROOT": UNREAL_ROOT_DIR, From 4e3fd869875a30347740f405a85efce14447654c Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Fri, 9 Feb 2024 18:32:27 +0100 Subject: [PATCH 43/47] console interpreter inherits from AYONaddon --- .../modules/python_console_interpreter/__init__.py | 2 +- .../python_console_interpreter/{module.py => addon.py} | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) rename client/ayon_core/modules/python_console_interpreter/{module.py => addon.py} (77%) diff --git a/client/ayon_core/modules/python_console_interpreter/__init__.py b/client/ayon_core/modules/python_console_interpreter/__init__.py index 5f54ac497b..8d5c23bdba 100644 --- a/client/ayon_core/modules/python_console_interpreter/__init__.py +++ b/client/ayon_core/modules/python_console_interpreter/__init__.py @@ -1,4 +1,4 @@ -from .module import ( +from .addon import ( PythonInterpreterAction ) diff --git a/client/ayon_core/modules/python_console_interpreter/module.py b/client/ayon_core/modules/python_console_interpreter/addon.py similarity index 77% rename from client/ayon_core/modules/python_console_interpreter/module.py rename to client/ayon_core/modules/python_console_interpreter/addon.py index 7819c9cbf3..ffad3ce707 100644 --- a/client/ayon_core/modules/python_console_interpreter/module.py +++ b/client/ayon_core/modules/python_console_interpreter/addon.py @@ -1,13 +1,12 @@ -from ayon_core.modules import OpenPypeModule, ITrayAction +from ayon_core.addon import AYONAddon, ITrayAction -class PythonInterpreterAction(OpenPypeModule, ITrayAction): +class PythonInterpreterAction(AYONAddon, ITrayAction): label = "Console" name = "python_interpreter" admin_action = True - def initialize(self, modules_settings): - self.enabled = True + def initialize(self, settings): self._interpreter_window = None def tray_init(self): @@ -22,7 +21,7 @@ class PythonInterpreterAction(OpenPypeModule, ITrayAction): if self._interpreter_window: return - from openpype_modules.python_console_interpreter.window import ( + from ayon_core.modules.python_console_interpreter.window import ( PythonInterpreterWidget ) From 5c294300246b0379e68ed38603fffd7a2e33986b Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Fri, 9 Feb 2024 18:32:39 +0100 Subject: [PATCH 44/47] launcher action addon inherits from AYONaddon --- client/ayon_core/modules/launcher_action.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/client/ayon_core/modules/launcher_action.py b/client/ayon_core/modules/launcher_action.py index c0266e3a57..1faf6ef4b1 100644 --- a/client/ayon_core/modules/launcher_action.py +++ b/client/ayon_core/modules/launcher_action.py @@ -1,19 +1,14 @@ import os from ayon_core import AYON_CORE_ROOT -from ayon_core.modules import ( - OpenPypeModule, - ITrayAction, -) +from ayon_core.addon import AYONAddon, ITrayAction -class LauncherAction(OpenPypeModule, ITrayAction): +class LauncherAction(AYONAddon, ITrayAction): label = "Launcher" name = "launcher_tool" - def initialize(self, _modules_settings): - # This module is always enabled - self.enabled = True + def initialize(self, settings): # Tray attributes self._window = None From b7d86bee3fb67ee4321de3ef5807fdbaa5949d12 Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Fri, 9 Feb 2024 18:34:42 +0100 Subject: [PATCH 45/47] renamed libray loader action to loader action --- .../modules/library_loader_action.py | 67 ------------------- client/ayon_core/modules/loader_action.py | 67 +++++++++++++++++++ 2 files changed, 67 insertions(+), 67 deletions(-) delete mode 100644 client/ayon_core/modules/library_loader_action.py create mode 100644 client/ayon_core/modules/loader_action.py diff --git a/client/ayon_core/modules/library_loader_action.py b/client/ayon_core/modules/library_loader_action.py deleted file mode 100644 index 524c4f7144..0000000000 --- a/client/ayon_core/modules/library_loader_action.py +++ /dev/null @@ -1,67 +0,0 @@ -from ayon_core.modules import AYONAddon, ITrayModule - - -class LibraryLoaderAddon(AYONAddon, ITrayModule): - name = "library_tool" - - def initialize(self, modules_settings): - # Tray attributes - self._library_loader_imported = None - self._library_loader_window = None - - def tray_init(self): - # Add library tool - self._library_loader_imported = False - try: - from ayon_core.tools.loader.ui import LoaderWindow - - self._library_loader_imported = True - except Exception: - self.log.warning( - "Couldn't load Library loader tool for tray.", - exc_info=True - ) - - # Definition of Tray menu - def tray_menu(self, tray_menu): - if not self._library_loader_imported: - return - - from qtpy import QtWidgets - # Actions - action_library_loader = QtWidgets.QAction( - "Loader", tray_menu - ) - - action_library_loader.triggered.connect(self.show_library_loader) - - tray_menu.addAction(action_library_loader) - - def tray_start(self, *_a, **_kw): - return - - def tray_exit(self, *_a, **_kw): - return - - def show_library_loader(self): - if self._library_loader_window is None: - from ayon_core.pipeline import install_ayon_plugins - - self._init_library_loader() - - install_ayon_plugins() - - self._library_loader_window.show() - - # Raise and activate the window - # for MacOS - self._library_loader_window.raise_() - # for Windows - self._library_loader_window.activateWindow() - - def _init_library_loader(self): - from ayon_core.tools.loader.ui import LoaderWindow - - libraryloader = LoaderWindow() - - self._library_loader_window = libraryloader diff --git a/client/ayon_core/modules/loader_action.py b/client/ayon_core/modules/loader_action.py new file mode 100644 index 0000000000..a0cc417b66 --- /dev/null +++ b/client/ayon_core/modules/loader_action.py @@ -0,0 +1,67 @@ +from ayon_core.addon import AYONAddon, ITrayAddon + + +class LoaderAddon(AYONAddon, ITrayAddon): + name = "loader_tool" + + def initialize(self, settings): + # Tray attributes + self._loader_imported = None + self._loader_window = None + + def tray_init(self): + # Add library tool + self._loader_imported = False + try: + from ayon_core.tools.loader.ui import LoaderWindow + + self._loader_imported = True + except Exception: + self.log.warning( + "Couldn't load Loader tool for tray.", + exc_info=True + ) + + # Definition of Tray menu + def tray_menu(self, tray_menu): + if not self._loader_imported: + return + + from qtpy import QtWidgets + # Actions + action_loader = QtWidgets.QAction( + "Loader", tray_menu + ) + + action_loader.triggered.connect(self.show_loader) + + tray_menu.addAction(action_loader) + + def tray_start(self, *_a, **_kw): + return + + def tray_exit(self, *_a, **_kw): + return + + def show_loader(self): + if self._loader_window is None: + from ayon_core.pipeline import install_ayon_plugins + + self._init_loader() + + install_ayon_plugins() + + self._loader_window.show() + + # Raise and activate the window + # for MacOS + self._loader_window.raise_() + # for Windows + self._loader_window.activateWindow() + + def _init_loader(self): + from ayon_core.tools.loader.ui import LoaderWindow + + libraryloader = LoaderWindow() + + self._loader_window = libraryloader From 3484a3d79b2b8966f78fd7c49c2aa4a72d8978d8 Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Fri, 9 Feb 2024 18:35:49 +0100 Subject: [PATCH 46/47] modified click_wrap examples and readme --- client/ayon_core/addon/README.md | 8 ++++---- client/ayon_core/addon/click_wrap.py | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/client/ayon_core/addon/README.md b/client/ayon_core/addon/README.md index b793b0ffb4..a15e8bdc69 100644 --- a/client/ayon_core/addon/README.md +++ b/client/ayon_core/addon/README.md @@ -31,7 +31,7 @@ AYON addons should contain separated logic of specific kind of implementation, s - addon must implement `get_plugin_paths` which must return dictionary with possible keys `"publish"`, `"load"`, `"create"` or `"actions"` - each key may contain list or string with a path to directory with plugins -## ITrayModule +## ITrayAddon - addon has more logic when used in a tray - it is possible that addon can be used only in the tray - abstract methods @@ -46,7 +46,7 @@ AYON addons should contain separated logic of specific kind of implementation, s - if addon has logic only in tray or for both then should be checking for `tray_initialized` attribute to decide how should handle situations ### ITrayService -- inherits from `ITrayModule` and implements `tray_menu` method for you +- inherits from `ITrayAddon` and implements `tray_menu` method for you - adds action to submenu "Services" in tray widget menu with icon and label - abstract attribute `label` - label shown in menu @@ -57,7 +57,7 @@ AYON addons should contain separated logic of specific kind of implementation, s - these states must be set by addon itself `set_service_running` is default state on initialization ### ITrayAction -- inherits from `ITrayModule` and implements `tray_menu` method for you +- inherits from `ITrayAddon` and implements `tray_menu` method for you - adds action to tray widget menu with label - abstract attribute `label` - label shown in menu @@ -89,4 +89,4 @@ AYON addons should contain separated logic of specific kind of implementation, s ### TrayAddonsManager - inherits from `AddonsManager` -- has specific implementation for Pype Tray tool and handle `ITrayModule` methods +- has specific implementation for Pype Tray tool and handle `ITrayAddon` methods diff --git a/client/ayon_core/addon/click_wrap.py b/client/ayon_core/addon/click_wrap.py index d49188312d..911a5a5707 100644 --- a/client/ayon_core/addon/click_wrap.py +++ b/client/ayon_core/addon/click_wrap.py @@ -15,7 +15,7 @@ method to convert 'click_wrap' object to 'click' object. Before ```python import click -from ayon_core.modules import AYONAddon +from ayon_core.addon import AYONAddon class ExampleAddon(AYONAddon): @@ -40,7 +40,7 @@ def mycommand(arg1, arg2): Now ``` from ayon_core import click_wrap -from ayon_core.modules import AYONAddon +from ayon_core.addon import AYONAddon class ExampleAddon(AYONAddon): @@ -72,7 +72,7 @@ Added small enhancements: Example: ```python from ayon_core import click_wrap - from ayon_core.modules import AYONAddon + from ayon_core.addon import AYONAddon class ExampleAddon(AYONAddon): From df9cb75799ed6ef43ba23ec10b81aa5de03aa422 Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Fri, 9 Feb 2024 18:43:29 +0100 Subject: [PATCH 47/47] added 'USE_AYON_ENTITIES' for forwards compatibility possibilities --- client/ayon_core/__init__.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/client/ayon_core/__init__.py b/client/ayon_core/__init__.py index c9c0dfc614..5f9eb6cea3 100644 --- a/client/ayon_core/__init__.py +++ b/client/ayon_core/__init__.py @@ -7,3 +7,6 @@ AYON_CORE_ROOT = os.path.dirname(os.path.abspath(__file__)) PACKAGE_DIR = AYON_CORE_ROOT PLUGINS_DIR = os.path.join(AYON_CORE_ROOT, "plugins") AYON_SERVER_ENABLED = True + +# Indicate if AYON entities should be used instead of OpenPype entities +USE_AYON_ENTITIES = False