Maya Python Basic GUI error

Maya Python Basic GUI error

Anonymous
Not applicable
1,361 Views
2 Replies
Message 1 of 3

Maya Python Basic GUI error

Anonymous
Not applicable

Im creating a user interface in Maya using Python and i keep getting this error?

Does anybody know how to counter this.

https://gyazo.com/62ebe4ff5345e44831870b920beed5ba

cheers

0 Likes
1,362 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable

import maya.cmds as cmds
if mc.window(ram, exists =True):
mc.deleteUI(ram)


ram = cmds.window("RenamerWin",t = "Renamer Tool", w=300, h=300)
cmds.columnLayout(adj = True)
cmds.text("Welcome to the tool renamer")
cmds.separator(h=10)

cubW = cmds.intSliderGrp(1 = "Width",min =0, max =10, field =True)
cubH = cmds.intSliderGrp(1 = "Height",min =0, max =10, field =True)
cubD = cmds.intSliderGrp(1 = "Depth",min =0, max =10, field =True)

cmds.button(l = "Create a Cube",c="myCube()")

cmds.showWindow(ram)

def myCube():
myCubeWidth = cmds.intSliderGrp(cubW , q= True,value =True)
myCubeHeight = cmds.intSliderGrp(cubH , q= True,value =True)
myCubeDepth = cmds.intSliderGrp(cubWD , q= True,value =True)
finalCube = cmds.polyCube(w=myCubeWidth,h=myCubeHeight,d=myCubeDepth , n = "myCube")

0 Likes
Message 3 of 3

RFlannery1
Collaborator
Collaborator

The first thing I noticed is that you are using "cmds" in most of your code, but at the very top, you are using "mc".

 

Also, the line "if mc.window(ram, exists =True):" won't work until "ram" has been defined.  So you have to execute this line at least once: "ram = cmds.window("RenamerWin",t = "Renamer Tool", w=300, h=300)"

0 Likes