2017-05-03 19 views
0

안녕하세요, popupMenu에서 선택한 menuItem (radioButton)의 이름을 가져 오려고합니다. cmds.radioCollection에는 "select"라는 플래그가 있지만 cmds.radioMenuItemCollection에는 플래그 select가 존재하지 않습니다. 선택한 옵션의 이름을 얻으려면 어떻게해야합니까?Cmds.radioMenuItemCollection - 선택 가져 오기

답변

0

ADSK는 모든 컨트롤을 노출하는 것을 잊어 버렸습니다. 일반 radioCollection으로보고하지 않습니다. 그래서 유일한 해결 방법은 다음과 같습니다 :

cmds.window(menuBar=True) 
q = cmds.menu(label='Position') 
r = cmds.radioMenuItemCollection() 
x =cmds.menuItem(label='Top', radioButton=False) 
y = cmds.menuItem(label='Middle', radioButton=False) 
z = cmds.menuItem(label='Bottom', radioButton=True) 
cmds.showWindow() 

selected = max ([t if cmds.menuItem(t, q=True, rb=True) else None for t in (x,y,z)]) 
+0

나는 이해하지만 메뉴 항목을 인쇄하려고합니다. 그리고 "선택"을 시도해보고 인쇄하면 선택한 이름으로 돌아 가지 않습니다. –