Hi,
i am consistently running into an issue while i’m trying to develop new tools. every time i introduce an error and launch the tool, i first get the correct message about the error, but often (if not always) the tool cannot be closed anymore and launching it new takes a few attempts. at the first attempt i get the message i posted in the title. after a few of these i have to restart maya to get going again. here’s the boilerplate i am using:
code to launch from the maya script editor
if 'myTool' in globals():
reload(myTool)
else:
import myTool
myTool.show_ui()
show ui function
def show_ui():
global myTool
try:
myTool.close()
myTool.deleteLater()
except:
pass
myTool = MyTool()