diff --git a/openpype/hosts/nuke/api/pipeline.py b/openpype/hosts/nuke/api/pipeline.py index 12562a6b6f..c2fc684c21 100644 --- a/openpype/hosts/nuke/api/pipeline.py +++ b/openpype/hosts/nuke/api/pipeline.py @@ -259,9 +259,7 @@ def _install_menu(): menu.addCommand( "Create...", lambda: host_tools.show_publisher( - parent=( - main_window if nuke.NUKE_VERSION_MAJOR >= 14 else None - ), + parent=main_window, tab="create" ) ) @@ -270,9 +268,7 @@ def _install_menu(): menu.addCommand( "Publish...", lambda: host_tools.show_publisher( - parent=( - main_window if nuke.NUKE_VERSION_MAJOR >= 14 else None - ), + parent=main_window, tab="publish" ) ) diff --git a/openpype/tools/publisher/widgets/screenshot_widget.py b/openpype/tools/publisher/widgets/screenshot_widget.py index 3504b419b4..37b958c1c7 100644 --- a/openpype/tools/publisher/widgets/screenshot_widget.py +++ b/openpype/tools/publisher/widgets/screenshot_widget.py @@ -18,10 +18,11 @@ class ScreenMarquee(QtWidgets.QDialog): super(ScreenMarquee, self).__init__(parent=parent) self.setWindowFlags( - QtCore.Qt.FramelessWindowHint + QtCore.Qt.Window + | QtCore.Qt.FramelessWindowHint | QtCore.Qt.WindowStaysOnTopHint | QtCore.Qt.CustomizeWindowHint - | QtCore.Qt.Tool) + ) self.setAttribute(QtCore.Qt.WA_TranslucentBackground) self.setCursor(QtCore.Qt.CrossCursor) self.setMouseTracking(True) @@ -210,6 +211,9 @@ class ScreenMarquee(QtWidgets.QDialog): """ tool = cls() + # Activate so Escape event is not ignored. + tool.setWindowState(QtCore.Qt.WindowActive) + # Exec dialog and return captured pixmap. tool.exec_() return tool.get_captured_pixmap() diff --git a/openpype/tools/publisher/window.py b/openpype/tools/publisher/window.py index b3138c3f45..5dd6998b24 100644 --- a/openpype/tools/publisher/window.py +++ b/openpype/tools/publisher/window.py @@ -42,7 +42,7 @@ from .widgets import ( ) -class PublisherWindow(QtWidgets.QDialog): +class PublisherWindow(QtWidgets.QWidget): """Main window of publisher.""" default_width = 1300 default_height = 800 @@ -50,7 +50,7 @@ class PublisherWindow(QtWidgets.QDialog): publish_footer_spacer = 2 def __init__(self, parent=None, controller=None, reset_on_show=None): - super(PublisherWindow, self).__init__(parent) + super(PublisherWindow, self).__init__() self.setObjectName("PublishWindow") @@ -64,17 +64,12 @@ class PublisherWindow(QtWidgets.QDialog): if reset_on_show is None: reset_on_show = True - if parent is None: - on_top_flag = QtCore.Qt.WindowStaysOnTopHint - else: - on_top_flag = QtCore.Qt.Dialog - self.setWindowFlags( - QtCore.Qt.WindowTitleHint + QtCore.Qt.Window + | QtCore.Qt.WindowTitleHint | QtCore.Qt.WindowMaximizeButtonHint | QtCore.Qt.WindowMinimizeButtonHint | QtCore.Qt.WindowCloseButtonHint - | on_top_flag ) if controller is None: @@ -189,7 +184,7 @@ class PublisherWindow(QtWidgets.QDialog): controller, content_stacked_widget ) - report_widget = ReportPageWidget(controller, parent) + report_widget = ReportPageWidget(controller, content_stacked_widget) # Details - Publish details publish_details_widget = PublishReportViewerWidget( @@ -299,6 +294,12 @@ 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 ) @@ -557,6 +558,18 @@ 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. @@ -869,6 +882,12 @@ 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) @@ -879,6 +898,7 @@ 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) diff --git a/server_addon/openpype/client/pyproject.toml b/server_addon/openpype/client/pyproject.toml index d8de9d4d96..b5978f0498 100644 --- a/server_addon/openpype/client/pyproject.toml +++ b/server_addon/openpype/client/pyproject.toml @@ -7,15 +7,16 @@ python = ">=3.9.1,<3.10" aiohttp_json_rpc = "*" # TVPaint server aiohttp-middlewares = "^2.0.0" wsrpc_aiohttp = "^3.1.1" # websocket server +Click = "^8" clique = "1.6.*" jsonschema = "^2.6.0" pymongo = "^3.11.2" log4mongo = "^1.7" pyblish-base = "^1.8.11" pynput = "^1.7.2" # Timers manager - TODO remove -"Qt.py" = "^1.3.3" -qtawesome = "0.7.3" speedcopy = "^2.1" +six = "^1.15" +qtawesome = "0.7.3" [ayon.runtimeDependencies] OpenTimelineIO = "0.14.1"