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)
Showing posts with label Anthony. Show all posts
Showing posts with label Anthony. Show all posts
Wednesday, July 22, 2009
Sunday, July 12, 2009
02B - Anthony Adelmann

import maya.cmds as cmds
from math import*
from random import*
#from curves to surfaces
#step 1, create a curve
def curves (amplitude):
#def initial variables
numPoints= 70
#create an empty list to store the points
points=[]
#loop and gather information
for i in range (1,numPoints,1):
#function of the spiral curve:
x=sin(i)*amplitude
y=cos(i)*amplitude
z=i
myPoint=(x,y,z)
#store the points in the list
points.append(myPoint)
myCurve=cmds.curve(d=3, p=points)
return myCurve
#create an empty list to store the curves
myCurve=[]
#define the number of curves
numCurves=19
#function to call the curves in a loop
for i in range(0,numCurves,2):
crv=curves(i)
#store the curve in the list
myCurve.append (crv)
print crv
#move the curves
cmds.move(3,11,4, crv)
#loft the curves
cmds.loft(myCurve)
Saturday, July 11, 2009
02A - Anthony Adelmann

import maya.cmds as cmds
from math import*
from random import*
numRow = 20
numColumns = 13
numHeights = 12
points = []
for i in range(0, numRow, 1):
x = (i)
for j in range (0, numColumns, 1):
y = j
for k in range (-1, numHeights, 1):
z = sin (k*i*j)
myPoint = (x,y,z)
points.append(myPoint)
cmds.curve(d=3, p=points)
Saturday, May 23, 2009
Friday, April 24, 2009
Subscribe to:
Posts (Atom)