# Is there a way to convert a constraint to a keyframe?

I have a model in Blender with a full rig, including IK bones.
I also have a sword with two bones, on the top bone of the sword I have a set of constraints that copy the location and rotation of a child bone in the right hand.

The sword is then attached to the hand as expected. The second bone in the sword rig is the target for the left hand constraints that copy its location and rotation. In blender that works as expected.

I animate the primary rig right hand and the sword and the other hand moves as expected. The problem comes when I import the blender file into unity.

Unity is only seeing the right hand move but not the left. I can parent the sword to the right hand and it moves as expected. But the left hand data is not changing.

Back in blender I thought that if I were to select the left hand insert a keyframe (LocRotScale), when there was a keyframe for the right hand, that blender would then save the global position of the left hand, but when the new keyframe was inserted it had an orange line to the previous keyframe indicating that the position had not changed.

Is there away to get blender to save a keyframe for the left hand when the constraint moves it?

You could use Object > Animation > Bake action
(Or if you are in Pose mode, Pose > Animation > Bake action)

Bake action was added to the menu in Blender 2.62 (though it was previously available with Space> Search)
Unfortunately, there does not seem to be any documentation for this feature yet.

• I don't seem to have that option with a bone contraint. When I open the menu I only have the top three options of your sub-menu. Could the bake option be in a diffent spot for bones? – Goff Aug 25 '13 at 4:59
• Are you using the latest version of blender? – 00Ghz Aug 25 '13 at 8:52
• @user1874355 It seems to be there in 2.68a (r58536) It is there in pose mode and object mode. – gandalf3 Aug 25 '13 at 20:36
• I am using blender 2.60, I will upgrade and see if that makes a difference. I havn't upgraded in awhile because that version has done well for me. I will upgrade and post the results. – Goff Aug 26 '13 at 16:45
• ok, Object > Animation > Bake action does not do anything appearent for me but Pose > Animation > Bake action from in pose mode does. It creates a new action so it is not very conveinent but it does get the motion that the contraint produces. Thank you all. – Goff Aug 27 '13 at 1:25

Sounds like you want to apply the Visual Transform before keyframing:

Apply Visual Transform CtrlA

Apply (set) the result of a constraint and apply this back to the Object's location, rotation and scale. See the following post for more detailed discussion: Apply visual transform.

• I did try that, and it produced some odd errors. I set the influence of the two constraints to 1 set then crtl-a, set the influence to 0 and the hand is torn off the body and floating in space. was I missing something? do I need to delete the key frames of the hand then apply, then readd keyframes? – Goff Aug 24 '13 at 21:06
• This only applies to Modifiers that do not depend on any keyframes. Constraines like e.g. TrackTo don't work like that since the target object might be moving in an animation based on keyframes. – derHugo Jul 12 '19 at 11:27