how to code cubes that move in increments
jaden programming » Devlog
import maya.cmds
Animation_Range = 10
def Create_Cube(increment):
Cube = cmds.polyCube()
cmds.move(increment, x = True)
for x in range(1,101,10):
Create_Cube(x)
cube = cmds.polyCube()
for i in range(Animation_Range):
cmds.currentTime( (i+1)*10, edit=True )
cmds.setKeyframe(cube,v=i, at="translateX")
this code spawns in cubes from 1-101 in increments of 10 along the x axis it also animates one of the cubes. it also shows you how to spawn in multiple cubes.
jaden programming
More posts
- adding delete button to windowNov 28, 2022
- how to add a intslider to buttonNov 21, 2022
- create pyramid using a loop and then adding buttonNov 14, 2022
- simple commandsNov 14, 2022
- Creating a pyramidNov 14, 2022
- QuizNov 14, 2022
- how to add a function to a button in a windowOct 17, 2022
- 10/10/2022Oct 17, 2022
Leave a comment
Log in with itch.io to leave a comment.