Wednesday, July 22, 2009

03-A Anthony Adelmann Confusion

I have some trouble getting this script to work, a lot of weird spacing errors popped up.


#assignment 3A
import maya.cmds as cmds
import random
import math
def moveVertRandomly (allCvs, minimum, maximum):
if minimum>=maximum:
print "Find new variables"
else:
for i in allCvs:
rx = random.uniform(minimum, maximum)
ry = random.uniform(minimum, maximum)
rz = random.uniform(minimum, maximum)

def moveVerticeRandomly (allCvs, minimum, maximum, x,y,z):
if minimum>= maximum:
print "Find new variables"
else:
for i in allCvs:
z = random.uniform(minimum, maximum)
cmds.move (x,y,z,i, r=3)
def extrudeFacesRandomly (allFaces, minimum, maximum):
if minimum>= maximum:
print "Find new variables"
else:
for i in allFaces:
rz = random.uniform(minimum, maximum)
cmds.polyExtrudeFacet (i, ltz = rz)
def polygonVertices (allVert, minimum, maximum):
if minimum>= maximum:
print "Find new variables"
else:
for i in allVert:
rz = random.uniform(minimum, maximum)
ry = random.uniform(minimum, maximum)
rz = random.uniform(minimum, maximum)
cmds.move (rx, ry, rz, i, r=2)
allCvs = cmds.ls("curve1.cv[:]", fl=4)
moveVertRandomly (allCvs, 11, 17)
allCvs1 = cmds.ls("nurbsPlane1.cv[:][:]", fl=1)
moveVerticeRandomly (allCvs, 5, 11, 7, 7, 12)
allFaces = cmds.ls ("pPlanel.f[:]", fl = 7)
extrudeFacesRandomly(allFaces, 7, 17)
allVert = cmds.ls("pPlane2.vtx[:]", fl=8)
polygonVertices (allVert, 6, 12)

1 comment:

  1. Hi Anthony,
    It is hard to find this kind of mistakes if I can't see the code formazted exactly the way you have it (with proper indentation). If you still have the problem, please post your code enclosed in < pre >< /pre > tags, so that it keeps the indentation when posted here....

    ReplyDelete