I am calling a method within another. and the error for this script i am getting is
NameError: name 'mnDialog' is not defined
Is there a reason for it? I think it has something to do with executing a command which isn't on the global level. (i didn't have the impression that python has a global and local variable declaration.) What is the right syntax or the go around this? thank you for your time.
import maya.cmds as cmds
def mnProgRun():
def mnDialog(*args):
cmds.confirmDialog( title='Confirm', message='Are you sure?',button=['Yes','No'], defaultButton='Yes',cancelButton='No',dismissString='No' )
def mnMakeWin():
cmds.window( 'mnWin', title = 'testman', wh=(260,100))
cmds.columnLayout(adjustableColumn=False, columnAlign='center')
cmds.button( label="Yes,it works",align='center',width=120,height=25, backgroundColor=[0.5,1,0.5],command='cmds.scriptJob( event=["SelectionChanged","mnDialog"])')
cmds.button( label="No, Thank You!",align='center',width=120,height=25, backgroundColor=[1,0.5,0.5],command='cmds.deleteUI("mnWin")')
cmds.showWindow( 'mnWin' )
mnMakeWin()
mnProgRun()