Aligning a prop object to an Armature

I’d like to align a prop to match the position and orientation of a bone (say, a hand) in my Armature.

I’ve gotten these parts down:

  1. Select the hand bone
  2. Cursor to selection
  3. Select the prop
  4. Selection to cursor
  5. Parent the prop to the hand bone

But the part I can’t seem to figure out is how to orient the prop to match the orientation of the hand bone.

While I can eyeball this fairly easily, I need the precision of the prop matching the hand bone because these models/animations will be imported into a game engine, in which the prop will be dynamically snapped to the hand bone.

While I prefer a solution that’s in the Blender UI, I’m welcome to any solutions involving Python scripts. Though, I would think the Blender UI would have the capability to do this somehow…

Thanks in advance!

Not sure that I am understanding what the problem is here. If you parent an object to a bone the object will follow the bone however it moves. If you are referring to how you would position the object so it’s in the correct position for the hand to hold it (think sword or gun) then you just need to orient it that way before parenting. If you have already parented the object to the hand bone, as you’ve described, then want to change it’s position in relation to the hand bone, just move it as needed. As long as there is no animation data on the object (keyframes) it will maintain it’s offset from the bone.

Randy

Thanks for the response.

Yes, I’d like to orient it to the hand before parenting. Basically, cursor-to-selection/selection-to-cursor mimics the parent’s position, but not the orientation. The only way I can think of to match the parent’s orientation is to copy and paste the values from the parent Rotation to the child object’s rotation. However… you can only do this for objects, and only in global coordinates.

If I wanted to match the orientation of a bone, there’s no direct
way to get the rotation. You’d have to do some extra trig calculations to get the angles from the XYZ between the Head and Tail.

Basically, I need to set up a prop to inherit the initial orientation of the bone.

Well then, since you are using a game engine, I’m not sure what your options are. Can you use a copy rotation constraint on the prop to align it’s rotation to match that of the bone?
Will the prop be parented and un-parented at different times? Could the prop have it’s own bone, part of the character’s armature, that could be set to inherit the rotation of the parent bone?

I don’t know what your game engine will allow and not allow as far as blender goes. Sorry, I don’t work with game engines… perhaps consult it’s documentation on this matter…

Randy

@revolt_randy,
how is that you don’t understand a so simple question?
If you do not know the answer you are not obliged to do.

As for the question, I don’t think there is any easy way to do it, there’s a severe limitation in blender, the only way I can think of is this:

(EDITED)
add a ‘Copy Rotation’ constraint to the object you wan to align, pointing at the bone of the armature, then apply ‘Visual transform’ and delete the constraint.

It should work.

paolo

As for the question, I don’t think there is any easy way to do it, there’s a severe limitation in blender, the only way I can think of is this:

Really?

You don’t know much about Blender Rigging if you think that blender can’t do this… easily… Revolt has done this many times… In Blender…
Just not an un-named game engine however…

Thus Revolts question…

since you are using a game engine, I’m not sure what your options are. Can you use a copy rotation constraint on the prop to align it’s rotation to match that of the bone?

I don’t know what your game engine will allow and not allow as far as blender goes. Sorry, I don’t work with game engines… perhaps consult it’s documentation on this matter…

Revolts comments make all the since in the world to me…

If your wanting to just do it in blender that’s another matter…

Yes, I’d like to orient it to the hand before parenting. Basically, cursor-to-selection/selection-to-cursor mimics the parent’s position, but not the orientation. The only way I can think of to match the parent’s orientation is to copy and paste the values from the parent Rotation to the child object’s rotation. However… you can only do this for objects, and only in global coordinates.

the answer to the issue is to use an Empty Object… that way you now have full “object” options that are not available otherwise…

This is a quote from “freen” a user on BA …

The way I do it…
Link the character in, link the prop in, make proxies.
Make an empty. Snap it and parent it to the character’s hand bone (for example).
Add “Copy Transforms” to the prop, (or the appropriate bone from its rig), pointed at the empty.

The empty now can be used to set a default offset for your prop. Be sure to set a LocRot key to record the offset.

hope this helps…

Hi my friend. I faced with this problem and solved it in this way:
I made a constrain “child of” for my props for example “glass of wine”
then in target filed i wrote mych_proxy and for bone DEF-hand.R because i wanted this glass to be in right hand. first it did not worked good but after offing scale option in child of it worked good beside it is possible you have to relocated your props after that. i hope it helps you.