cwisbg

PieceGen

May 29th, 2019
448
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. from pymel.core import *
  2. import time
  3. import random as r
  4. import math
  5. start = time.clock()
  6. def grpr(name):
  7. g = ls(name)
  8. if g:
  9. delete(g)
  10. g = group(n=name,em=1)
  11. return g
  12. def MakePieces():
  13. pieceList = []
  14. PieceGrp = grpr("PiecesGrp")
  15. Floor = polyPlane(n="Floor",sw=1,sh=1)
  16. parent(Floor,PieceGrp)
  17. pieceList.append(Floor)
  18.  
  19. return pieceList
  20.  
  21.  
  22. class BuildingPiece:
  23. def __init__(self):
  24. self.obj = []
  25. self.validId = [0,0,0,0,0] # Side identifyers
  26. self.validOk = [] # valid sides to match
  27. self.pieceId = 0 # object index in group
  28.  
  29. pieceList = MakePieces()
  30.  
  31. select(cl=1)
  32. elapsed = (time.clock() - start)
  33. print elapsed
Advertisement
Add Comment
Please, Sign In to add comment