From 2e9a63c4101d13fa7dcd46d17aad9edbb91ebd49 Mon Sep 17 00:00:00 2001 From: wijnand Date: Thu, 28 Jun 2018 18:45:58 +0200 Subject: [PATCH] added check for parent window --- colorbleed/maya/__init__.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/colorbleed/maya/__init__.py b/colorbleed/maya/__init__.py index 60fb897c46..456d782d7a 100644 --- a/colorbleed/maya/__init__.py +++ b/colorbleed/maya/__init__.py @@ -126,15 +126,17 @@ def on_save(_): QtWidgets.QApplication.topLevelWidgets()} parent = top_level_widgets.get("MayaWindow", None) + if parent is None: + pass + else: + dialog = popup.Popup(parent=parent) + dialog.setWindowTitle("Maya scene not in line with project") + dialog.setMessage("The FPS is out of sync, please fix") + # Set new text for button (add optional argument for the popup?) + dialog.widgets["show"].setText("Fix") + dialog.on_show.connect(lib.set_project_fps) - dialog = popup.Popup(parent=parent) - dialog.setWindowTitle("Maya scene not in line with project") - dialog.setMessage("The FPS is out of sync, please fix") - # Set new text for button (could be an optional argument for the popup) - dialog.widgets["show"].setText("Fix") - dialog.on_show.connect(lib.set_project_fps) - - dialog.show() + dialog.show() def on_open(_):