Advertisement
jeffwincek

The Wiggler v1-0-1

Sep 30th, 2011
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.72 KB | None | 0 0
  1. import maya.cmds as plg
  2. import random
  3. #plg.polyCube( sx=5, sy=5, sz=5, n='plm' )
  4.  
  5.  
  6. def wiggler(whichOne, howMuch):
  7.     activeO = whichOne
  8.     scalingFactor = int(howMuch)
  9.     # iterate through all of the verticies and wiggle them
  10.     for x in range(0,len(plg.getAttr(activeO[0]+ '.vtx[*]',size=True))):
  11.         plm = str(activeO[0]) + '.vtx[' + str(x) + ']'
  12.         print 'changing ' + plm + ' now'
  13.         howFarX = random.random()/scalingFactor
  14.         howFarY = random.random()/scalingFactor
  15.         howFarZ = random.random()/scalingFactor
  16.         #plg.vtx[x].polyMoveVertex( setTranslateX=howFarX setTranslateY=howFarY  setTranslateZ=howFarZ )
  17.         plg.setAttr(plm,  howFarX, howFarY, howFarZ, type="double3")        
  18.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement