PDA

View Full Version : IK Orientation problem. Unusual Rigging Approach


Luckarusky
05-08-2010, 03:41 AM
Salutations,
I'm putting together a game character rig on which I'm trying some new ideas. On thing that has bugged me is how legs and arms would "swivel" around like metal mechanics. So this time I decided to bone/skin the character in a more natural way.

This image includes the problem/scenario.
http://farm5.static.flickr.com/4041/4587625229_7844a2dee1_o.jpg

I have a similar setup on the arms so they twist naturally. The extra bone works great for natural motion, but is playing havok with how IK likes to work. If I lock unwanted rotations, it simply won't stay with the handle. If I unlock the rotations, it will ignore the rotation-only joint. And I made sure these bones are aligned correctly.

Any recommendations how to add IK to a rig like this would be appreciated. Thanks.

djx
05-08-2010, 04:15 PM
Hi Jordan. This is not really a new idea, so you'll be able to find plenty of examples of how you could implement these kind of twist joints. Most of the more advanced rigs that you can download from highend3d have this. A free auto rigging tools like Animation Studio's "Advanced Skeleton" (also free on highend3d) might be worth a look. Google around though. There are plenty of tutorials covering the subject.

David

Luckarusky
05-09-2010, 05:26 AM
I took a look at the advanced Rigging Tool as you suggested. It's pretty cool, but also very complex. My group is asking for faster results, So I'm trying to sort out just how to add mid-section rotation and move on with stuff I'm familiar with.

I can expariment with many of these more advanced tutorials once my group has somethign to work with. If someone knows a good tutorial for this singular problem, I can ease into furthening my knolage of character rigs. I'm looking to go one or two steps further then I already know. Not ten jumps. :wip: (I'll keep looking myself of course. but a time saving link would be appreciated.)

KielFiggins
05-09-2010, 06:49 AM
Yeah, distrubting twisting along extra joints isnt new. theres a lot of ways you can do it. Heres my approach:

http://www.3dfiggins.com/writeups/forearmTwist/

Creating 3 (or however many) joints that ride atop your chains (IK/Fk/Spline/ect). This way you keep your fk to 3 jionts, your ik to 3 joints and then have explicit control over the twist and volume.

Hope this helps.

Luckarusky
05-10-2010, 05:37 AM
Yeah, distrubting twisting along extra joints isnt new. theres a lot of ways you can do it. Heres my approach:

http://www.3dfiggins.com/writeups/forearmTwist/

Creating 3 (or however many) joints that ride atop your chains (IK/Fk/Spline/ect). This way you keep your fk to 3 jionts, your ik to 3 joints and then have explicit control over the twist and volume.

Hope this helps.

It did help tremendously. This system will work wonders for the game engine. And what's better, I can easily remove the extra bones for lower weight models to make the game more accessible. Thank!

Darksuit
05-10-2010, 04:33 PM
Adding in additional bones for a game rig can often be problematic, for a multitude of reasons.

Somethings to keep in mind while doing this, is that when working with a game engine you are going to have some restrictions that you would normally not have when doing film or school work.

Depending on your game engine, Expressions may be right out. There are some work arounds but a fair number of the engines out there ignore SDK and Expressions. You can bake the animations afterwards but that will add into your file size. This is one of the reasons I am always on about using Node based heirarchies and setups over expressions. Expressions have their place, but generally it is for very specific useages. Game rigs are generally not one of those.

Bone count can also be a limiting factor. Depending on the engine and your audience. You may want to limit the number of bones your using. Older games have a limit of 32 bones this is based on the video card being used along with Hardware vs. Software skinning. This is generally something that is defined by the export process.

Limitation based on the number of weights per vertex. This and the number of joints will have an impact on your FPS.

All of these factors will have an impact on how you build your rig for a game. If your doing Next gen game work, you of course get cut a lot more slack and have few restrictions. But all of these should be detrmined by your engineer.

Rig Specific --
For a male character you can achieve the same effect without the need for those extra bones. A lot of the problems I see with rigs stem from people not understanding point of rotation.

You can achieve the same effect by using an inverted V shape for the bone layout. group the bones under a spline object then parent that object to the root joint. This gives you the indipendant hip rotation while keeping the rotation of the legs in the correct placement.

Luckarusky
05-11-2010, 10:22 PM
Adding in additional bones for a game rig can often be problematic, for a multitude of reasons.

Somethings to keep in mind while doing this, is that when working with a game engine you are going to have some restrictions that you would normally not have when doing film or school work.

Depending on your game engine, Expressions may be right out. There are some work arounds but a fair number of the engines out there ignore SDK and Expressions. You can bake the animations afterwards but that will add into your file size. This is one of the reasons I am always on about using Node based heirarchies and setups over expressions. Expressions have their place, but generally it is for very specific useages. Game rigs are generally not one of those.

Bone count can also be a limiting factor. Depending on the engine and your audience. You may want to limit the number of bones your using. Older games have a limit of 32 bones this is based on the video card being used along with Hardware vs. Software skinning. This is generally something that is defined by the export process.

Limitation based on the number of weights per vertex. This and the number of joints will have an impact on your FPS.

All of these factors will have an impact on how you build your rig for a game. If your doing Next gen game work, you of course get cut a lot more slack and have few restrictions. But all of these should be detrmined by your engineer.

Rig Specific --
For a male character you can achieve the same effect without the need for those extra bones. A lot of the problems I see with rigs stem from people not understanding point of rotation.

You can achieve the same effect by using an inverted V shape for the bone layout. group the bones under a spline object then parent that object to the root joint. This gives you the indipendant hip rotation while keeping the rotation of the legs in the correct placement.


Thanks. I'll definently look into this solution. But I've got some tricks up my sleeve for reducing the number of keyframes on a baked rig skeleton-to-influence skeleton. I'm using baked key frames so the skeleton my rig influences can be slightly molded to fit differently proportioned characters. (we've got three different biped races I have to animate for)

For bone reduction, I like the method KielFiggins (http://forums.cgsociety.org/member.php?u=85720) described earlier. Because it's super simple to only have those extra bones for the highest level of detail. Go even one step back in the LOD, and those bones are dropped when the camera is too far away to see the effect. This way only one or two characters at a time have the extra influences. I've also restricted the skin influence to 3 bones per vertex. Tricky to paint, but that should save some calculations. Tick a settings option, and the highest LOD model isn't loaded at all.


btw We're using the unity engine and aiming for a 256mb 8600 gts, 2.2 duo core 1 gig memory system being able to play medium/high settings well. Not smoke it, smooth frame rates with good looks.

We want facial expression though, and that's going to be tricky. The institute of animation has an awesome tool that makes bone based faces possible. (I've tested it, and it works great in-game) But I'm looking at 33 bones to make a face that can look pull subtle expressions. Needless to say, that's a 3/4 shot effect ONLY. I really wish Unity supported blend shapes.

Darksuit
05-11-2010, 10:34 PM
having played with the unity engine as well. You will have to bake everyhting since its converting out to FBX/DAE when you import to the engine. You can run mock tests on your stuff by exporting FBX then reimporting back into maya and see what holds. This will give you a rough Smoke test.

For Blendshapes you can bake those out as well and they should hold. The problems stem from what the FBX format picks up when exporting. If your creating apps for the iPad/iTouch/iPhone you will want to limit your bone count down. This will reduce the amount of issue you run into.

KielFiggins
05-11-2010, 10:46 PM
To really get into the fine points of skin weighting to exporting to specific engines, you'll also want to look into your Spread Limit and your Decimel Limit.

I worked on Cell Phone games where the Spread Limit was 1 to 1 (1 vert could be weighted to only one joint), Hand helds of 1 to 2 (1 vert, 2 joints), and MMO's where it was 1 to 3.

Beyond that, look into how Pruning your weights will save run time cycles by having smaller weight matrixes. I cant explain the entire practice (my former Lead was a TD working on it over at ID), but he always cropped the weighting after .1 in most cases. It seems small, but if your going to have a lot of joint, characters on screen or really pressed for speed, any bit helps.

Good luck.

Luckarusky
05-11-2010, 11:45 PM
To really get into the fine points of skin weighting to exporting to specific engines, you'll also want to look into your Spread Limit and your Decimel Limit.

I worked on Cell Phone games where the Spread Limit was 1 to 1 (1 vert could be weighted to only one joint), Hand helds of 1 to 2 (1 vert, 2 joints), and MMO's where it was 1 to 3.

Beyond that, look into how Pruning your weights will save run time cycles by having smaller weight matrixes. I cant explain the entire practice (my former Lead was a TD working on it over at ID), but he always cropped the weighting after .1 in most cases. It seems small, but if your going to have a lot of joint, characters on screen or really pressed for speed, any bit helps.

Good luck.

And that's one of the reasons I limited the number of influences. I locked it so Maya won't let more then 3 joints have influence over one vertex. And yeah, all the animations are going to be baked. I've set up the rig so it's influencing a "Rig Control" skeleton. An identical "influence" skeleton is bound to the LOD meshes and will be the only thing present in the animation files.

So the animation files will have the full range of possible motion. But sane weight is maintained by less and less demanding meshes and joint counts as you get further away.

Luckarusky
05-11-2010, 11:51 PM
having played with the unity engine as well. You will have to bake everyhting since its converting out to FBX/DAE when you import to the engine. You can run mock tests on your stuff by exporting FBX then reimporting back into maya and see what holds. This will give you a rough Smoke test.

For Blendshapes you can bake those out as well and they should hold. The problems stem from what the FBX format picks up when exporting. If your creating apps for the iPad/iTouch/iPhone you will want to limit your bone count down. This will reduce the amount of issue you run into.

"Baking" blend shapes? Sure, I know about influencing a mesh by blend shapes and then flattening the hierarchy. (thus freezing the blend shape effect) But are you speaking of baking a blend shape animation? I didn't know Maya could do this.

Darksuit
05-12-2010, 12:51 AM
I Will see what I can do about setting up a sample file at some point soon for you. That said...

Leaving an extra set of bones in your scene is a waste of file size. Since the export/Conversion process is going to strip all those connections. It is also why the Untiy doc tells you that you need to bake all your animations out before exporting as FBX. For most games setup it is sometimes better to go with the simple rig. I am all for pushing the limits. But understand the Rules before you try and break them.

KielFiggins
05-12-2010, 01:12 AM
Typically, at the game studios i've worked out, a tool is created to 'prep for export' from the maya scene.

Select the character world control, and clicking a button on an interface, 'Prep'.

What the script would end up doing is:
-duplicate the skeleton from the reference file
-const the dup skeleton to the ref skel
-bake the animation on the dup skeleton
-remove the reference
-run an euler filter to help clean up rotation
-clean out the scene of any extra elements, layers, dup nodes, shaders, lights, ect
-save a seperate maya scene file of just the clean, baked skeleton / scene
-write out a text file (or new text line) stating the scene file name, length, skeleton info, ect

I'm sure I'm missing steps (as i didnt write the exporter), but thats the idea. Uses the existing skeleton, double checks all the clearances to remove user error and repetition.

Once thats taken care of and a pipeline established you can write the process to export the file to your desired engine, that is, if you have the know how.


note: this is assuming that your mesh is not being exported, only skeletal information

Luckarusky
05-12-2010, 01:13 AM
I Will see what I can do about setting up a sample file at some point soon for you. That said...

Leaving an extra set of bones in your scene is a waste of file size. Since the export/Conversion process is going to strip all those connections. It is also why the Untiy doc tells you that you need to bake all your animations out before exporting as FBX. For most games setup it is sometimes better to go with the simple rig. I am all for pushing the limits. But understand the Rules before you try and break them.


Don't worry, it won't be. I've built a MEL script that prepares the scenes for export before unity has a take at it. It's a bit like Nasa's rockets on the launch pad. The connection between the rig and influence controls are baked, taking into account the moderate preportion differences between the rig and race of chosen configuration. (Which is previewed as I'm animating it.) The rig and preview geometry is then deleted in one motion via a separated group. So all that's left for unity is a single skeleton with baked and simplified keyframes. The mesh the animations drive is it's own file separated from the rig. But the mesh and animations skeleton/rig share the same naming conventions and positioning based on the race.

The animation files will all still have the extra joints for the rotations I mentioned. But those won't be used in the animation unless the LOD is close enough to toggle a model skinned to use them. Similar with other sections. IE All four fingers of the two hands move individually. But at longer distances the mesh will be skinned to only use the middle finger joints and lower geometry in general as the distance allows.

Luckarusky
05-21-2010, 07:51 AM
Success! I've finished all the rigging and tools. My solution was to apply a two stage IK where one controls how IK behaves in a three link chain. The other is a reverse IK that can accept locked rotations while following the first IK's reference. And it's working great!

I was also able to complete my IK export tool. It's a script that bakes the key frames from the rig skeleton onto an influence skeleton. All the rigging is then stored in a "kill me" folder that is broken from the scene before exporting. thus the only thing left is the animating skeleton. Right now it uses every-frame keying, but I've got some tricks up my sleeve for better frame detection and optimization.

The last part of this puzzle is the Facial Expressions. And this one has me scratching my head a little. I do have a solution.. but 32 bones minimum per full detail face? (Institute of Animation's Facial expression tool.) I've proved it works in Unity, but it's as heavy as I feared, even for up close detail. (With the body I can at least disable extra bones by either LOD or user selected settings.)

So I'm open to suggestions how to realize facial expressions in an FBX based environment like Unity.

tonytouch
05-21-2010, 12:24 PM
you might want to have a look at this tutorialDVD

http://eat3d.com/facialrig

it is mainly about the same approach , which the AFS ( from filmakademie ) is going ( joint based ) - but without any underlaying mocap-animation , and one can decide , how many sliders ( or custom-attributes ) one wants to setup . but it is also possible to create none_linear-animation , because i think it is the same way they do it - vie setDrivenKeyframes ( animCurves )

afs from filmakademie is a really great research-project , but in most cases it ends up with thousands of expressions , that might never be used during animation - and although it is claimed to be a very fast approach to create believable facial-animation ( which it surely creates ) ... i experienced , it takes quite some time , getting familiar with the system - and most animators are "not knowing" which animation-slider they finally shall animate , because there are sooo many of them - i did not try version2.0 yet ... but i guess i will have a look at it soon

(btw. i suggest getting a copy of the Book from Paul Ekman and Erika L.Rosenberg "FACS: what the face reveals" it is 100% pure theory of psychology )

----------------
you might also want to have a look at the technical presenation from naughtyDog at the GDC 2010
http://area.autodesk.com/gdc/ondemand12

here is also some PDF which they did in order to present their rigging-pipeline
http://cmpmedia.vo.llnwd.net/o1/vault/gdc10/slides/simantov_judd_uncharted2_character_pipeline.pdf

altough i must confirm , that the entire pipeline is a really large set of tools , which they developed over the past 3 years , but anyway , it is one of the best ressources to have a look at , when it comes to game-rigging .

CGTalk Moderation
05-21-2010, 12:24 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.