Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import maya.cmds as cmds
- import random
- store=cmds.ls(sl=True)
- def makeSceneClouds(cloudGeo, setGeoRange=100, rangeX=100, rangeY=50, rangeZ=100):
- topGroup = cmds.group(em=True, n=cloudGeo+"_Top_Cloud_Grp")
- for cld in xrange(setGeoRange):
- cloudCopy = cmds.duplicate(cloudGeo, rr=True, n=cloudGeo+"_%02d_cloud_Geo" % (cld+1))[0]
- randomX=random.randrange(-rangeX, rangeX)
- randomY=random.randrange(-rangeY, rangeY)
- randomZ=random.randrange(-rangeZ, rangeZ)
- randomScale = random.randrange(1, 5)
- cmds.setAttr(cloudCopy+".translate", randomX, randomY, randomZ)
- cmds.setAttr(cloudCopy+".scale", randomScale, randomScale, randomScale)
- cmds.parent(cloudCopy, topGroup)
- makeSceneClouds("pSphere1")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement