Sunday, August 11, 2013

Joint Relocation

In this post I want to show you a quick and easy way of reposing your joint layout to make it easier for you to reuse a skeleton if you already have one laid out that you want to reuse. The idea here is to be able to just worry about where the joint is positioned, and not have to worry about maintaining joint orientation.

To accomplish this we will rely mainly on one thing, and that is an aim constraint, to allow us to aim the rotation axis we want down the joint chain.

Ok, so to break it down, lets just start with a 3 joint chain. To visualize this better lets go ahead and turn Local Rotation Axis on for all joints.


By default we have the x axis going down the joints. To keep our joint intact we will use locators to actually move around the joints to reposition them. The aim constraints will be applied to these locators.

So we need to start by breaking up the joint hierarchy. Parent each to world, you can do that by hitting Shift + P with the joint selected.

We will then create a locator at each joints position. In fact we want to maintaing the joints orientation as well. So for each joint, select the joint, select the locator, and goto Constraint -> Parent Constraint. We want to uncheck maintain offset. That will position and orient the locators to match the joints. We can then delete the constraint, and parent the joint under the locator.


Now we go ahead and set the aim constraints. This will mimic our original hierarchy and allow us to keep the joint orientation.

Select the second locator and shift select the first locator. And goto Constraint -> Aim Constraint.
We can repeat the steps for the third and second locators.
We can now relocate the joints. When we are ready we can unparent the joints (Shift + P) and parent the joints back into the hierarchy.


We can then delete the locators, and everything we be gone with them.


And there we go! Now, obviously it wouldn't be too efficient to have to redo this every single time. So if you want, check out lpJointRelocation.py

And here is a quick overview of how to use it.

Break Hierarchy: This will break down the hierarchy, create locators and constraints, and hook up message attributes to manage the connections with the tool. Select the first joint in the hierarchy you want to adjust.

Rebuild Hierarchy: To put the joints back into the hierarchy in the new position. This will also get rid of the created nodes that are no longer required. Select the first locator.

Select Hierarchy: To make it easier to select all the joint in the hierarchy starting from the selected joint.

Toggle Local Axis: To toggle on and off the local rotation axis to help with some visual feedback.

Hope you guys find it useful!

0 comments:

Post a Comment