I have 2 files - main.py and utils.py.
In my utils.py, I have created a method:
def prompt_dialog(title, msg):
res = cmds.confirmDialog(
title=title,
message=msg,
button=['Yes','No'],
defaultButton='Yes',
cancelButton='No',
dismissString='No'
)
return res
In my main.py, there are 2 methods that calls `prompt_dialog` twice but keep getting the error `RuntimeError: Only one confirmDialog may exist at a time.` whenever I did some editing towards my QLineEdit... The other method that uses `prompt_dialog` works fine with no issue.
class MyTool(MayaQWidgetDockableMixin, QtGui.QWidget):
def __init__(self, parent=None, dockable=True):
self.connect_signals()
...
def connect_signals(self):
self.ui.frameLineEdit.editingFinished.connect(self.frameEdited)
def frameEdited(self):
# Keeps getting error here
utils.prompt_dialog("Frame Modified", "You have modified the Frame. Proceed?")
def importRef(self):
# No error seen
if not cmds.objExists("|refGroup"):
res = utils.prompt_dialog("No Ref. groups found", "Create refGroup for references import?")
if res == "Yes":
...
I tried to replace the `utils.prompt_dialog` with `cmds.confirmDialog` but still, getting the same error.
Could someone shed some light?