cwisbg

makeHouse

Sep 26th, 2018
421
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.77 KB | None | 0 0
  1. from pymel.core import *
  2. import random as r
  3.  
  4.  
  5.  
  6. def makeHouse(HouseAmnt):
  7.     houseList = []
  8.     def makeBase(height, width, depth):
  9.         #base = polyCube(h=height, w=width, d=depth, sh=int(height*2), sw = int(width*2), sd = int(depth*2))[0]
  10.         base = polyCube(h=height, w=width, d=depth)[0]
  11.         move(base, 0,height/2,0)
  12.         move(base.scalePivot, 0,0,0)
  13.         move(base.rotatePivot, 0,0,0)
  14.         makeIdentity(base, t=1,r=1,s=1,a=1)
  15.         return base
  16.     for h in range(1,HouseAmnt+1):
  17.         rHeight = r.uniform(.2,2)
  18.         rWidth = r.uniform(.2,2)
  19.         rDepth = r.uniform(.5,1.5)
  20.         newHouse = makeBase(rHeight, rWidth, rDepth)
  21.         houseList.append(newHouse)
  22.     return houseList
  23.  
  24. HouseAmnt = 5
  25. houseList = makeHouse(HouseAmnt)
Advertisement
Add Comment
Please, Sign In to add comment