From b56783dce0a24bc1b25da02e6b05d89b6bde9035 Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Wed, 3 Nov 2021 11:28:42 -0500 Subject: [PATCH] Add quick iteration workflow to the custom python tool template. Signed-off-by: Chris Galvan --- .../Template/Editor/Scripts/${NameLower}_dialog.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Templates/PythonToolGem/Template/Editor/Scripts/${NameLower}_dialog.py b/Templates/PythonToolGem/Template/Editor/Scripts/${NameLower}_dialog.py index 19194ec97f..3a0e6c9a7b 100644 --- a/Templates/PythonToolGem/Template/Editor/Scripts/${NameLower}_dialog.py +++ b/Templates/PythonToolGem/Template/Editor/Scripts/${NameLower}_dialog.py @@ -33,3 +33,12 @@ class ${SanitizedCppName}Dialog(QDialog): self.mainLayout.addWidget(self.helpLabel, 0, Qt.AlignCenter) self.setLayout(self.mainLayout) + + +if __name__ == "__main__": + # Create a new instance of the tool if launched from the Python Scripts window, + # which allows for quick iteration without having to close/re-launch the Editor + test_dialog = ${SanitizedCppName}Dialog() + test_dialog.setWindowTitle("${SanitizedCppName}") + test_dialog.show() + test_dialog.adjustSize()