Community
Maya Programming
Welcome to Autodesk’s Maya Forums. Share your knowledge, ask questions, and explore popular Maya SDK topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Maya Python Basic GUI error

2 REPLIES 2
Reply
Message 1 of 3
UP822404
600 Views, 2 Replies

Maya Python Basic GUI error

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

2 REPLIES 2
Message 2 of 3
UP822404
in reply to: UP822404

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")

Message 3 of 3
rflannery
in reply to: UP822404

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)"

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report