Is there any way to enable the Child Of constraint without offset?

I think what you’re looking for are visual keyframes. Visual keyframes are a little bit like an “apply” button for constraints. (I wish there was just an apply button sometimes.)

Okay, so at frame 10, left hand “catches” magazine. At frame 20, magazine is in pistol and left hand leaves magazine. Left hand is child-of’d to magazine, has no other constraints. We want Left Hand to only have the child-of active during frames 10-20, but we want smooth animation, no quick jumps. How do we make this work?

At frame 10, pose your magazine and hand as you want them to look at the point that the hand catches the magazine, then keyframe a registration for bones, as well as a registration for child-of influence (at 1.0).

Now go back to frame 9. Register a visual keyframe for the left hand. Set the influence of the child-of to 0 and register that as well.

At frame 20, pose the magazine and hand appropriately. Register the bones/objects and the child-of influence (which is 1.0, because of the keyframe at frame 10.) Now go to frame 21. Again, register a visual keyframe for the hand, then set constraint influence to 0, then keyframe that influence.

Play it. Should be good. Pose at frames 1 & 30 and notice that magazine doesn’t affect the hand except during the period we want. Frames 9 and 21 should be eventually be tweaked for smooth, continuous motion.

Hi @bandages. First of all thank you for your answer
A little remark. Constraint is enabled from the beginning of the animation. Player holds a weapon with both hands. Then left hand leaves the grip and moves toward body to catch the falling magazine. Because at frame 10 constraint was enabled I wasn’t able to place magazine in the hand, hand moved along with the magazine. Because of that I had to adjust position and rotation of the left hand so it matched the magazine. Instead I wanted to temporary disable constraint at frame 10, so I was be able to place the magazine in the hand. I wasn’t able to disable the constraint because after placing magazine in the hand and re-enabling the constraint left hand jumped away from the magazine.

It’s the left hand that has a child of constraint. What is the target of that constraint? The gun or the magazine?

Yes, that’s why you register a keyframe before disabling the constraint. On 2 consecutive frames. Register before disabling the constraint. On the frame which it is disabled, register a visual instead of a regular keyframe.

If your problem is only for when you disable the child-of, just ignore what I said about frame 10 and do what I said about frame 20.

Here’s an illustration:
I have placed magazine in the hand with disabled constraint:

Now I want to enable constraint with having left hand at the same position. However if I enable the constraint the hand jumps away.
I’m unable to place magazine with constraint enabled because hand moves along with it:

Here’s the .blend file with magazine placed into hand. My question is how to enable the constraint having hand remained its rotation and position (without resorting to the Set Inverse). Can you please apply your answer.? Thanks.Question.blend (982.1 KB)

Why don’t you want to set inverse?

I have other actions with this constraint. If I re-Set Inverse, other animation(actions) will be messed up. I guess blender doesn’t provide a tool for this kind of situations. I’m wondering if it is possible to calculate offset with Python and then reallocate the object with the constraint according to the offset so it remains its position after enabling the constraint.

Well, it would be easier if you posed it the other way: position it with the constraint enabled, write a visual to the preceding frame.

But here, if you really love your pose, all you have to do is create a new child-of with a new inverse. You can use multiple child-of’s; each one maintains its own inverse matrix independently.

That’s exactly what I did already :slight_smile: Just positioning with constraint enabled was inconvenient because hand moved along with the magazine I was unable to move magazine toward hand. Instead I moved hand toward magazine which was very inconvenient. Thank you for your help anyway.

Would it help to have two different Child-Of constraints, enabled at different times?

I think I successfully did this once. :wink:

What I suggest you do, is to have the object use ‘Copy Transforms’ constraints… and have multiple empties set up based on what its constrained to… So you animate switching the copy transforms between two empties. Much cleaner than to set up multiple child of constraints as you can celarly differentiate whats what!

That’s what this button is for:

1 Like