On Sunday, May 7, 2017 at 5:48:26 PM UTC-4, Justin Israel wrote:
> On Sun, May 7, 2017 at 6:57 PM <[email protected]> wrote:
> Hey all,
> 
> 
> 
> Trying to query selected radio Button in a popupMenu then Print the it. I 
> know in cmds.radioCollection they have a flag called "select" but for 
> cmds.radioMenuItemCollection the flag select doesn't exist.
> 
> 
> 
> import maya.cmds as cmds
> 
> 
> 
> #creates Window
> 
> myWindow = cmds.window( width=150, h = 200 )
> 
> cmds.columnLayout( adjustableColumn=True )
> 
> 
> 
> #lists Cameras
> 
> Cams = cmds.listCameras(p=True)
> 
> #Run Button
> 
> cmds.button(l="go", c = Cprint) # I know the Command it wrong! just to 
> discribe what i am looking for
> 
> cmds.popupMenu()
> 
> cmds.radioMenuItemCollection()
> 
> #creates Radio Menu
> 
> for i in Cams:
> 
>     btnName = str(i)
> 
>     RCam = cmds.menuItem( btnName,rb= True, label=btnName)
> 
> 
> 
> #shows Window
> 
> cmds.showWindow(myWindow)
> 
> 
> 
> 
> 
> def Cprint(*arg):
> 
>     print RCam # aka Selected Camera
> 
> 
> 
> 
> 
> Any help would be Amazing!
> 
> 
> 
> - Adam
> 
> 
> 
> 
> 
> One way would be to keep a list of your menu items, and then wait until the 
> end to create a closure over those items, and set that as the button callback:
> https://pastebin.com/ncDKphbm
> 
> 
> 
> You can ask each menu item if its radio button value is True
>  
> 
> 
> --
> 
> 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/7f71af79-cfad-4094-80bb-e7499b531ef9%40googlegroups.com.
> 
> For more options, visit https://groups.google.com/d/optout.

THANK YOU SO MUCH !!

-- 
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/6c025f84-a8e5-4fda-bb7c-e14ced7e8a55%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to