Skip to content

Commit

Permalink
fix: Prevent duplicate submitter dialogs, and show submitter over May…
Browse files Browse the repository at this point in the history
…a window

Signed-off-by: Ramon Montoya Vozmediano <[email protected]>
  • Loading branch information
rmv committed Sep 20, 2023
1 parent e352adf commit d5c6845
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion src/deadline/maya_submitter/mel_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"""
import maya.api.OpenMaya as om # pylint: disable=import-error
import maya.cmds
from PySide2.QtCore import Qt # pylint: disable=import-error
from PySide2.QtWidgets import ( # pylint: disable=import-error; type: ignore
QApplication,
)
Expand All @@ -20,6 +21,11 @@ class DeadlineCloudSubmitterCmd(om.MPxCommand):
Class used to create the DeadlineCloudSubmitter Mel Command.
"""

# Current submitter dialog if any
dialog = None
# Scene name at dialog's time of creation
dialog_scene_name = None

@staticmethod
def doIt(_): # pylint: disable=invalid-name,
"""
Expand Down Expand Up @@ -47,7 +53,20 @@ def doIt(_): # pylint: disable=invalid-name,
)
return

show_maya_render_submitter(parent=mainwin)
# Delete the dialog if the scene has changed
if DeadlineCloudSubmitterCmd.dialog_scene_name != scene_name:
if DeadlineCloudSubmitterCmd.dialog:
DeadlineCloudSubmitterCmd.dialog.close()
DeadlineCloudSubmitterCmd.dialog = None

# Show existing submitter dialog, or create new one if needed
if DeadlineCloudSubmitterCmd.dialog:
DeadlineCloudSubmitterCmd.dialog.show()
else:
DeadlineCloudSubmitterCmd.dialog = show_maya_render_submitter(
parent=mainwin, f=Qt.Tool
)
DeadlineCloudSubmitterCmd.dialog_scene_name = scene_name


class DeadlineCloudJobBundleOutputTestsCmd(om.MPxCommand):
Expand Down

0 comments on commit d5c6845

Please sign in to comment.