Maya Python Animation setKeyframe

In this example we’ll be looking at how to create keyframes with code. The script will animate a lot of small cubes placed on a sphere. We need 3 blinn shaders. First we create a sphere with default parameters.Then we create 250 small cubes. We use variable col1 for changing the cube color. pointPosition helps us getting the coordinates of the sphere vertices. We place the cubes on these positions and lastly we animate the cubes sizes, setting two keyframes.

Run the script and trigger playback.

Continue reading “Maya Python Animation setKeyframe”