May 8, 2009

Capturing Body Animation with One camera (AND CHEAP!)

Through this process, you are able to capture the timing, poses, weight, etc of a character with a cheap, homemade MOCAP suit and a digital camera. You will need some tight fitting clothing (to make the suit), paper, marker, cardboard (optional), a digital camera that has a “video” mode, and an animation package (I will be explaining this with maya’s terms but the process should be able to cross software boundaries).

You first need a MOCAP suit. Mine was modeled after the imocap suits used in pirates of the carabean and iron man. For reference, you can look below at what I was wearing. The tight fitting clothes are so the tracked points that you put on the suit will not drift around (they will move with you exactly). To get a nice tracked point on a suit, you will want to put a dot (slightly smaller than a quarter) on a small piece of white paper and staple this to your clothing. I am sure there are better ways of attaching these, but this method is cheap, fast, and easy. You want the dots where your joints would be rotating. I did a test of one arm moving so I had a hip control, chest, shoulder, elbow, wrist, and gun point track. The cardboard is for creating loops of track points (say for around your chest or arm) so you can almost guarantee a good track point. When creating this, alternate from white background with black dot and black background with white dot so the tracker doesn’t get confused on which dot it is supposed to be tracking.

After you have the suit, you will need to take the movie of your actions (act out what you want to be captured). The whole idea of this process is that acting is the easy part and it comes natural and that should be where the speed up happens. We are acting with our bodies and not a mouse and keyframes. So, put your camera on a tripod or steady surface and make sure it doesn’t move while filming. You will also want to have a nicely lit room. You might see in my example that I am in a dorm room with a couple lamps pointed directly at me to light up the tracks (once again to make the computer’s job easier). With your suit on, press record and start acting. Right before you start acting, you might want to have a stretch position where your arms, legs and torso is fully extended. This will be used later in jointing. I have found that a digital camera works great. Of course an HD cam would provide a faster frame rate and an overall higher resolution.

Once you have your movie and are ready to take it into maya, convert it to a image sequence so maya can process it correctly in its different stages (you can’t have an image plane with a movie file and maya live won’t track movies either, only image sequences). You first want to start up maya live by creating a new track-solve. You can import your image sequence and start tracking. There are tutorials of how to track things with maya live on the web so I won’t go to in depth here. The basic idea is make a track point, move it to where the mocap point is, press “track” and whenever it fails, keyframe it’s location through the trouble spots of video. If the track is lost for a long time, you can keyframe it through it’s entire animation or find another track point to help. For example, I had 2 track points on my gun. One was on the top, one was on the front. When my gun is down, I can track the top point but as soon as the gun faces the camera, I am able to move the track down to the “front” track point and automatically track that through the duration of its visibility. Once you have tracked all of your points, you are left with locators. Heres the funny thing… the locators x and y translate attribute never change. In maya, you have to connect into the locators “location” attribute.

To be able to work with the tracked points, make a sphere (or some geometry that you can connect up to the locators). You can write an expression or use the relationship editor, but you should have the spheres X and Y translate = tracked locator’s X and Y location. Press play. You should see that sphere dancing around the origin but not up where your track is. You will have to place the sphere under the tracked locators group in the outliner to achieve the same scaling that is happening with the translations. With that done, you should see the sphere have the same x and y location as the locator. You should repeat this process for all of your tracked points.

What you should have now are some moving spheres in x and y space. Find that frame where you had your stretch pose. Here you will want to start placing joints (and they should correspond to the tracked spheres, so you can snap them). With your body still in the stretch pose, you now add an IK handle to each joint. For example, you want one from the hip to chest, chest to shoulder, shoulder to elbow, etc until every joint has an IK associated with it. You will then (still on the stretch frame) point constrain the IK handles to the tracked spheres. You will get a crazy animation here. The IKs are trying to reach the balls, so they rotate the joints in funny ways to get there. The only keyframing that you have to do in the whole process comes next.

Start with the root and work your way down the chain of joints. You will be keyframing the z location of the IK handles. You want to move the IK handles until the joint (which has a fixed length, found with the stretch pose) can actually reach its IK goal. For each IK on every frame, there are 2 Z solutions. The bone can bend forward to reach up towards the proper X Y position or backwards. As an animator, you will be able to tell that your elbow bends toward the camera and not backward. Go through each IK handle and keyframe the correct Z position so the IK and bone ends match up. Then press play. What you should end up with here is a bone structure that moves along with your motions. The timing should be correct, the poses should be correct but how can I use this?

If you have a set of bones that follow your body through 3D space, you can make other bones move like them. Say woody has a very narrow chest and long arms (which he does) and you wanted your bones to move him. You want your bone’s rotation to control his bones rotation. In maya that is called an orient constrain. One bone will orient itself to the other bones. No matter the length difference, the angles of the bones should be correct. This can also be achieved with an expression, simply having the rotations of woody bones = my rotations of tracked bones.

There will be weight painting issues which you can not dodge with this process but I still find that it is a faster way of getting baseline animation with correct timing and poses. The idea here is that you can work more on this animation. Bake it down so it has no connections and you can clean it up even more by hand.


I hope this made sense and that it helps someone who wants to animate faster. If I didn’t make anything clear, feel free to contact me and I would love to help update the blog and help through specific questions with this process. My e-mail is imk07@hampshire.edu.

1 comment:

  1. This article is really cool but i would like to see some pictures or a video tutorial ar something if you would like.It will be perfect.
    If you have much more description and iformations about that i will be gratful.
    Thanks a lot
    my mail:rigorony@hotmail.com

    ReplyDelete