Hi all, pardon my coding as it has really been a while since I have last 
touched on scripting. Currently I am trying to make some stuff work but 
keeps bumping into issues here and there.
Really in need of some insights
    
1. I am unable to return the text value from the selection in showUI
2. Prior to #1, when I tested without the showUI() function, it works where 
the Ok button does prints some stuff however the window is never closed 
upon clicking on the button. So my question here will be how do I close the 
window upon hitting the Ok button
3. Related to #1, I am trying to get the value - the text value from the 
selection and have it run in my main code - pcikAFormat() in the optionMenu 
command, value flag..

4. Just wondering what is the best way that I can select the latest created 
node/item? 

def defaultButtonPush(*args):
    #valid = ""
    valid = showUI.validFormatsLs.getValue()
    #return valid
        
def showUI():
    win_name = "Select Camera Format"
    if cmds.window(win_name, exists = True):
        cmds.deleteUI(win_name)
    
    main_win = cmds.window(title = "Select Camera Format", width = 100, 
height = 50)
    cmds.columnLayout()
    
    validFormats = ['itemA-01', 'itemB-02', 'itemC-02', 'itemD-01', 
'itemE-01', 'itemF-03']
    
    validFormatsLs = pm.optionMenu (label = 'Select a format')
    
    for item in validFormats:
        cmds.menuItem(label = str(item))
        
    cmds.button( label = 'Ok', aop = True, command = ('defaultButtonPush()'
))
    cmds.button( label = 'Cancel', command=('cmds.deleteUI(\"' + window + '\", 
window=True)') )  


    cmds.showWindow( main_win )
    
showUI()

This is my main code
def pickAFormat():
    ...
    ...
    mel.eval('CBdeleteConnection 
"camera01_cameraFlattenedShape.lensSqueezeRatio";')
    
    showUI()
    cmds.optionMenu('filmbackMenu', edit = True, value = ??? ) # value is 
to take the text selection from the showUI

-- 
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/3b07d3e7-ed49-4ede-8993-eefff381a3cb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to