Attaching / detaching objects

Hi!

Imagine a hand opening the lid of a box, the fingers grip the lid in a certain spot and lift the lid, what is the best way to animate that, so I have either the lid following the fingers or the fingers attached to the spot on the lid. If I animate both there will obviously be sliding. Any thoughts?

Thanks!

Edit: To be clear, my concrete case is a character (just a hand) flicking a switch, a lever, like a light-switch.

Hi,

you’d want to parent constrain the hand (or finger) to the lid, and animate the lid’s rotation. When the hand leaves the lid, keyframe constraint influence to 1, go ahead one frame, keyframe visual locrot of the hand and then (in that order) keyframe the constraint influence to zero. You can then keep on animating the hand.

Hadrien

Thanks for the answer! What is the difference between LocRot and VisualLocRot, if I may ask?

Ok so I haven’t tried it yet but a quick thought: The lid is like a lever, so the origin (point it rotates around) is not where the hand touches. So I if I constrain to that it wouldn’t work, I would need an “attachment point” at the edge of the lid where I can constrain the finger?

Visual keying takes into account transforms made by constraints as well. Notice when bone A constrains bone B and bone A moves around, bone B’s transforms do not change. Well visual keying takes these “invisible” values into account. It’s called visual because the object is keyed where is actually is in the 3D space, rather than what its transform values indicate.

For your question, yes it will work. As long as the hand is placed correctly before the constraint is applied (and “offset” is checked), it will follow the lever around. Make sure it’s a parent constraint, too. Won’t work with only a copyrot.

Note that you’ll have to do the same when the hand reaches the switch (key constraint influence at 0, key hand’s visual locrot, move ahead 1 frame, key constraint at 1).

Empty objects are your friend in this regard. (Their usefulness is perhaps a bit understated.) The empty will be a child of the lid. The hand would then move to the location of the empty with the influence of a copy location constraint.

Hi all, thanks for taking the time. The straight forward attach-detach I’ve got figured out now, but I am still looking for the optimal solution for the lid-type setup. Here is a small example of what I got going now but I don’t like the “plain axes” type empty floating all over the place. But it works.

Edit: And thanks for the solution to the attachment-point problem pauljs75_!

You can simply use a bone rather than an empty. Pauljs’s solution is good in that it allows the hand not to rotate along with the lid.

Yeah, that’s exactly what I needed, because the lid is rather large and it wouldn’t look natural for the hand to twist too much. But it’s good to know both methods. Constraining and parenting can get a bit tricky but it makes animation much simpler and cleaner.