From c29526280f20ce344bf33495695ca069472b18d5 Mon Sep 17 00:00:00 2001 From: AlexTranAmz <167144297+AlexTranAmz@users.noreply.github.com> Date: Wed, 29 Jan 2025 14:37:01 -0800 Subject: [PATCH 1/8] chore: refactor code to add integ test later (#223) Signed-off-by: Alex Tran <167144297+AlexTranAmz@users.noreply.github.com> --- .../unit/scripts/aws_deadline/__init__.py | 1 - test/{deadline_adaptor_for_maya => unit}/__init__.py | 0 .../deadline_adaptor_for_maya}/MayaAdaptor/__init__.py | 0 .../deadline_adaptor_for_maya}/MayaAdaptor/test_adaptor.py | 0 .../deadline_adaptor_for_maya}/MayaClient/__init__.py | 0 .../MayaClient/render_handlers/__init__.py | 0 .../MayaClient/render_handlers/test_arnold_handler.py | 0 .../MayaClient/render_handlers/test_maya_handler_base.py | 0 .../MayaClient/render_handlers/test_renderman_handler.py | 0 .../MayaClient/render_handlers/test_vray_handler.py | 0 .../deadline_adaptor_for_maya}/MayaClient/test_client.py | 0 .../deadline_adaptor_for_maya}/MayaClient/test_dir_map.py | 0 .../unit => unit/deadline_adaptor_for_maya}/__init__.py | 0 test/{ => unit}/deadline_adaptor_for_maya/maya-test.ma | 0 .../unit => unit/deadline_submitter_for_maya}/__init__.py | 0 .../deadline_submitter_for_maya/plugins}/__init__.py | 0 .../plugins/test_deadline_submitter_maya.py | 0 .../deadline_submitter_for_maya/scripts}/__init__.py | 0 .../scripts/aws_deadline}/__init__.py | 0 .../scripts/aws_deadline/test_utils.py | 0 .../deadline_submitter_for_maya}/scripts/test_assets.py | 0 .../deadline_submitter_for_maya}/scripts/test_scene.py | 0 .../deadline_submitter_for_maya}/scripts/test_utils.py | 0 .../deadline_submitter_for_maya}/scripts/testing_utilities.py | 0 24 files changed, 1 deletion(-) delete mode 100644 test/deadline_submitter_for_maya/unit/scripts/aws_deadline/__init__.py rename test/{deadline_adaptor_for_maya => unit}/__init__.py (100%) rename test/{deadline_adaptor_for_maya/unit => unit/deadline_adaptor_for_maya}/MayaAdaptor/__init__.py (100%) rename test/{deadline_adaptor_for_maya/unit => unit/deadline_adaptor_for_maya}/MayaAdaptor/test_adaptor.py (100%) rename test/{deadline_adaptor_for_maya/unit => unit/deadline_adaptor_for_maya}/MayaClient/__init__.py (100%) rename test/{deadline_adaptor_for_maya/unit => unit/deadline_adaptor_for_maya}/MayaClient/render_handlers/__init__.py (100%) rename test/{deadline_adaptor_for_maya/unit => unit/deadline_adaptor_for_maya}/MayaClient/render_handlers/test_arnold_handler.py (100%) rename test/{deadline_adaptor_for_maya/unit => unit/deadline_adaptor_for_maya}/MayaClient/render_handlers/test_maya_handler_base.py (100%) rename test/{deadline_adaptor_for_maya/unit => unit/deadline_adaptor_for_maya}/MayaClient/render_handlers/test_renderman_handler.py (100%) rename test/{deadline_adaptor_for_maya/unit => unit/deadline_adaptor_for_maya}/MayaClient/render_handlers/test_vray_handler.py (100%) rename test/{deadline_adaptor_for_maya/unit => unit/deadline_adaptor_for_maya}/MayaClient/test_client.py (100%) rename test/{deadline_adaptor_for_maya/unit => unit/deadline_adaptor_for_maya}/MayaClient/test_dir_map.py (100%) rename test/{deadline_adaptor_for_maya/unit => unit/deadline_adaptor_for_maya}/__init__.py (100%) rename test/{ => unit}/deadline_adaptor_for_maya/maya-test.ma (100%) rename test/{deadline_submitter_for_maya/unit => unit/deadline_submitter_for_maya}/__init__.py (100%) rename test/{deadline_submitter_for_maya => unit/deadline_submitter_for_maya/plugins}/__init__.py (100%) rename test/{deadline_submitter_for_maya/unit => unit/deadline_submitter_for_maya}/plugins/test_deadline_submitter_maya.py (100%) rename test/{deadline_submitter_for_maya/unit/plugins => unit/deadline_submitter_for_maya/scripts}/__init__.py (100%) rename test/{deadline_submitter_for_maya/unit/scripts => unit/deadline_submitter_for_maya/scripts/aws_deadline}/__init__.py (100%) rename test/{deadline_submitter_for_maya/unit => unit/deadline_submitter_for_maya}/scripts/aws_deadline/test_utils.py (100%) rename test/{deadline_submitter_for_maya/unit => unit/deadline_submitter_for_maya}/scripts/test_assets.py (100%) rename test/{deadline_submitter_for_maya/unit => unit/deadline_submitter_for_maya}/scripts/test_scene.py (100%) rename test/{deadline_submitter_for_maya/unit => unit/deadline_submitter_for_maya}/scripts/test_utils.py (100%) rename test/{deadline_submitter_for_maya/unit => unit/deadline_submitter_for_maya}/scripts/testing_utilities.py (100%) diff --git a/test/deadline_submitter_for_maya/unit/scripts/aws_deadline/__init__.py b/test/deadline_submitter_for_maya/unit/scripts/aws_deadline/__init__.py deleted file mode 100644 index 8d929cc..0000000 --- a/test/deadline_submitter_for_maya/unit/scripts/aws_deadline/__init__.py +++ /dev/null @@ -1 +0,0 @@ -# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/test/deadline_adaptor_for_maya/__init__.py b/test/unit/__init__.py similarity index 100% rename from test/deadline_adaptor_for_maya/__init__.py rename to test/unit/__init__.py diff --git a/test/deadline_adaptor_for_maya/unit/MayaAdaptor/__init__.py b/test/unit/deadline_adaptor_for_maya/MayaAdaptor/__init__.py similarity index 100% rename from test/deadline_adaptor_for_maya/unit/MayaAdaptor/__init__.py rename to test/unit/deadline_adaptor_for_maya/MayaAdaptor/__init__.py diff --git a/test/deadline_adaptor_for_maya/unit/MayaAdaptor/test_adaptor.py b/test/unit/deadline_adaptor_for_maya/MayaAdaptor/test_adaptor.py similarity index 100% rename from test/deadline_adaptor_for_maya/unit/MayaAdaptor/test_adaptor.py rename to test/unit/deadline_adaptor_for_maya/MayaAdaptor/test_adaptor.py diff --git a/test/deadline_adaptor_for_maya/unit/MayaClient/__init__.py b/test/unit/deadline_adaptor_for_maya/MayaClient/__init__.py similarity index 100% rename from test/deadline_adaptor_for_maya/unit/MayaClient/__init__.py rename to test/unit/deadline_adaptor_for_maya/MayaClient/__init__.py diff --git a/test/deadline_adaptor_for_maya/unit/MayaClient/render_handlers/__init__.py b/test/unit/deadline_adaptor_for_maya/MayaClient/render_handlers/__init__.py similarity index 100% rename from test/deadline_adaptor_for_maya/unit/MayaClient/render_handlers/__init__.py rename to test/unit/deadline_adaptor_for_maya/MayaClient/render_handlers/__init__.py diff --git a/test/deadline_adaptor_for_maya/unit/MayaClient/render_handlers/test_arnold_handler.py b/test/unit/deadline_adaptor_for_maya/MayaClient/render_handlers/test_arnold_handler.py similarity index 100% rename from test/deadline_adaptor_for_maya/unit/MayaClient/render_handlers/test_arnold_handler.py rename to test/unit/deadline_adaptor_for_maya/MayaClient/render_handlers/test_arnold_handler.py diff --git a/test/deadline_adaptor_for_maya/unit/MayaClient/render_handlers/test_maya_handler_base.py b/test/unit/deadline_adaptor_for_maya/MayaClient/render_handlers/test_maya_handler_base.py similarity index 100% rename from test/deadline_adaptor_for_maya/unit/MayaClient/render_handlers/test_maya_handler_base.py rename to test/unit/deadline_adaptor_for_maya/MayaClient/render_handlers/test_maya_handler_base.py diff --git a/test/deadline_adaptor_for_maya/unit/MayaClient/render_handlers/test_renderman_handler.py b/test/unit/deadline_adaptor_for_maya/MayaClient/render_handlers/test_renderman_handler.py similarity index 100% rename from test/deadline_adaptor_for_maya/unit/MayaClient/render_handlers/test_renderman_handler.py rename to test/unit/deadline_adaptor_for_maya/MayaClient/render_handlers/test_renderman_handler.py diff --git a/test/deadline_adaptor_for_maya/unit/MayaClient/render_handlers/test_vray_handler.py b/test/unit/deadline_adaptor_for_maya/MayaClient/render_handlers/test_vray_handler.py similarity index 100% rename from test/deadline_adaptor_for_maya/unit/MayaClient/render_handlers/test_vray_handler.py rename to test/unit/deadline_adaptor_for_maya/MayaClient/render_handlers/test_vray_handler.py diff --git a/test/deadline_adaptor_for_maya/unit/MayaClient/test_client.py b/test/unit/deadline_adaptor_for_maya/MayaClient/test_client.py similarity index 100% rename from test/deadline_adaptor_for_maya/unit/MayaClient/test_client.py rename to test/unit/deadline_adaptor_for_maya/MayaClient/test_client.py diff --git a/test/deadline_adaptor_for_maya/unit/MayaClient/test_dir_map.py b/test/unit/deadline_adaptor_for_maya/MayaClient/test_dir_map.py similarity index 100% rename from test/deadline_adaptor_for_maya/unit/MayaClient/test_dir_map.py rename to test/unit/deadline_adaptor_for_maya/MayaClient/test_dir_map.py diff --git a/test/deadline_adaptor_for_maya/unit/__init__.py b/test/unit/deadline_adaptor_for_maya/__init__.py similarity index 100% rename from test/deadline_adaptor_for_maya/unit/__init__.py rename to test/unit/deadline_adaptor_for_maya/__init__.py diff --git a/test/deadline_adaptor_for_maya/maya-test.ma b/test/unit/deadline_adaptor_for_maya/maya-test.ma similarity index 100% rename from test/deadline_adaptor_for_maya/maya-test.ma rename to test/unit/deadline_adaptor_for_maya/maya-test.ma diff --git a/test/deadline_submitter_for_maya/unit/__init__.py b/test/unit/deadline_submitter_for_maya/__init__.py similarity index 100% rename from test/deadline_submitter_for_maya/unit/__init__.py rename to test/unit/deadline_submitter_for_maya/__init__.py diff --git a/test/deadline_submitter_for_maya/__init__.py b/test/unit/deadline_submitter_for_maya/plugins/__init__.py similarity index 100% rename from test/deadline_submitter_for_maya/__init__.py rename to test/unit/deadline_submitter_for_maya/plugins/__init__.py diff --git a/test/deadline_submitter_for_maya/unit/plugins/test_deadline_submitter_maya.py b/test/unit/deadline_submitter_for_maya/plugins/test_deadline_submitter_maya.py similarity index 100% rename from test/deadline_submitter_for_maya/unit/plugins/test_deadline_submitter_maya.py rename to test/unit/deadline_submitter_for_maya/plugins/test_deadline_submitter_maya.py diff --git a/test/deadline_submitter_for_maya/unit/plugins/__init__.py b/test/unit/deadline_submitter_for_maya/scripts/__init__.py similarity index 100% rename from test/deadline_submitter_for_maya/unit/plugins/__init__.py rename to test/unit/deadline_submitter_for_maya/scripts/__init__.py diff --git a/test/deadline_submitter_for_maya/unit/scripts/__init__.py b/test/unit/deadline_submitter_for_maya/scripts/aws_deadline/__init__.py similarity index 100% rename from test/deadline_submitter_for_maya/unit/scripts/__init__.py rename to test/unit/deadline_submitter_for_maya/scripts/aws_deadline/__init__.py diff --git a/test/deadline_submitter_for_maya/unit/scripts/aws_deadline/test_utils.py b/test/unit/deadline_submitter_for_maya/scripts/aws_deadline/test_utils.py similarity index 100% rename from test/deadline_submitter_for_maya/unit/scripts/aws_deadline/test_utils.py rename to test/unit/deadline_submitter_for_maya/scripts/aws_deadline/test_utils.py diff --git a/test/deadline_submitter_for_maya/unit/scripts/test_assets.py b/test/unit/deadline_submitter_for_maya/scripts/test_assets.py similarity index 100% rename from test/deadline_submitter_for_maya/unit/scripts/test_assets.py rename to test/unit/deadline_submitter_for_maya/scripts/test_assets.py diff --git a/test/deadline_submitter_for_maya/unit/scripts/test_scene.py b/test/unit/deadline_submitter_for_maya/scripts/test_scene.py similarity index 100% rename from test/deadline_submitter_for_maya/unit/scripts/test_scene.py rename to test/unit/deadline_submitter_for_maya/scripts/test_scene.py diff --git a/test/deadline_submitter_for_maya/unit/scripts/test_utils.py b/test/unit/deadline_submitter_for_maya/scripts/test_utils.py similarity index 100% rename from test/deadline_submitter_for_maya/unit/scripts/test_utils.py rename to test/unit/deadline_submitter_for_maya/scripts/test_utils.py diff --git a/test/deadline_submitter_for_maya/unit/scripts/testing_utilities.py b/test/unit/deadline_submitter_for_maya/scripts/testing_utilities.py similarity index 100% rename from test/deadline_submitter_for_maya/unit/scripts/testing_utilities.py rename to test/unit/deadline_submitter_for_maya/scripts/testing_utilities.py From ab40caa10c0e527a4238a5a83aef8f976db4b977 Mon Sep 17 00:00:00 2001 From: Joel Wong <127782171+joel-wong-aws@users.noreply.github.com> Date: Fri, 31 Jan 2025 10:37:03 -0600 Subject: [PATCH 2/8] chore: update GitHub issue templates (#216) Signed-off-by: Joel Wong <127782171+joel-wong-aws@users.noreply.github.com> --- .github/ISSUE_TEMPLATE/bug.yml | 8 ++++---- .github/ISSUE_TEMPLATE/doc.yml | 2 +- .github/ISSUE_TEMPLATE/feature_request.yml | 2 +- .github/ISSUE_TEMPLATE/maintenance.yml | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug.yml b/.github/ISSUE_TEMPLATE/bug.yml index f6028d2..cad45b0 100644 --- a/.github/ISSUE_TEMPLATE/bug.yml +++ b/.github/ISSUE_TEMPLATE/bug.yml @@ -9,7 +9,7 @@ body: Thank you for taking the time to fill out this bug report! ⚠️ If the bug that you are reporting is a security-related issue or security vulnerability, - then please do not create a report via this template. Instead please + then please do not create a report via this template. Instead please notify AWS/Amazon Security via our [vulnerability reporting page](http://aws.amazon.com/security/vulnerability-reporting/) or directly via email to [AWS Security](aws-security@amazon.com). @@ -54,9 +54,9 @@ body: description: Please provide information on the environment and software versions that you are using to reproduce the bug. value: | At minimum: - 1. Operating system: (e.g. Windows Server 2022; Amazon Linux 2023; etc.) - 2. Version of Maya: - 3: Version of this package: + 1. Operating system (e.g. Windows Server 2022; Amazon Linux 2023; etc.) + 2. Version of Maya + 3. Version of this package 4. If this is from a version installed by the Deadline Cloud Submitter installer, then what version of the submitter installer? Please share other details about your environment that you think might be relevant to reproducing the bug. diff --git a/.github/ISSUE_TEMPLATE/doc.yml b/.github/ISSUE_TEMPLATE/doc.yml index 7a95fad..cdde690 100644 --- a/.github/ISSUE_TEMPLATE/doc.yml +++ b/.github/ISSUE_TEMPLATE/doc.yml @@ -2,7 +2,7 @@ name: "📕 Documentation Issue" description: Issue in the documentation title: "Docs: (short description of the issue)" -labels: ["documenation", "needs triage"] +labels: ["documentation", "needs triage"] body: - type: textarea id: documentation_issue diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml index d284468..d644b5f 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.yml +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -1,7 +1,7 @@ name: "\U0001F680 Feature Request" description: Request a new feature title: "Feature request: (short description of the feature)" -labels: ["feature", "needs triage"] +labels: ["enhancement", "needs triage"] body: - type: textarea id: problem diff --git a/.github/ISSUE_TEMPLATE/maintenance.yml b/.github/ISSUE_TEMPLATE/maintenance.yml index f2440eb..a109a9a 100644 --- a/.github/ISSUE_TEMPLATE/maintenance.yml +++ b/.github/ISSUE_TEMPLATE/maintenance.yml @@ -1,7 +1,7 @@ name: "🛠️ Maintenance" description: Some type of improvement title: "Maintenance: (short description of the issue)" -labels: ["feature", "needs triage"] +labels: ["needs triage"] body: - type: textarea id: description From e0a38272e6cab7dac27f0af8c7c64ce3a79189ae Mon Sep 17 00:00:00 2001 From: AlexTranAmz <167144297+AlexTranAmz@users.noreply.github.com> Date: Mon, 3 Feb 2025 15:50:03 -0800 Subject: [PATCH 3/8] chore: add installer descption to support Maya 2025 (#227) Signed-off-by: Alex Tran <167144297+AlexTranAmz@users.noreply.github.com> --- install_builder/deadline-cloud-for-maya.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/install_builder/deadline-cloud-for-maya.xml b/install_builder/deadline-cloud-for-maya.xml index 8a42d20..fb6acf7 100644 --- a/install_builder/deadline-cloud-for-maya.xml +++ b/install_builder/deadline-cloud-for-maya.xml @@ -1,7 +1,7 @@ deadline_cloud_for_maya - Deadline Cloud for Maya 2024 - Maya plugin for submitting jobs to AWS Deadline Cloud. Compatible with Maya 2024. + Deadline Cloud for Maya 2024 - 2025 + Maya plugin for submitting jobs to AWS Deadline Cloud. Compatible with Maya 2024 - 2025. 1 0 1 @@ -72,8 +72,8 @@ - Deadline Cloud for Maya 2024 -- Compatible with Maya 2024. + Deadline Cloud for Maya 2024 - 2025 +- Compatible with Maya 2024 - 2025. - Install the integrated Maya submitter files to the installation directory. - Register the plug-in with Maya by creating or updating the MAYA_MODULE_PATH environment variable. From 3418ff3a5ada99d36a763c46a0da7aed1e3ea62c Mon Sep 17 00:00:00 2001 From: client-software-ci <129794699+client-software-ci@users.noreply.github.com> Date: Tue, 4 Feb 2025 14:12:14 -0600 Subject: [PATCH 4/8] chore(release): 0.15.1 (#228) * chore(release): 0.15.1 Signed-off-by: client-software-ci <129794699+client-software-ci@users.noreply.github.com> * chore: update changelog Signed-off-by: Alex Tran <167144297+AlexTranAmz@users.noreply.github.com> --------- Signed-off-by: client-software-ci <129794699+client-software-ci@users.noreply.github.com> Signed-off-by: Alex Tran <167144297+AlexTranAmz@users.noreply.github.com> Co-authored-by: Alex Tran <167144297+AlexTranAmz@users.noreply.github.com> --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5d0e620..d6f22f4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## 0.15.1 (2025-02-03) + +* This release only includes documentation updates (#227) ([`e0a3827`](https://github.com/aws-deadline/deadline-cloud-for-maya/commit/e0a38272e6cab7dac27f0af8c7c64ce3a79189ae)) + + ## 0.15.0 (2025-01-09) ### BREAKING CHANGES From 94ee920f7a0707c5308a26fb33571c85c1af7555 Mon Sep 17 00:00:00 2001 From: jairaws <167156521+jairaws@users.noreply.github.com> Date: Tue, 4 Feb 2025 16:04:53 -0800 Subject: [PATCH 5/8] fix: Load scene settings when the submitter is open (#229) Signed-off-by: Jair Ruiz <167156521+jairaws@users.noreply.github.com> --- .../maya_submitter/maya_render_submitter.py | 7 +++- src/deadline/maya_submitter/mel_commands.py | 12 ++++-- .../test_mel_commands.py | 37 +++++++++++++++++++ 3 files changed, 51 insertions(+), 5 deletions(-) create mode 100644 test/unit/deadline_submitter_for_maya/test_mel_commands.py diff --git a/src/deadline/maya_submitter/maya_render_submitter.py b/src/deadline/maya_submitter/maya_render_submitter.py index dfc4844..bbc8c60 100644 --- a/src/deadline/maya_submitter/maya_render_submitter.py +++ b/src/deadline/maya_submitter/maya_render_submitter.py @@ -444,7 +444,9 @@ def _get_parameter_values( return parameter_values -def show_maya_render_submitter(parent, f=Qt.WindowFlags()) -> "Optional[SubmitJobToDeadlineDialog]": +def show_maya_render_submitter( + parent, f=Qt.WindowFlags(), load_sticky_setting: bool = False +) -> Optional[SubmitJobToDeadlineDialog]: with open(Path(__file__).parent / "default_maya_job_template.yaml") as fh: default_job_template = yaml.safe_load(fh) @@ -457,7 +459,8 @@ def show_maya_render_submitter(parent, f=Qt.WindowFlags()) -> "Optional[SubmitJo render_settings.output_path = Scene.output_path() # Load the sticky settings - render_settings.load_sticky_settings(Scene.name()) + if load_sticky_setting: + render_settings.load_sticky_settings(Scene.name()) # Create a dictionary for the layers, and accumulate data about each layer render_layer_names = get_all_renderable_render_layer_names() diff --git a/src/deadline/maya_submitter/mel_commands.py b/src/deadline/maya_submitter/mel_commands.py index ce49954..38e574e 100644 --- a/src/deadline/maya_submitter/mel_commands.py +++ b/src/deadline/maya_submitter/mel_commands.py @@ -59,12 +59,18 @@ def doIt(_): # pylint: disable=invalid-name, DeadlineCloudSubmitterCmd.dialog.close() DeadlineCloudSubmitterCmd.dialog = None - # Show existing submitter dialog, or create new one if needed + # Create a new submitter dialog. If this is the first time the submitter is + # opened, load the sticky settings. If this is not the first time, close + # the existing dialog and create a new one without loading the sticky + # settings. if DeadlineCloudSubmitterCmd.dialog: - DeadlineCloudSubmitterCmd.dialog.show() + DeadlineCloudSubmitterCmd.dialog.close() + DeadlineCloudSubmitterCmd.dialog = show_maya_render_submitter( + parent=mainwin, f=Qt.Tool, load_sticky_setting=False + ) else: DeadlineCloudSubmitterCmd.dialog = show_maya_render_submitter( - parent=mainwin, f=Qt.Tool + parent=mainwin, f=Qt.Tool, load_sticky_setting=True ) DeadlineCloudSubmitterCmd.dialog_scene_name = scene_name diff --git a/test/unit/deadline_submitter_for_maya/test_mel_commands.py b/test/unit/deadline_submitter_for_maya/test_mel_commands.py new file mode 100644 index 0000000..dd8141b --- /dev/null +++ b/test/unit/deadline_submitter_for_maya/test_mel_commands.py @@ -0,0 +1,37 @@ +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +from deadline.maya_submitter.mel_commands import DeadlineCloudSubmitterCmd +from unittest.mock import patch, Mock +import maya.api.OpenMaya as om # pylint: disable=import-error +from qtpy.QtCore import Qt # type: ignore +from qtpy.QtWidgets import ( # type: ignore + QApplication, +) + + +@patch("deadline.maya_submitter.mel_commands.show_maya_render_submitter") +@patch.object(QApplication, "instance") +@patch.object(om.MGlobal, "mayaState") +def test_deadline_cloud_submitter_cmd_sticky_setting_load_only_once( + mock_maya_state: Mock, mock_q_app: Mock, mock_show_maya_render_submitter: Mock +) -> None: + mock_maya_state.return_value = om.MGlobal.kInteractive + maya_widget: Mock = Mock() + maya_widget.objectName.return_value = "MayaWindow" + q_app_instance: Mock = Mock() + q_app_instance.topLevelWidgets.return_value = [maya_widget] + mock_q_app.return_value = q_app_instance + submitter_dialog: Mock = Mock() + mock_show_maya_render_submitter.return_value = submitter_dialog + + DeadlineCloudSubmitterCmd.doIt(Mock()) + + mock_show_maya_render_submitter.assert_called_once_with( + parent=maya_widget, f=Qt.Tool, load_sticky_setting=True + ) + + DeadlineCloudSubmitterCmd.doIt(Mock()) + + mock_show_maya_render_submitter.assert_called_with( + parent=maya_widget, f=Qt.Tool, load_sticky_setting=False + ) + submitter_dialog.close.assert_called_once() From d77f47491372abec3324410e0cd2eb7cbc68a7eb Mon Sep 17 00:00:00 2001 From: jairaws <167156521+jairaws@users.noreply.github.com> Date: Sun, 9 Feb 2025 22:15:41 -0800 Subject: [PATCH 6/8] fix: OutputPath is read from the scene in the submitter (#231) * fix: Load scene settings when the submitter is open Signed-off-by: Jair Ruiz <167156521+jairaws@users.noreply.github.com> * fix: OutputPath is read from the scene in the submitter Signed-off-by: Jair Ruiz <167156521+jairaws@users.noreply.github.com> --------- Signed-off-by: Jair Ruiz <167156521+jairaws@users.noreply.github.com> --- src/deadline/maya_submitter/scene.py | 6 +-- .../scripts/test_scene.py | 41 +++++++++++++++++-- 2 files changed, 40 insertions(+), 7 deletions(-) diff --git a/src/deadline/maya_submitter/scene.py b/src/deadline/maya_submitter/scene.py index ad9b6a1..0390985 100644 --- a/src/deadline/maya_submitter/scene.py +++ b/src/deadline/maya_submitter/scene.py @@ -130,7 +130,7 @@ def project_path() -> str: """ Returns the base path to the project the current scene is in """ - return maya.cmds.workspace(query=True, directory=True) + return maya.cmds.workspace(query=True, rootDirectory=True) @staticmethod def output_path() -> str: @@ -140,9 +140,9 @@ def output_path() -> str: # This one didn't work translated to the maya.cmds equivalent image_rule = maya.mel.eval('workspace -q -fileRuleEntry "images"') if image_rule: - return os.path.join(maya.cmds.workspace(query=True, directory=True), image_rule) + return os.path.join(Scene.project_path(), image_rule) else: - return maya.cmds.workspace(query=True, directory=True) + return Scene.project_path() @staticmethod def autotx() -> bool: diff --git a/test/unit/deadline_submitter_for_maya/scripts/test_scene.py b/test/unit/deadline_submitter_for_maya/scripts/test_scene.py index ac70ae3..4035896 100644 --- a/test/unit/deadline_submitter_for_maya/scripts/test_scene.py +++ b/test/unit/deadline_submitter_for_maya/scripts/test_scene.py @@ -1,12 +1,11 @@ # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. from typing import Optional - import pytest +import os +from unittest.mock import patch, Mock -from deadline.maya_submitter.scene import ( - FrameRange, -) +from deadline.maya_submitter.scene import FrameRange, Scene class TestFrameRange: @@ -42,3 +41,37 @@ def test_frame_repr(self, start: int, stop: int, step: Optional[int]) -> None: assert fr_repr == f"{start}-{stop}" else: assert fr_repr == f"{start}-{stop}:{step}" + + +class TestScene: + + @patch("deadline.maya_submitter.scene.maya.cmds") + def test_project_path(self, mock_maya_cmds: Mock) -> None: + Scene.project_path() + + mock_maya_cmds.workspace.assert_called_once_with(query=True, rootDirectory=True) + + @patch.object(Scene, "project_path") + @patch("deadline.maya_submitter.scene.maya") + def test_output_path_with_images_suffix(self, mock_maya: Mock, mock_project_path: Mock) -> None: + test_images_dir: str = "test_images_dir" + test_project_path: str = "test_project_path" + mock_maya.mel.eval.return_value = test_images_dir + mock_project_path.return_value = test_project_path + + output_path: str = Scene.output_path() + + assert output_path == os.path.join(test_project_path, test_images_dir) + + @patch.object(Scene, "project_path") + @patch("deadline.maya_submitter.scene.maya") + def test_output_path_without_images_suffix( + self, mock_maya: Mock, mock_project_path: Mock + ) -> None: + test_project_path: str = "test_project_path" + mock_maya.mel.eval.return_value = None + mock_project_path.return_value = test_project_path + + output_path: str = Scene.output_path() + + assert output_path == test_project_path From c9b5e7479e21c76184ba522e3cd983dd8b35a647 Mon Sep 17 00:00:00 2001 From: jairaws <167156521+jairaws@users.noreply.github.com> Date: Tue, 11 Feb 2025 16:15:37 -0800 Subject: [PATCH 7/8] fix: Update the warning message used when the scene has unsaved changes (#238) Signed-off-by: Jair Ruiz <167156521+jairaws@users.noreply.github.com> --- src/deadline/maya_submitter/maya_render_submitter.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/deadline/maya_submitter/maya_render_submitter.py b/src/deadline/maya_submitter/maya_render_submitter.py index bbc8c60..9a79aee 100644 --- a/src/deadline/maya_submitter/maya_render_submitter.py +++ b/src/deadline/maya_submitter/maya_render_submitter.py @@ -538,7 +538,10 @@ def on_create_job_bundle_callback( scene_name = maya.cmds.file(q=True, sn=True) button = maya.cmds.confirmDialog( title="Warning: Scene Changes not Saved", - message=("Save scene to %s before submitting?" % scene_name), + message=( + "The scene has unsaved local changes that will not be included in the job submission.\n\nDo you want to save the scene to %s before submitting?" + % scene_name + ), button=["Yes", "No"], defaultButton="No", cancelButton="No", From 677137d6a67e18d1a787671dd134096a8df0b04a Mon Sep 17 00:00:00 2001 From: Alex Hughes Date: Thu, 13 Feb 2025 09:36:28 -0800 Subject: [PATCH 8/8] fix: Use `byFrameStep` instead of `byFrame` (#224) This is talked about in the following link: https://help.autodesk.com/view/MAYAUL/2023/ENU/?guid=__Nodes_renderGlobals_html Essentially `byFrame` is no longer used but kept for backwards compatibility. And the value it gives us is different than `byFrameStep` Signed-off-by: Alex Hughes --- src/deadline/maya_submitter/scene.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/deadline/maya_submitter/scene.py b/src/deadline/maya_submitter/scene.py index 0390985..14c2070 100644 --- a/src/deadline/maya_submitter/scene.py +++ b/src/deadline/maya_submitter/scene.py @@ -56,7 +56,7 @@ def frame_step() -> int: """ Returns the frame step of the current render. """ - return int(maya.cmds.getAttr("defaultRenderGlobals.byFrame")) + return int(maya.cmds.getAttr("defaultRenderGlobals.byFrameStep")) @staticmethod def extension_padding() -> int: