I’m wanting to make a slider that changes the amount of times a loop repeats…
Here is a section of the code I have and the error I have…
import maya.cmds as mc
if mc.window(ram, exists =True): #removes existing window if one already exists
mc.deleteUI(ram)
ram = mc.window(“test()”, t = “Test Window”, w = 200 ,h = 100) # Window size T= Title
mc.columnLayout(adj = True)
j = mc.intSliderGrp(l = “Width”, min =0, max =10, field=True) # field=True shows the value
mc.button(l = “Create Cube”,c=“TestLoop()”)
def TestLoop() :
for i in range(j) : #Number at the end is the amount of repeats
mc.polyCube()
mc.move(i1,i1,i*1)
mc.showWindow(ram)
ERROR is # Error: TypeError: file line 21: range() integer end argument expected, got unicode.
I’m afraid I’m not extremely knowledgeable in python so I’m not too sure what this means.