2015-11-25 51 views
-2

enter image description here瑪雅文件<瑪雅控制檯>無對象名稱指定textScrollList

cmds.frameLayout(label=all[0],borderStyle='out',collapse=1,collapsable=True,width=210) 
cmds.columnLayout() 
cmds.textScrollList(h=100,w=200,allowMultiSelection=True) 
for i in range(0,size): 
    cmds.textScrollList(edit=True,a=string[i]) 

這是我的Python代碼

我要問,爲什麼

cmds.textScrollList(h=100,w=200,allowMultiSelection=True) 
for i in range(0,size): 
    cmds.textScrollList(edit=True,a=string[i])" 

有錯誤

"No object name specified textScrollList" 

w ^我可以做什麼?

+0

您好,歡迎StackOverflow上,您的基本問題有很多的格式問題。在提問之前,請遵循[此處]的指導原則(http://stackoverflow.com/help/how-to-ask)。發佈代碼,錯誤代碼,報價等時,您確實需要使用適當的降價。另外請不要使用IDE的屏幕截圖。這是時間讓你浪費(採取截圖,它託管等)和閱讀器(不是真正可讀,無法複製並粘貼到一個IDE ...) – DrHaze

回答

0

錯誤代碼本身就說明了,你需要在創建爲您textScrollList指定一個名稱並對其進行編輯。或者Maya將無法知道您想要在哪個textScrollList附加項目。

這可以是任何你想要的字母數字字符,只要有在它沒有空格(如果需要使用下劃線)。

cmds.textScrollList("I_like_painting_with_poop", h=100,w=200,allowMultiSelection=True) 
for i in range(0,size): 
    cmds.textScrollList("I_like_painting_with_poop", edit=True,a=string[i]) 

考慮嘗試應用的命名約定所有你的UI元素。