From aa5566241e140bf270a2b436759b85d99f370ef0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Samohel?= Date: Wed, 13 Mar 2024 10:13:20 +0100 Subject: [PATCH 1/8] :package: update unreal integration submodule --- client/ayon_core/hosts/unreal/integration | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/ayon_core/hosts/unreal/integration b/client/ayon_core/hosts/unreal/integration index 6d2793170e..04b35dbf5f 160000 --- a/client/ayon_core/hosts/unreal/integration +++ b/client/ayon_core/hosts/unreal/integration @@ -1 +1 @@ -Subproject commit 6d2793170ed57187842f683a943593973abcc337 +Subproject commit 04b35dbf5fc42d905281fc30d3a22b139c1855e5 From 30b854128ebaed681d7a84a2da014327cbc418d2 Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Wed, 13 Mar 2024 12:29:47 +0100 Subject: [PATCH 2/8] change scrollbar stylesheet to avoid issues --- client/ayon_core/style/style.css | 32 +++++++++++++++++++ .../tools/publisher/widgets/report_page.py | 2 ++ 2 files changed, 34 insertions(+) diff --git a/client/ayon_core/style/style.css b/client/ayon_core/style/style.css index fcc76b0bff..607fd1fa31 100644 --- a/client/ayon_core/style/style.css +++ b/client/ayon_core/style/style.css @@ -1067,6 +1067,38 @@ PixmapButton:disabled { font-size: 13pt; } +#PublisherVerticalScrollArea QScrollBar { + background: transparent; + margin: 0; + border: none; +} + +#PublisherVerticalScrollArea QScrollBar:horizontal { + height: 10px; + margin: 0; +} + +#PublisherVerticalScrollArea QScrollBar:vertical { + width: 10px; + margin: 0; +} + +#PublisherVerticalScrollArea QScrollBar::handle { + background: {color:bg-scroll-handle}; + border-radius: 4px; + margin: 1px; +} + +#PublisherVerticalScrollArea QScrollBar::handle:horizontal { + min-width: 20px; + min-height: 8px; +} + +#PublisherVerticalScrollArea QScrollBar::handle:vertical { + min-height: 20px; + min-width: 8px; +} + ValidationArtistMessage QLabel { font-size: 20pt; font-weight: bold; diff --git a/client/ayon_core/tools/publisher/widgets/report_page.py b/client/ayon_core/tools/publisher/widgets/report_page.py index 1bbe8033f9..9d16fb67b2 100644 --- a/client/ayon_core/tools/publisher/widgets/report_page.py +++ b/client/ayon_core/tools/publisher/widgets/report_page.py @@ -56,6 +56,8 @@ class VerticalScrollArea(QtWidgets.QScrollArea): self.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAsNeeded) self.setLayoutDirection(QtCore.Qt.RightToLeft) + self.setObjectName("PublisherVerticalScrollArea") + self.setAttribute(QtCore.Qt.WA_TranslucentBackground) # Background of scrollbar will be transparent scrollbar_bg = self.verticalScrollBar().parent() From 0b7efa19fe44845b3d1ec6628d6f8ff23903b2cb Mon Sep 17 00:00:00 2001 From: ChunYou Date: Wed, 13 Mar 2024 13:05:38 +0000 Subject: [PATCH 3/8] Maximise viewport instead of changing layout. Adding validator for extended viewport --- .../hosts/max/api/preview_animation.py | 25 +++++++++++-------- .../publish/validate_extended_viewport.py | 21 ++++++++++++++++ 2 files changed, 35 insertions(+), 11 deletions(-) create mode 100644 client/ayon_core/hosts/max/plugins/publish/validate_extended_viewport.py diff --git a/client/ayon_core/hosts/max/api/preview_animation.py b/client/ayon_core/hosts/max/api/preview_animation.py index f715efa53d..3872c4e493 100644 --- a/client/ayon_core/hosts/max/api/preview_animation.py +++ b/client/ayon_core/hosts/max/api/preview_animation.py @@ -31,23 +31,26 @@ def viewport_layout_and_camera(camera, layout="layout_1"): layout (str): layout to use in viewport, defaults to `layout_1` Use None to not change viewport layout during context. """ + needs_maximise = 0 + # Set to first active non extended viewport + rt.viewport.activeViewportEx(1) original_camera = rt.viewport.getCamera() - original_layout = rt.viewport.getLayout() - if not original_camera: - # if there is no original camera - # use the current camera as original - original_camera = rt.getNodeByName(camera) + original_type = rt.viewport.getType() review_camera = rt.getNodeByName(camera) + try: - if layout is not None: - layout = rt.Name(layout) - if rt.viewport.getLayout() != layout: - rt.viewport.setLayout(layout) + if rt.viewport.getLayout()!=rt.name(layout): + rt.execute("max tool maximize") + needs_maximise = 1 rt.viewport.setCamera(review_camera) yield finally: - rt.viewport.setLayout(original_layout) - rt.viewport.setCamera(original_camera) + if needs_maximise == 1: + rt.execute("max tool maximize") + if original_type == rt.Name("view_camera"): + rt.viewport.setCamera(original_camera) + else: + rt.viewport.setType(original_type) @contextlib.contextmanager diff --git a/client/ayon_core/hosts/max/plugins/publish/validate_extended_viewport.py b/client/ayon_core/hosts/max/plugins/publish/validate_extended_viewport.py new file mode 100644 index 0000000000..96686970c6 --- /dev/null +++ b/client/ayon_core/hosts/max/plugins/publish/validate_extended_viewport.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +import pyblish.api +from ayon_core.pipeline import PublishValidationError +from pymxs import runtime as rt + + +class ValidateExtendedViewport(pyblish.api.InstancePlugin): + """Validate if the first viewport is an extended viewport.""" + + order = pyblish.api.ValidatorOrder + families = ["review"] + hosts = ["max"] + label = "Validate Extended Viewport" + + def process(self, instance): + try: + rt.viewport.activeViewportEx(1) + except RuntimeError: + raise PublishValidationError( + "Please make sure one viewport is not an extended viewport", title=self.label) + From 242b38b3d9b55e08537db75d07b55195b7efce24 Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Wed, 13 Mar 2024 14:38:24 +0100 Subject: [PATCH 4/8] add margin to left to offset content from scroll bar --- client/ayon_core/tools/publisher/widgets/report_page.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/client/ayon_core/tools/publisher/widgets/report_page.py b/client/ayon_core/tools/publisher/widgets/report_page.py index 9d16fb67b2..7475b39f52 100644 --- a/client/ayon_core/tools/publisher/widgets/report_page.py +++ b/client/ayon_core/tools/publisher/widgets/report_page.py @@ -502,7 +502,9 @@ class ValidationErrorsView(QtWidgets.QWidget): errors_scroll.setWidget(errors_widget) errors_layout = QtWidgets.QVBoxLayout(errors_widget) - errors_layout.setContentsMargins(0, 0, 0, 0) + # Add 5 margin to left so the is not directly on the edge of the + # scroll widget + errors_layout.setContentsMargins(5, 0, 0, 0) layout = QtWidgets.QVBoxLayout(self) layout.addWidget(errors_scroll, 1) From fc85f469f7884852f7d1036c61c14a375c80a1aa Mon Sep 17 00:00:00 2001 From: ChunYou Date: Thu, 14 Mar 2024 02:17:05 +0000 Subject: [PATCH 5/8] Update Publish Validation Error Description --- .../hosts/max/plugins/publish/validate_extended_viewport.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/client/ayon_core/hosts/max/plugins/publish/validate_extended_viewport.py b/client/ayon_core/hosts/max/plugins/publish/validate_extended_viewport.py index 96686970c6..7d9e3dc6fe 100644 --- a/client/ayon_core/hosts/max/plugins/publish/validate_extended_viewport.py +++ b/client/ayon_core/hosts/max/plugins/publish/validate_extended_viewport.py @@ -17,5 +17,8 @@ class ValidateExtendedViewport(pyblish.api.InstancePlugin): rt.viewport.activeViewportEx(1) except RuntimeError: raise PublishValidationError( - "Please make sure one viewport is not an extended viewport", title=self.label) + "Please make sure at least one viewport is not an extended viewport but a 3dsmax supported viewport " + "i.e camera/persp/orthographic view. To rectify it, please go to view in the top menubar, " + "go to Views -> Viewports Configuration -> layout and right click on one of the panels to change " + "it.", title=self.label) From e8bfb903620d07f8a74b76db075384a48c5a106d Mon Sep 17 00:00:00 2001 From: ChunYou Date: Thu, 14 Mar 2024 11:54:54 +0000 Subject: [PATCH 6/8] Change Instance to Context --- .../hosts/max/plugins/publish/validate_extended_viewport.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/ayon_core/hosts/max/plugins/publish/validate_extended_viewport.py b/client/ayon_core/hosts/max/plugins/publish/validate_extended_viewport.py index 7d9e3dc6fe..8c64508a8b 100644 --- a/client/ayon_core/hosts/max/plugins/publish/validate_extended_viewport.py +++ b/client/ayon_core/hosts/max/plugins/publish/validate_extended_viewport.py @@ -4,7 +4,7 @@ from ayon_core.pipeline import PublishValidationError from pymxs import runtime as rt -class ValidateExtendedViewport(pyblish.api.InstancePlugin): +class ValidateExtendedViewport(pyblish.api.ContextPlugin): """Validate if the first viewport is an extended viewport.""" order = pyblish.api.ValidatorOrder @@ -12,7 +12,7 @@ class ValidateExtendedViewport(pyblish.api.InstancePlugin): hosts = ["max"] label = "Validate Extended Viewport" - def process(self, instance): + def process(self, context): try: rt.viewport.activeViewportEx(1) except RuntimeError: From df83dfaf40fc5f87767e2645f96d05efbe7f97e8 Mon Sep 17 00:00:00 2001 From: r42-chun <73248638+r42-chun@users.noreply.github.com> Date: Thu, 14 Mar 2024 12:08:37 +0000 Subject: [PATCH 7/8] Commit description and rectify line length Co-authored-by: Roy Nieterau --- .../plugins/publish/validate_extended_viewport.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/client/ayon_core/hosts/max/plugins/publish/validate_extended_viewport.py b/client/ayon_core/hosts/max/plugins/publish/validate_extended_viewport.py index 8c64508a8b..ed476ec874 100644 --- a/client/ayon_core/hosts/max/plugins/publish/validate_extended_viewport.py +++ b/client/ayon_core/hosts/max/plugins/publish/validate_extended_viewport.py @@ -17,8 +17,13 @@ class ValidateExtendedViewport(pyblish.api.ContextPlugin): rt.viewport.activeViewportEx(1) except RuntimeError: raise PublishValidationError( - "Please make sure at least one viewport is not an extended viewport but a 3dsmax supported viewport " - "i.e camera/persp/orthographic view. To rectify it, please go to view in the top menubar, " - "go to Views -> Viewports Configuration -> layout and right click on one of the panels to change " - "it.", title=self.label) + "Please make sure one viewport is not an extended viewport", + description = ( + "Please make sure at least one viewport is not an " + "extended viewport but a 3dsmax supported viewport " + "i.e camera/persp/orthographic view.\n\n" + "To rectify it, please go to view in the top menubar, " + "go to Views -> Viewports Configuration -> Layout and " + "right click on one of the panels to change it." + )) From 305c76b6016185fd770a00d587907bd88847e7c5 Mon Sep 17 00:00:00 2001 From: r42-chun <73248638+r42-chun@users.noreply.github.com> Date: Thu, 14 Mar 2024 12:08:57 +0000 Subject: [PATCH 8/8] Add space for cosmetics Co-authored-by: Roy Nieterau --- client/ayon_core/hosts/max/api/preview_animation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/ayon_core/hosts/max/api/preview_animation.py b/client/ayon_core/hosts/max/api/preview_animation.py index 3872c4e493..399d3b6222 100644 --- a/client/ayon_core/hosts/max/api/preview_animation.py +++ b/client/ayon_core/hosts/max/api/preview_animation.py @@ -39,7 +39,7 @@ def viewport_layout_and_camera(camera, layout="layout_1"): review_camera = rt.getNodeByName(camera) try: - if rt.viewport.getLayout()!=rt.name(layout): + if rt.viewport.getLayout() != rt.name(layout): rt.execute("max tool maximize") needs_maximise = 1 rt.viewport.setCamera(review_camera)