Error: RuntimeError: Object's name 'Done' is not unique. in Maya python
Error: RuntimeError: Object's name 'Done' is not unique. in Maya python
我正在使用 Maya python cmd 创建 Ui。
我的代码如下..
代码
import maya.cmds as cmds
window = cmds.window( title="Render",widthHeight=(300,200),minimizeButton=True,maximizeButton=True )
inner_child_5 = cmds.rowColumnLayout(numberOfColumns=2)
for val in range(0,2):
cmds.checkBox(label="layer")
cmds.text("Done",width=150, height=10,align='left')
cmds.showWindow( window )
我遇到了一个错误,请帮我解决这个错误
错误:
Error: RuntimeError: file line 6: Object's name 'Done' is not unique.
有一个愚蠢的错误。我忘了把标签放在第 6 行....
cmds.text(label = "Done",width=150, height=10,align='left')
您尝试在循环中创建文本 UI 元素。第一次一切正常,但第二次 UI 元素已经存在。尝试使用这样的唯一名称创建它:
cmds.text("Done" + str(val), .....)
或者干脆忽略它并使用标签参数
cmds.text(label="Done", .....)
我正在使用 Maya python cmd 创建 Ui。
我的代码如下..
代码
import maya.cmds as cmds
window = cmds.window( title="Render",widthHeight=(300,200),minimizeButton=True,maximizeButton=True )
inner_child_5 = cmds.rowColumnLayout(numberOfColumns=2)
for val in range(0,2):
cmds.checkBox(label="layer")
cmds.text("Done",width=150, height=10,align='left')
cmds.showWindow( window )
我遇到了一个错误,请帮我解决这个错误
错误:
Error: RuntimeError: file line 6: Object's name 'Done' is not unique.
有一个愚蠢的错误。我忘了把标签放在第 6 行....
cmds.text(label = "Done",width=150, height=10,align='left')
您尝试在循环中创建文本 UI 元素。第一次一切正常,但第二次 UI 元素已经存在。尝试使用这样的唯一名称创建它:
cmds.text("Done" + str(val), .....)
或者干脆忽略它并使用标签参数
cmds.text(label="Done", .....)