Advertisement
Guest User

Untitled

a guest
Mar 24th, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.74 KB | None | 0 0
  1. import maya.cmds as cmds
  2. import random
  3.  
  4. store=cmds.ls(sl=True)
  5.  
  6.  
  7. def makeSceneClouds(cloudGeo, setGeoRange=100, rangeX=100, rangeY=50, rangeZ=100):
  8.    
  9.     topGroup = cmds.group(em=True, n=cloudGeo+"_Top_Cloud_Grp")
  10.    
  11.     for cld in xrange(setGeoRange):
  12.         cloudCopy = cmds.duplicate(cloudGeo, rr=True, n=cloudGeo+"_%02d_cloud_Geo" % (cld+1))[0]
  13.        
  14.         randomX=random.randrange(-rangeX, rangeX)
  15.         randomY=random.randrange(-rangeY, rangeY)
  16.         randomZ=random.randrange(-rangeZ, rangeZ)
  17.         randomScale = random.randrange(1, 5)
  18.        
  19.         cmds.setAttr(cloudCopy+".translate", randomX, randomY, randomZ)
  20.         cmds.setAttr(cloudCopy+".scale", randomScale, randomScale, randomScale)
  21.        
  22.         cmds.parent(cloudCopy, topGroup)
  23.  
  24.  
  25. makeSceneClouds("pSphere1")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement