0
$\begingroup$

I'm trying to replicate the transformation animation of an object with a bone in pose mode.

The way I approached this was to copy the keyframes of the selected object, go into pose mode, add a keyframe for the bone for location, rotation, and scale, and then paste the keyframes into the bone.

When I use this method to transfer animation data between objects in object mode, it works just fine. However, pasting it into pose mode is a bit trickier as the animation gets distorted for some reason.

Trying to figure out where I screwed up. Any help would be much appreciated.

enter image description here

$\endgroup$

1 Answer 1

0
$\begingroup$

If the object and the bone have the same inherited transform (from a parent) and the same inverse and the same rotation mode, copy/pasting works. The problem is that they are unlikely to share all of those things. Transforms are measured in local space, not global space, so moving one thing in the X axis is not necessarily the same as moving another thing in the X axis-- those X axes are determined by the individual thing moving.

If you want a bone to move with an object in world space, and want to keyframe that behavior, I would reccommend using a combination of constraints and visual keying.

Start by giving the bone a "copy transforms" constraint targeting the object. Defaults on this constraint are appropriate.

enter image description here

You can add a constraint very quickly with the help of keyboard shortcuts like ctrl-alt-c, which adds a selected constraint to the actively selected object, targeting the inactive selection.

If we just leave this constraint, the bone will now follow all the transforms of the cube, but in world space. That may be good enough for what you want.

However, you may want to keyframe this behavior for further editing. Go to the frames you want to keyframe this and keyframe a visual transform:

enter image description here

Keyframing a visual transform writes the action of any constraints into the actual transform of the bone. Now that we have visual keys defined, we can delete the constraint.

You may want to keyframe this behavior many, many times. If you had a 3000 frame animation, and wanted to write your constraints to keyframed transforms for every frame (perhaps, for use in a different rendering engine), visually keyframing would be inconvenient. Instead, you can use a "bake action" operation:

enter image description here

I've enabled "visual keying" and "clear constraints" on this bake action operation; I'm using the default frame step and range. It has created a visual keyframe for every frame, and then cleared the bone constraint, just as expected. If I wanted fewer keyframes, I could use a larger "frame step" value.

It would be possible to set up a bone such that copy/pasting keyframes gave the same (world space) transform as the object. You would want identical rotation modes (XYZ Euler, for example.) You would also need these to have identical inherited transforms, but that's easy if the object is unparented. And you would want identical rest postion and axes-- that is, the object, when its transform was at 0,0,0, was at the same location as the bone; with no rotation, their axes point the same direction. A default bone's axes do not point in the same direction as a default object's axes.

$\endgroup$
4
  • $\begingroup$ Thanks! That was a huge help. One minor thing- adding the constraint does change the orientation of the bone to match the object, but the base of the bone is relocated to the origin of the object. I was wondering if there's a way to snap the ends of the bone around for a neater fit while the constraint is on without messing up the animation. $\endgroup$ Commented May 13, 2023 at 17:11
  • $\begingroup$ @BeneficialTree "snap the ends of the bone around for a neater fit" I'm afraid I don't follow you. You might be better off focusing the question on your ultimate problem, including the actual meshes involved. $\endgroup$
    – Nathan
    Commented May 13, 2023 at 17:20
  • $\begingroup$ Sorry, what I meant was that when I added a constraint to the bone, the result I got looked like the first picture (which works perfectly fine). I was wondering if there is a way to adjust it so it looks like the second example, while keeping the animation the same. i.sstatic.net/P7sjb.jpg $\endgroup$ Commented May 13, 2023 at 20:11
  • $\begingroup$ @BeneficialTree More than one way. I'd recommend, make another bone and parent it to the constrained bone. Give the second bone a rest pose rotated 180 degrees from the constrained bone, but at the same location. $\endgroup$
    – Nathan
    Commented May 13, 2023 at 20:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .