cmds.move问题Maya GUI(PYTHON)
你好 我不明白为什么这不起作用。。。当我注释出Move时,GUI工作正常,因此必须这样做。 如果有人有任何想法,请告诉我cmds.move问题Maya GUI(PYTHON),python,user-interface,maya,Python,User Interface,Maya,你好 我不明白为什么这不起作用。。。当我注释出Move时,GUI工作正常,因此必须这样做。 如果有人有任何想法,请告诉我 谢谢 基本上,如果你想在所有三个方向上移动,那么你需要传递xyz=True,而且你还有一个打字错误,不是cubMX,只是cubX?。。这是一个稍微修改过的版本,正在运行 import maya.cmds as cmds def shapeTool (): ram = 'RenamerWin' if cmds.window(ram, q = True, exi
谢谢 基本上,如果你想在所有三个方向上移动,那么你需要传递xyz=True,而且你还有一个打字错误,不是cubMX,只是cubX?。。这是一个稍微修改过的版本,正在运行
import maya.cmds as cmds
def shapeTool ():
ram = 'RenamerWin'
if cmds.window(ram, q = True, exists =True):
cmds.deleteUI(ram)
ram = cmds.window("RenamerWin",t = "Shape Tool", w=300, h=300)
cmds.columnLayout(adj = True)
cmds.separator(h=20)
cmds.text("Welcome to the Shape Creator")
cmds.separator(h=20)
cubW = cmds.intSliderGrp(l = "Width", min =0, max = 10, field = True)
cubH = cmds.intSliderGrp(l = "Height", min =0, max = 10, field = True)
cubD = cmds.intSliderGrp(l = "Depth", min =0, max = 10, field = True)
cubX = cmds.intSliderGrp(l = "Translate X axis", field = True)
cubY = cmds.intSliderGrp(l = "Translate Y axis", field = True)
cubZ = cmds.intSliderGrp(l = "Translate Z axis", field = True)
def myCube(_):
myCubeWidth = cmds.intSliderGrp(cubW , q= True,value =True)
myCubeHeight = cmds.intSliderGrp(cubH , q= True,value =True)
myCubeDepth = cmds.intSliderGrp(cubD , q= True,value =True)
myCubeMoveX = cmds.intSliderGrp(cubMX , q= True,value =True)
myCubeMoveY = cmds.intSliderGrp(cubMY , q= True,value =True)
myCubeMoveZ = cmds.intSliderGrp(cubMZ , q= True,value =True)
cmds.polyCube(w=myCubeWidth,h=myCubeHeight,d=myCubeDepth , n = "myCube")
cmds.move(myCubeMoveX, x=True )
cmds.move(myCubeMoveY, x=True )
cmds.move(myCubeMoveZ, x=True )
cmds.button(l = "Create a Cube",c=myCube)
cmds.showWindow(ram)
shapeTool()
你应该在描述中加入错误,以便人们更有效地提供帮助。
import maya.cmds as cmds
def shapeTool ():
ram = 'RenamerWin'
if cmds.window(ram, q = True, exists =True):
cmds.deleteUI(ram)
ram = cmds.window("RenamerWin",t = "Shape Tool", w=300, h=300)
cmds.columnLayout(adj = True)
cmds.separator(h=20)
cmds.text("Welcome to the Shape Creator")
cmds.separator(h=20)
cubW = cmds.intSliderGrp(l = "Width", min =0, max = 10, field = True)
cubH = cmds.intSliderGrp(l = "Height", min =0, max = 10, field = True)
cubD = cmds.intSliderGrp(l = "Depth", min =0, max = 10, field = True)
cubX = cmds.intSliderGrp(l = "Translate X axis", field = True)
cubY = cmds.intSliderGrp(l = "Translate Y axis", field = True)
cubZ = cmds.intSliderGrp(l = "Translate Z axis", field = True)
def myCube(_):
myCubeWidth = cmds.intSliderGrp(cubW , q= True,value =True)
myCubeHeight = cmds.intSliderGrp(cubH , q= True,value =True)
myCubeDepth = cmds.intSliderGrp(cubD , q= True,value =True)
myCubeMoveX = cmds.intSliderGrp(cubX , q= True,value =True)
myCubeMoveY = cmds.intSliderGrp(cubY , q= True,value =True)
myCubeMoveZ = cmds.intSliderGrp(cubZ , q= True,value =True)
print myCubeMoveZ, myCubeMoveY, myCubeMoveX
cmds.polyCube(w=myCubeWidth,h=myCubeHeight,d=myCubeDepth , n = "myCube")
cmds.move(myCubeMoveX,myCubeMoveY,myCubeMoveZ, xyz=True )
cmds.button(l = "Create a Cube",c=myCube)
cmds.showWindow(ram)
shapeTool()