View Full Version : How to do Constraints?

02 February 2006, 07:53 PM
This is a hopelessly basic question, but i've not really figured it out yet.

im trying to get a character to hold a gun, and i know about half of what i need to do, but the other half eludes me.

i've been trying to figure it out on my own, or find tutorials for it, but no luck thus far, any help would be appreciated.

02 February 2006, 11:05 PM
What exactly are you having trouble with?

I'm no expert, but I've recently animated some characters picking up and putting down objects using parent constraints. I constrain the object the character's hand and then switch it off when the hand releases it. I keyframe the rest position so that the object ends up in the right place when the character lets go of it.

02 February 2006, 10:48 PM
basically you need to have two (at least) controllers. The you can point and orient constrain the object to both controllers. After that, use set driven keys on an attribute (that you make) to drive the weight value each controller has on the object. Due this with orient constraints as well, and you can move the object between two controllers. (ie carry and set down an object).

02 February 2006, 07:11 AM
I've been working on a prop tool for our animators here so that they can have a prop attach to multiple attach points on a character. So I could help a bit.

You need at least three nodes (transforms) if you are using a gun. One will be a global transform. This could be an empty group that is outside the characters control hierachy( i call it globalWorld).

You'll need a node that will keep the gun in the holster(this could be a joint).

Then another node for the hand.

So you could select all three nodes then the gun controllers group (you'll need a group node above a gun control) and do a parentConstraint.

In your gun control and an Enum attribute called parent and have a globalWorld, holster and lets say hand for the attribute.

Select the parentconstraint and hit set driven key. This will be the driven. The driver will be the parent attribute from the gun control. At this point you'll need to create set driven keys that is driven by the parent attribute and the parentConstraint.

Now the gun control will pop to those new locations. Just before you make the switch, you could query the world space of the control, make the switch and then apply those values back in and it will return to its original spot.

That's kind of the jist of it. Hope that's some help.

Hey Patrick, your name sounds familiar. Did you go to AI of Portland?


CGTalk Moderation
02 February 2006, 07:11 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.