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?
--
You received this message because you are subscribed to the Google Groups
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/python_inside_maya/dd330d6c-83f0-4b11-ba10-3f4c453be5e6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.