0
ランダムな幅のタイルの行を作成したいと思います。私は2つのキューブのためにそれを行うことができますが、私は100キューブのためにそれを行う方法を知らない。pythonでランダムな幅のキューブを作成する方法
import maya.cmds as cmds
import random
cubeList = cmds.ls('Tiles*')
if len(cubeList) > 0:
cmds.delete(cubeList)
#create row and col list
cols = 2
arr = []
for col in xrange (cols):
width_rand_Size = random.uniform(0.8,3)
arr.append(cmds.polyCube (ax = (0,0,1), w = width_rand_Size, h = 1, d =1 , n='Tiles#'))
if col != 0:
cmds.setAttr("Tiles2.tx",(cmds.polyCube('Tiles1', q = 1, w = 1))/2 + (cmds.polyCube('Tiles2', q = 1, w = 1))/2)
は助けてありがとう:) – push