Skip to content

Instantly share code, notes, and snippets.

@gregtemp
Last active August 29, 2015 14:02
Show Gist options
  • Save gregtemp/92a962f3f849db1605e5 to your computer and use it in GitHub Desktop.
Save gregtemp/92a962f3f849db1605e5 to your computer and use it in GitHub Desktop.
Getting started in python in maya
import maya.cmds as cmds
cubeList = cmds.ls( 'myCube*' )
if len(cubeList) > 1:
cmds.delete(cubeList)
result = cmds.polyCube (w=1, h=1, d=1, name='myCube#')
#print ('result:' + str(result))
transformName = result[0]
for i in range( 0, 50):
instanceResult = cmds.instance( transformName, name = transformName + '_instance#')
#print( 'instanceResult:' + str(instanceResult))
cmds.move( 0, i, 0, instanceResult)
#https://www.youtube.com/watch?v=eXFGeZZbMzQ
#https://www.youtube.com/watch?v=i8NDq1ciuGE
#maya mel - http://www.polyextrude.com/tutorials/MelScripting/chapter3/array.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment