Thursday 28 May 2009

Boris - Constraints Tutorial

Hello,

Here is young boris being a bit wooden demonstrating the use of constraints so he can bounce a ball, ride a unicycle and open a door.

Untitled from Andrew Henson on Vimeo.

2 comments:

  1. Hey Andrew,

    Lots of use of constraints at different times. If you can explain a bit, the way you constraint and then keyed it for moving the object independently also, that would be really helpful !

    Thanks!

    ReplyDelete
  2. Hello,

    I just checked out your profile, really cool that your an Animation Mentor student. I am saving up so I can do it as well. In the meantime I am working through online courses from Escape Studios and the Character Animation tutorials from Jason Ryan Animation. When you sign up for his classes you can get a free tutorial on using constraints by Jason’s friend Lee Gramling who works as a character rigger at Dreamworks with Jason.

    There are three MEL scripts that are provided with the tutorial, one that attaches objects together and another that will switch the attachment and a third that sets up an object to be a controller.

    I will go over what was used in each shot, bear in mind the examples were the actual tutorials, none of this is my own work I have just followed along and this is the output of the tutorial.

    1. Bouncing Ball. Created a sphere and a nurbs circle on the floor. Select the Hand, Circle and Sphere and clicked the MakeAttach button. That creates an Attach attribute and parent constraint to the sphere, hand and circle. I key the attachment to the hand, then move the hand with the ball attached. When I move my hand down I place a key with the ball attached to the hand, then on the next frame I click the switch attach button (MEL Script) and then the ball is now attached to the circle, so I can key the ball hitting the floor and do some overlapping action on the hand.

    2. The Uni-Cycle.

    To get the pedals to turn around a bone is created from the middle of the wheel to each pedal, then the pedal geometry is point constrained to the end of each bone. The rotational axis for the middle spindle joint is altered. Finally a circle is created and rotated around so the wheel is inside the circle. The circle and spindle joint are selected and the Controller script is run. Now when the circle is rotated it rotates the spindle joint which in turn rotates the pedals because they are point constrained to each end bone.
    Next the right foot of Boris is parented to the pedal, the left foot is selected along with a circle on the ground and the pedal and the make attach script is run. This allows me to switch between parenting the foot to the pedal or the circle on the ground so I can have Boris cycling then he can take his foot off and place it on the ground.

    3. Opening the door.

    After modelling the door frame, door and the handle I created a linear nurbs circle with 4 sides to great a box shape to act as a controller for the door. We created a bone from the edge of the door frame to the handle, then placed an IK handle on the bone from the door frame to the handle to allow us to translate in the Z to open the door. Using the nurbs circle and IK handle create a controller. Create a circle on the floor, select the hand, circle on floor and the handle controller and run the make attach script and set a key. Move the hand that in turn will open the door, then set a key with the door constrained to the hand, at the next frame switch the door handle from the hand to circle on the floor and set a key, now translate the handle away so the door appears to close with some overlapping action on the door slowing to a complete close, and some overlapping action on the hand and antenna I added myself.

    The technique to get across was setting a key frame for the current attach, do your move then set another key for the current attach. Move on one frame and switch the attach and set a key, and then move the object and so on.

    The script takes care of any offsetting, we were not told how to handle this manually.


    Hope that helps and good luck with your studies at Animation Mentor

    ReplyDelete