How to Animate a Rolling Cube

You will use the properties of a primitive cube’s pivot point to animate it rolling on its edges. This process will involve the use of the Channel Control window to make certain attributes keyable. Once they are keyable, they will be available in the Channel Box for you to set keys and edit their value. In this lesson, you will also use the Graph Editor to refine the animation curves to get exactly the kind of motion that you need.

STEP ONE

Place a primitive poly cube into the scene and scale it to X=2, Y=2 and Z=2.
Select the Move tool and place the front of the cube at 0 along the Z axis (Z=-1).
Press the Insert key to go into edit mode and then move the pivot point to the middle of the cube’s front bottom edge.
You may want to use grid snapping to help you position the pivot.
Now press the Insert key to return to the Move tool then move the cube to the origin. (Y=1)

STEP TWO

Select Display -> Transform Display -> Local Rotation Axes and Rotate Pivots. These icons will help you visualize these components as you begin animating the pivot.

STEP THREE

Select Window -> General Editors -> Channel Control and select the following non-keyable attributes:

Rotate Pivot Translate X
Rotate Pivot Translate Y
Rotate Pivot X
Rotate Pivot Y

Use the Move button to make them keyable attributes. They will now appear in the Channel Box.

STEP FOUR

With the cube selected, set a key for Z rotation at frame 1.
Go to frame 10 then set Rotate Z to -90 and set another key.

STEP FIVE

Return to frame 1. Select the Rotate Pivot Translate X, Rotate Pivot Translate Y, Rotate Pivot X, and Rotate Pivot Y in the Channel Box then use your RMB to choose Key Selected.

STEP SIX

Go to frame 10.
Open the Attribute editor and select the pCube tab.
Expand the Pivots section.
Expand World Space section.
Set World Rotate X Pivot to 2. You should notice that the pivot moves to the front of the cube. Now you can continue rotating the cube.

In the Channel Box, set a key for the Rotate Pivot Translate X, Rotate Pivot Translate Y, Rotate Pivot X, and Rotate Pivot Y channels.

Editing the World Rotate Pivot in the Attribute Editor affects these four attributes therefore they must all be keyed.

STEP SEVEN

Go to frame 20.

Set another linear key frame for a Rotate Z to -180. Set the World Rotate Pivot to 4 then set keys for the four pivot channels in the Attribute editor.

If desired, keep rotating the cube and moving the pivot using the steps outlined above. If you playback the animation at this point, the roll of the cube will not seem correct. You need to change the animation curve tangents for the pivot attributes.

STEP EIGHT

The incorrect motion is because the pivot point needs to stay in one location for 10 frames then jump to its new location.

    Open the Graph Editor.
    Select the four pivot action curves
    Select Tangents -> Stepped.

This will create the desired results.

Source Link πŸ™‚

Understanding Animatable Pivot

Really useful and informative post by Maulik about understanding and creating an animated pivot system. He guides you through the logic and maths behind creating this system.

Basically if you ever tried creating an animated pivot control, you will notice that once the object has been rotated and it’s rotatePivot point has been shifted and repositioned; once the  object get translated we see some weird transformation. These unwanted transformation can be fixed by calculating the offset values in the rotatePivotTranslate matrix.

To give you a better idea on this please take a look at this little tutorial post πŸ™‚

Also, Maulik has been working on this offset solution to create a real time animated pivot which you can find in his blog. Below is the link … and a big thanks to Maulik πŸ™‚


Making Animatable Pivot

Animated Pivot in Maya

In this tutorial, I am going to show you two different methods to create a pivot control for animation. One more thing, Happy April FoOl’s Day πŸ˜€

1st Method
  • Create a locator and name it pivot. Create a polygon cube and name it object. Select the object and group it to itself and rename the group as negOffset. Make negOffset a child of pivot.

  •  Now create a multiply divide node from the hypershade or just entering β€œcreateNode multiplyDivide in the mel script editor. Open the connection editor and load pivot in the Outputs  and multiply divide node in the Inputs. Connect translate of pivot to input1 of multiplydivide node. Make sure that the input2 of the node is all set to -1.

  • Again, load the multiply divide node in Outputs and negOffset in the Inputs. Connect the output of multiply divide node to translate of negOffset.
  • It’s done. Just select the pivot and move it to the desired position and rotate it. You can see that the object rotate from that pivot point.
2nd Method
  • Create a locator and name it pivot. Create a polygon cube and name it object. Select the object and group it to itself and rename the group as offset. 

  •  Open up the connection editor and load pivot in Outputs and offset in Inputs. Connect translate of pivot to rotatePivot of offset. Again connect rotate of pivot to rotate of offset.

  • That’s it. Now just select the pivot and move it wherever you want and rotate it. The object rotates from that pivot point.


Conclusion : Both of these methods shows a technique to create a pivot control which can be animated. Note that once you have rotated and translate the pivot controller, there is some weird transformation (you can zero out the rotate in this case and reposition as you need πŸ˜‰ but this is totally natural which can only be avoided by creating a little script to reposition the offset. But I don’t think it is necessary because I am pretty sure the animator will use the pivot controller based on the shot necessity and can easily manipulate it. Hope you enjoyed my little tutorial πŸ™‚

Also, if you wish to know what I meant about the weird transformation stuff, it is basically something that is taken care of by putting some offset values in the rotatePivotTranslate attribute. You might want to take a look at the tutorial post below to get a good understanding about it!

How to Animate a Rolling Cube …

H E P H A E S T U S

Got an opportunity to assist and help the team working on an animated short! Did some rigging on the female character Kaylee. It’s fun to be actually a part of the sensational team working on this film. I am really looking forward to watching it and wishing the team best wishes πŸ™‚

“Hephaestus, is an animated short film directed by Alexander Curtis and produced by Paige Day.  The film tells the story of Hephaestus, an outdated, aging soldier who has found a new purpose in the care and protection of a young girl, Kaylee.  Hephaestus is currently in production at the Savannah College of Art and will be completed in May 2011.”

Salmon Lip Sync


hehehe … i am loving it! The animator spelled my last name wrong … Anyways, happy to see Sinka coming alive πŸ˜€

Bird Wing Setup


Here is a little video demonstration showcasing the process and the technique that I followed to rig a bird’s wing! Enjoy πŸ™‚