Get the basic setup file here

In real life, you don't have to worry about fingers passing through objects in order to pick them up. The density of your hand is sufficiently large enough to cause friction when you hand collides with other pieces of solid matter, thereby allowing you to grab hold of something and not letting it slip through the proverbial fingers. But with CGI characters, they could walk through Fort Knox without tripping over all the pesky guards that would usually get in the way of you or me. But unlike you or me, they would have a problem when they tried to grab the gold, for their grubby little mitts wouldn't be able to hold a tea cup without an animator's assistance, let alone a solid gold brick. So, as an animator, how are you going to have your character grab that bar so you can pay off your loan shark?

There are many ways to engineer a character in 3D to pick up an object. Whether it is a woman reaching for a glass of water, an alien vehicle grabbing helpless victims from the ground, or Yoda using the force to snap his lightsaber into his hands, they all follow the same basic principle: Object A must move from Location A to Location B. This isn't a ground breaking revelation, but just simple assumption that usually goes unnoticed. So the real question becomes: what is the best way to move the object from one location to the other?

If the character only needs to grab the object, and then the camera cuts to another shot, it may not be necessary to actually show the transition from "Object at rest" to "Object in hand". In other words, the hand could be shown to just about be about to grab the object, then the next shot already has the object in hand, thus using film tricks to get around actually showing the ":pick-up" part of the action. This is useful if you don't have time to animate the fingers or you are just plain lazy, but you never know, sometimes it may be the preferable option.

But you say that the shot calls for a continuous actions without camera cuts. Ah, now it gets a tad more interesting. Two options become available, both with their advantages and drawbacks.

First is the "Dual Object" method. This method calls for you to have two of the object that is to be grabbed, one of them at its default position, the other parented to the hand that will pick it up, in the position of being held. This sequence plays out like so: The visibility of the second object (the one parented to the hand) is turned off while the other one (the one on the table for example) stays turned on. The character reaches for the object, wraps their fingers around it as to grab it, and when contact is made, the visibilities of the two objects are switched. The one in the hand is turned on and the one on the table is turned off. Drawbacks of this method are that in order for the illusion to work, the hand must position itself exactly over the object to be grabbed, so the two object appear to be one, (if both visibilities were turned on.) If this isn't done, when the visibilities are switched, the object will appear to "jump" in what could be a noticeable unnatural way.

The Second method is carefully animating the object to the character's hand. Using this method, you won't have to worry about having the object jump about, unless you animate it that way, but there will be no "automatic" movement as well. You would have to carefully line up the motion of the hand and the rotation of the object to achieve a natural feel to the weight of the object. This could be quite tedious and cumbersome for longer shots.

An ideal solution would be a marriage of the two systems: a method where the object automatically follows the motion of the hand, (when necessary) plus the ability to be animate separately (when necessary). So without any further exposition, here is Jonathan R. Nelson's guide to easy object pickup!

To begin with, it would help to have both a character and a prop to grab. Our friend IK Joe, courtesy of www.rigging101.com, will help us later with today's demonstration. I have created a basic setup file (pictured below) that can be easily imported into any Maya scene to create the basic grasp initial state. In this file are four locators, three of them are part of the setup, the fourth is a help file, (by checking the attribute editor for any of the locators, instructions are in the note section for quick help.)

basic locator setup

This is the basic setup. Here it is again with a simple cylinder standing in for the object that is to be grabbed:

There are a few things to note about the above image. The first is that the locator on the left (highlighted green and called 'parent_to_hand' in the channel box) is rotated along the Z-Axis -90 degrees. The locator on the right (Object at rest) is not rotated at all. On the 'parent_to_hand' locator is the Grasp Channel, as shown on the right, and its default setting is at '5', from 0 to 10. Therefore, the middle locator, (Object to grab) is receiving 50% of it's location data from the two other locators, shown by having the green cylinder at a 45 degree angle, halfway between the two other locators. The 'Object to grab' locator interperates both the rotational and translation values from the two locators to determine its place and position in the world space.

Here the Grasp value is at 1.2, so the locator is almost entirely at the 'Object at rest' pose, almost perfectly straight up and down and just receiving a minumal of influence from the 'Character's Hand' locator.

Here's the opposite, with the Grasp value at 8.1.

This clip shows the Grasp tool in action. IKJoe catches a cylinder, rotates his wrist, then drops the cylinder. The cylinder has not been animated directly in any way and has zero keyframes upon it.

 

Here's how to do it yourself step-by-step:

We start with the three locators as seen below, named from left to right: "parent_to_hand" "parent_to_object" "free_placement"

In this example, I am placing the channel that will control the grasping action on the "parent_to_hand" locator, but you could put it anywhere you want really.

Select the locator

and proceed to add a new attribute by Modify --> Add Attribute

Change the settings to those shown below. This channel will basically be a 0%-100% input.

The object being held will receive its position and rotational infomation from the two other locators by way of constraints. Select "parent_to_hand" "free_placement" "parent_to_object" in that order, then under the Animation toolset menu, select Constrain --> Point.

Repeat choosing Orient the second time.

This will place both point and orient constraints on the object to grab. Since both objects are exerting full influence on the object to grab, the result is that the object blends both inputs together resulting in a 50% appearance. We'll use Set Driven Keys to blend between the two.

Select the "parent_to_hand" locator (or whatever object has the Grasp channel) and under the animation toolset menu select Animate --> Set Driven Key --> Set...

The initial screen will be blank so let's fill it up. With the "parent_to_hand" locator still selected, click "Load Driver"

This puts the locator as the driver in the upper left section. Select the Grasp channel in the upper right to select the actual channel that will be doing the driving.

The driver is going to control the amount of influence the constraints are going to exert. To easily select the constraints, load up the outliner by Window --> Outliner

Expand the "parent_to_object" locator to reveal the constraints. Select them both.

Back in the set driven keys window, click Load Driven.

You should now have the "parent_to_hand" locator selected as the Driver and the point and orient constraints selected as the Driven.

 

You need to decide the value structure for the Grasp channel. In this example, when Grasp = 0, the object is not being held, so the constraints coming from the "parent_to_hand" will have no effect. Double check that the Grasp channel is 0.

Select the "parent_to_object_pointConstraint1" , then select the two bottom channels, "parent_to_handW0" and "free_placementW1" in the lower right section.

Click on the name "parent_to_object_pointConstraint1" in the lower left section to activate that object. In the channel editor on the right, change the values of "Parent_to_hand W0" to 0 and "Free_placement W1" to 1.

Back in Set Driven Keys, click Key

Repeat this for the "parent_to_object_orientConstraint1"

Both constraints should have keyed channels, as seen below.

After these steps, the Object to Grab locator looks like it has disappeared. It hasn't obviously, it is just occupying the same space as the Free Placement locator.

The Grasp channel isn't really doing anything yet, since we need to define what happens at the other extreme value. Set Grasp = 10

Select the "parent_to_object_pointConstraint1" , then select the two bottom channels, "parent_to_handW0" and "free_placementW1" in the lower right section. In the channel editor on the right, change the values of "Parent_to_hand W0" to 1 and "Free_placement W1" to 0.

Back in Set Driven Keys, click Key, then repeat this for the "parent_to_object_orientConstraint1"

 

When this is complete, test out the Grasp channel. If everything is in place, as the value of Grasp increases from 0 to 10, the Object to Grab locator should float accross the scene from one locator to the other, taking the orientation as it goes, as seen below.

 

So to recap:

The 'Object to grab' locator has two sets of constraints applied to it. The first set is an orient and point constraint to the 'Character's Hand' locator. The second set is the same, but to the 'Object at rest' locator. The 'Grasp' channel is controled by set driven keys to the weight each set of constraints has over the 'Object to grab' locator. In other words, when the value of Grasp is 0, the weight of the constraints from the 'Character's Hand' is turned off, so the weight of the constraints from 'Object at rest' is at 100%, therefore the 'Object to grab' is at the exact same location as the 'Object at rest' locator with the same orientation. The object itself is still able to be animated, so you could still move and twist the object about, while the object remains in the characters hand automatically. Great for twirling cups on the finger or juggling flaming chainsaws.

Get the Basic Setup File with the three locators ready to be imported here: Maya 6


©2004, 2007 Jonathan R. Nelson / www.jonathanrnelson.com