Wednesday, July 8, 2009

03A - Deborah Kaiser - doubt

Hey daniel, i dont know why i can only make the curve part work, i get a syntax error with the extrude and the last one and i can not figure out why.
Could u help me?

Thnx!

########################################################
##
###03A
##

import maya.cmds as cmds
import random
import math


#MOVE CURVES

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)
cmds.move (rx,ry,rz,i,r=1)

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=1)


#EXTRUDE FACES

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)


#POLYGON VERTICES

def polygonVertices (allVert, minimum, maximum):
if minimum>= maximum:
print "Find new variables!"
else:
for i in allVert:
rx = random.uniform(minimum, maximum)
ry = random.uniform(minimum, maximum)
rz = random.uniform(minimum, maximum)
cmds.move (rx,ry,rz,i,r=1)


allCvs = cmds.ls("curve1.cv[:]", fl=1)
moveVertRandomly (allCvs, 5, 25)

allCvs1 = cmds.ls("nurbsPlane1.cv[:][:]", fl=1)
moveVerticeRandomly (allCvs, 10, 1, 2,20,5)


allVert = cmds.ls("pPlane2.vtx[:]", fl=1)
polygonVertices (allVert, 0, 5)

No comments:

Post a Comment