Two handed swing of a club

Wondering how to accomplish a certain animation task? Ask here.

Moderators: Víctor Paredes, Belgarath, slowtiger

Post Reply
User avatar
sidsquid
Posts: 12
Joined: Sat Dec 07, 2019 3:54 pm
Location: Santa Barbara
Contact:

Two handed swing of a club

Post by sidsquid »

https://youtu.be/5KaZJFAJMVQ


I searched the forum and couldn't find any answers to this topic. Apologies if I missed them...

I have a character who's swinging a golf club. The golf club is in his left hand - I want to attach his right hand to the club during the swing sequence.
What's the best option(s) for doing this?
I used a target bone on the grip of the club, but still had to do a lot of twiddling frame by frame to keep the hand from slipping out of position, so I'm guessing there's a better and easier way to do it.

Making this 30 frames of animation has been very challenging - arms moving in front of and behind the body and each other, a body turn, etc!!! On the plus side I've learnt a lot!

Cheers
User avatar
Greenlaw
Posts: 9192
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: Two handed swing of a club

Post by Greenlaw »

Here's one way...

Image

Download Moho file: golfer.moho

I created two target bones parented to the golf club bone. Then I keyframed the targeting of the lower arm bones (not the hands) to the corresponding golf club bone targets just before I started animating the golf club.

Now, if the hands are supposed to always be on the grip, I'd use a rotatation constraint to automatically match the rotation of the target bones. However, since I have one hand off the grip and I wanted to keyframe the targeting, I don't want to use the constraint while the bone is not actively targeting. To make this easier to do, I used Independent Rotation on the hand bones. (I often do this anyway.) This means I had to keyframe the rotation of the hands through the swing but this is still easier than keeping the the hands locked to the club.

BTW, this is a good example of why Independent Rotation should be a keyframeable property, something I've been requesting for several years.

Other details: I'm also animating the bone length in the arms and changing the IK direction of the lower arms during the swing. This gives the arms a foreshortening effect and keeps them from bending unconvincingly. I'm also using Animated Layer Order in the bone layer to change the stacking order of the arms.

Finally, I have a Switch Layer to 'flip' the golf club during the stroke. You might think I could just flip the club's bone but that would also flip the target bone positions, which I don't wish to do here. (Just realized I didn't flip the hand bones properly during the animation, so something else to think about.)

There are probably easier ways to do this, but this was the first thing I thought of and I knew I could do this quickly.

Hope this helps.
Last edited by Greenlaw on Thu Jul 16, 2020 1:19 am, edited 1 time in total.
User avatar
Greenlaw
Posts: 9192
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: Two handed swing of a club

Post by Greenlaw »

A couple more things to consider:

Make sure the bone animation path is set to visible. This is how I checked that the arc of the golf club looked right.

If this was for an actual project, I might put an extra bone in the club to make it bend/curve. This would make the stroke look smoother and stronger inside the swing.
User avatar
sidsquid
Posts: 12
Joined: Sat Dec 07, 2019 3:54 pm
Location: Santa Barbara
Contact:

Re: Two handed swing of a club

Post by sidsquid »

Greenlaw wrote: Wed Jul 15, 2020 4:34 pm Here's one way...
Download Moho file: golfer.moho

......Hope this helps.
Brilliant! Thanks for the solution and especially the downloadable file. It really helped because I was able to plod through it frame by frame and see everything you'd done. It's helped me understand target bones and the many possibilities of constraints, which hasn't been something I'd explored much previously.

Love the idea of the a bone to bend the club - I've been struggling to figure out how to make my animations look less stiff, and more fluid/cartoony, so it's a useful pointer.

I'm going to mess around with this some more and see what the stretching and squashing constraints could being to the party - maybe they would help with the scaling of the lengths of the upper and lower arms (or more likely confuse the heck out of me!).

Thanks again for the help,
Cheers
Grahame
User avatar
Greenlaw
Posts: 9192
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: Two handed swing of a club

Post by Greenlaw »

Glad that helps!

If you're new to the Target Bone constraint, you're gonna love it. This feature allows characters to perform complex animations more easily than before we got this feature in Moho.

Tip: the 'standard' way to use a target bone is to select the bone you wish to target and then select the target bone from the Constraint window. However, there is an easier and more intuitive way to do this:

1. With the parent tool selected, Alt-click the bone you with to target another bone.
2. Ctrl-click the target bone.

This enables the target and keyframes it. Using this 'mouse method' is more direct and significantly quicker than going into the Constraints window and scrolling through a long list of bones.
User avatar
Greenlaw
Posts: 9192
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: Two handed swing of a club

Post by Greenlaw »

One fun use of target bones is to parent the target to the character's hips or the head bone. This way, your character can put its hands on the hips or shade its eyes while the body is moving around. I used this trick a lot in the interactive Puss-in-Book episode of Puss In Boots on Netflix. (You can see some of this PIB footage on my website.)
User avatar
Greenlaw
Posts: 9192
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: Two handed swing of a club

Post by Greenlaw »

Earlier I mentioned how you can't keyframe Independent Rotation. This is true but, if you really need this in your rig, there is a workaround solution: Create two sets of hands, one bound to a bone with IR, and another to a regular non-IR bone, and switch the visibility between the two hand versions.

I don't normally do this because it adds 'bone clutter' to the rig. This is where I wish we could keyframe the visibilty of any bone...another feature request I've been waiting for forever. I hope the devs will take these requests into consideration for the next version of Moho. Rigging and animation features like these are much more useful to me than, say, the brand new 3d engine.

But until we get keyframeable bone visibility, you can use Victor's clever 'switch-bones' technique to simply move the 'in-active' bones off-screen. If you don't know about his technique, there's more info here: 

"Switch Bones" technique (a very useful one...)
User avatar
Greenlaw
Posts: 9192
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: Two handed swing of a club

Post by Greenlaw »

BTW, I updated the demo rig I posted this morning. I was a little sloppy with the bones naming and hands animation this morning so I took a minute at lunchtime to fix it. It's not functionally different and probably not noticeably better but it's there if you want it. :)
User avatar
sidsquid
Posts: 12
Joined: Sat Dec 07, 2019 3:54 pm
Location: Santa Barbara
Contact:

Re: Two handed swing of a club

Post by sidsquid »

Greenlaw wrote: Thu Jul 16, 2020 12:30 am Tip: the 'standard' way to use a target bone is to select the bone you wish to target and then select the target bone from the Constraint window. However, there is an easier and more intuitive way to do this:

1. With the parent tool selected, Alt-click the bone you with to target another bone.
2. Ctrl-click the target bone.

This enables the target and keyframes it. Using this 'mouse method' is more direct and significantly quicker than going into the Constraints window and scrolling through a long list of bones.
Aha! Great tip! I love shortcuts and avoiding menus, etc.

Thanks for the tip on using targets to put hand on hips, etc - I'd only been using them for feet previously, so thanks for forcing me to think laterally!

The updated Moho file will be really useful - it's great to see how someone else uses it. For example, I'd given up using bone colours but after seeing your file (and watching the Moho setup vid on your website, which made me change the background colour amongst other things), I'll start using that again.

All in all thanks so much for sharing all your knowledge and ideas (I'll figure out the IR one later today) and for making me want to take the time to understand all the bone constraints - I'd glossed over them previously - they're going to make character setup and animation so much easier and more fun.

Cheers and happy animating
Grahame
User avatar
Greenlaw
Posts: 9192
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: Two handed swing of a club

Post by Greenlaw »

Yeah, I should do a video on naming convention and such. I have a system for naming layers, bones and actions which makes it so much easier to identify things, especially when I'm in a project with hundreds of layers, bones and Actions. Here's a short version of what I like to use in a rig/project:

For Bone color, my general rule is red for right side bones, green for left side bones, and orange for middle bones. My Smart Bone Dials are colored to match the sides they control. This makes it easier to track which SBDs control which side when the character turns away from camera and the sides become reversed. I'll use a different bone color when it conflicts with main color used in the character art. For example, green bones would not be ideal for rigging Kermit the Frog, so I might use red, purple, and orange instead.

I also like to attach an L and R marker to the character in a non-rendering layer. This layer flips when the character is facing away. This helps me a lot because I like to use the character's left and right sides when naming items, and this keeps it clear even when the character is facing camera.

For items that are in front of and behind, I prefer to use the terms Near and Far because the 'front' and 'back' of an item doesn't necessarily have to do with the item's depth from camera. (For example, the front of a bicycle when viewed from the side.)

You probably saw in one of my videos that you can disable color bones from the Timeline. I highly recommend doing that as it significantly reduces screen clutter and makes it easier to see and understand the keyframes.
Last edited by Greenlaw on Fri Jul 17, 2020 5:34 pm, edited 4 times in total.
User avatar
sidsquid
Posts: 12
Joined: Sat Dec 07, 2019 3:54 pm
Location: Santa Barbara
Contact:

Re: Two handed swing of a club

Post by sidsquid »

Greenlaw wrote: Thu Jul 16, 2020 8:17 pm You probably saw in one of my videos that you can disable color bones from the Timeline. I highly recommend doing that as it significantly reduces screen clutter and makes it easier to see and understand the keyframes.
Yup - that was a great tip - I'd stopped stopped color coding bones because of the mess in the timeline until I saw your vid
Thanks for the explanation about your color coding system, etc - good stuff...
Cheers
Post Reply