View difference between Paste ID: eZPRy2fi and
SHOW: | | - or go back to the newest paste.
1
# pass this method an object and some scaling factor
2
# this will iterate through all of the verticies and wiggle them slightly
3
# to wiggle in this context means translate in a random direction 
4
5
import maya.cmds as plg
6
import random 
7
8
def wiggler(whichOne, howMuch):
9
    scalingFactor = int(howMuch)
10
    for x in range(0,len(plg.getAttr(whichOne[0]+ '.vtx[*]',size=True))):
11
        whichVertToChange = str(whichOne[0]) + '.vtx[' + str(x) + ']'
12
        howFarX = random.random()/scalingFactor
13
        howFarY = random.random()/scalingFactor
14
        howFarZ = random.random()/scalingFactor
15
        plg.setAttr(whichVertToChange, howFarX, howFarY, howFarZ, type="double3")
16