SHARE
TWEET

The Wiggler v1-0-1

jeffwincek Sep 30th, 2011 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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.  
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top