########################################################
##
###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)
allFaces = cmds.ls("pPlane1.f[:]", fl=1)
extrudeFacesRandomly(allFaces, 5, 10)
allVert = cmds.ls("pPlane2.vtx[:]", fl=1)
polygonVertices (allVert, 0, 5)
Friday, July 10, 2009
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment