Home Technical Talk

Rigging a weapon to two hands

I'm still working on a character's rig, and since this is the first character I've ever rigged, I don't know what I should look for in a good rig until I run into a problem with it (hence the really long time in between cries for help, hah hah).

Anyway, my character is going to hold an assault rifle with both hands, and I was wondering what the best way to rig the weapon into the hands was. As of right now, I have the weapon position constraining the effectors of the forearms, which moves both hands really well. My next idea was to orientation constrain the wrists to the orientation of the weapon, but my problem is that the wrists don't rotate on the right axis (the local axises are different for the weapon and wrist), and the rotation does not move the hands to keep in the same relative postion. In other words, the forward hand remains in place and rotates at the wrist while the weapon passes through it.

How does everyone else rig weapons to hands? The position constraint works great until I need to turn the weapon...

Replies

  • animatr
    Options
    Offline / Send Message
    animatr polycounter lvl 18
    the way i do it at work is this, the weapon has a root joint, that i position and orient constrain to the hand. then, i have a bone right under the weapon's root joint, called anim(its a child of the root) and that is the bone that the weapon is weighted to.
    then i take that anim bone, and move it until it fits in the character's hands, and then you're good to go. now whenever he moves his hands, the wepaon will fit it. as for the other hand holding onto the weapon, just create a dummy/locator, where you want the other hand to be, contrain the hand to it, the make the dummy/locator a child of the weapon.
  • Archvilell
    Options
    Offline / Send Message
    I'm such a dummy. Why didn't I think of using a null or something to constrain the second bone to? Also, good call pointing out that the weapon root needs to be in the trigger hand. I didn't notice that it would pass through part of the weapon if it weren't - I was mostly bummed that the second hand went clear through the weapon.

    I'll try this out. Thanks for the quick reply.

    Ben
  • Archvilell
    Options
    Offline / Send Message
    Okay, I've run into another problem that I can't figure out. The orientation constraints don't work exactly as planned because the wrists axises are oriented differently than the weapon root's axises, so when I rotate the weapon up and down (say on the Y axis), the hand rotates toward and away from the body (also on it's Y). Since the two are oriented differently, they rotate differently. How can I fix this?

    Ben

    *Idea* It would work if I could constrain their GLOBAL orientations as opposed to their locals orientations, but I don't think I can do that. Wait... the expression editor will let me link global transformations, but will that override the screw ups the orientation constraint causes?
  • Mark Dygert
    Options
    Offline / Send Message
    Maya? Max? Biped? Custom bone rig? Biped handles this really well and its easy to set up, I won't get into the details because it sounds like you're using a custom bone rig and maybe Maya?
  • animatr
    Options
    Offline / Send Message
    animatr polycounter lvl 18
    sounds like your contraints are backwards. i would constrain the weapon to the hand, not the other way around. the weapon should never rotate unless the hand rotates.
Sign In or Register to comment.