Skip to content

Instantly share code, notes, and snippets.

@santosh
Created May 20, 2015 06:59
Show Gist options
  • Save santosh/ebeff0b4a995c9735815 to your computer and use it in GitHub Desktop.
Save santosh/ebeff0b4a995c9735815 to your computer and use it in GitHub Desktop.
Create multiple poly objects and translate it to random locations. #AutodeskMaya
import maya.cmds as mc
import random
for i in range(5):
x = random.uniform(-10.0, 10.0)
y = random.uniform(-10.0, 10.0)
z = random.uniform(-10.0, 10.0)
mycube = mc.polyCube(h=2, w=2, d=2, n="Object#")
mc.move(x, y, z, mycube)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment