cwisbg

random cuber- pymel

Jan 4th, 2012
310
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.12 KB | None | 0 0
  1. from pymel.core import *
  2. import random as r
  3.  
  4. print rando
  5. x = 0
  6. ping = []
  7. for i in range(-20,21): #Range for Ping
  8.     ping.append(i)
  9. ra = 101   #Range  
  10. xx = 0
  11. baseParent = [polyCube(n='baseParent',h=.5,d=.5,w=.5)[0]]
  12. rotate(baseParent, 5,3,19)
  13. for i in range(0,ra):
  14.     if i == 0:
  15.         x /= 2
  16.     if x == len(ping):
  17.         ping.reverse()
  18.         x = 0
  19.        
  20.     rando = r.randint(0,len(ping)-1)
  21.     rando2 = r.randint(0,len(ping)-1)
  22.     rando3 = r.randint(0,1)
  23.     cuby = [polyCube(n='pCube_{0}'.format(i))][0][0]
  24.     yy = [rando, rando2]
  25.     zz = [rando2, rando]
  26. #    rotate(cuby,0,45,0,os=1)
  27.     move(cuby.sp,0,0,-.5,r=1) # move scale pivot
  28.     move(cuby.rp,0,0,-.5,r=1) # move rotate pivot
  29.     move(cuby, yy[rando3], zz[rando3], i, ls=1) # move cube
  30.     scale(cuby, 1,1,1,
  31.     print ping[rando]
  32.     #parent the cubes to each other in a line
  33.  
  34.     parent(cuby, baseParent[i])
  35.     baseParent.append(cuby)
  36.    
  37.     x += 1
  38.     xx += 1
  39.  #   print i
  40. print '_________________________________'    
  41.    
  42. x = ra
  43. for i in range(0,ra):
  44.  
  45.     sl = select(baseParent[x],add =1 )
  46.    
  47.     print x
  48.     x -= 1
Advertisement
Add Comment
Please, Sign In to add comment