Thursday, May 14, 2009

numColumns = 10
numRows = 10
numHeights = 10

for k in range (0, numHeights,1):
z = k
for i in range (0, numColumns,1):
x=i
print i
for j in range(0,numRows, 1):
y = j

myPoint = [x,y,z]
cmds.spaceLocator (p=myPoint)

1 comment:

  1. Nice. As you can see, you can nest as many loops as you want, according with what you want to do. Just be careful because the more loops you nest, the longer your code will take to execute and the more memory it will take.

    If you really need to make lots of nested loops, maybe you should take a look at recursive functions.

    ReplyDelete