Blender rigging for unity. IK and FK too many bones?

Hi. I have been wondering what the best way to rig in Blender for use in unity. I know how to rig, so that’s not my issue. I was wondering what the best way to do it with unity in mind. When I read the section on modeling optimized characters http://unity3d.com/support/documentation/Manual/Modeling%20Optimized%20Characters.html It suggests using around 30 bones, and to separate IK and FK. If I have my deforming bones constrained to my IK bones, I can use IK when I want, and then turn off the constraints when I want to use FK (I would normally only do this with my arms) However, doing this forces me to use a lot more bones than 30 (especially if I want to get fancy with my rig to make bending fingers easier). Also, how do I seperate out IK and FK like the page wants me to? If I delete my IK bones then all my animations will be broken. (I’ve tried deleting them in Unity, but that breaks everything as well) The way I’ve been doing this was to just do nothing special with my rig, and just drop the .blend into my assets. So far everything has been working, but I want to optimize everything. Does having IK in my skeleton make Unity slower? Are just the bones with “Deform” checked calculated in Unity? I don’t want all kinds of unneeded bones taking up resources. (I want a lot of characters on the screen at once)

Have you seen that one http://forum.unity3d.com/threads/90913-Rigify-to-Unity? It certainly only works with Rigify.

Cool! Thanks. That looks really nice! I haven’t really used Rigify much. I saw a tutorial and it’s super simple. I’m defiantly going to use this for some of my more detailed characters! Currently, my character in Unity is VERY simple. (In fact, he’s just a box guy meaning no fingers, or even toes. I’m even considering taking off his neck bone) Anyways, Using Rigify I was able to delete the finger bones from the Meta-Human rig, but when I try to take off the shoulders, or the toes, Rigify doesn’t work properly. Do you know anything about this? I tried to make my current rig as simple as possible, since I plan on having hundreds of guys on screen at once.

You have two options. Either you use the meta rig and simplify it, which can lead to exactly those problems, or you slowly start to build your own one, by studying how to construct all the needed parts and connect them as you wish. For me it was the easiest way so far to do the latter one. But I am probably not the best person to answer that question. It is more likely that you are getting a good answer at the blenderartists forum.

I had the same problem on my first time after using full IKs for animating my character in Blender. When i pass that to Unity 4.0, loading the fbx and applying changes to it was even taking too long. I still dont know a way for baking an action that is created by use of full IK in Blender. So i thought use of IK in Blender has created this problem.

Then i made a short animation to test full FK animation transfer to Unity. Result was same my game hits to 10fps as soon as I put my character into the scene. I also used the editor scripts in the link that Dantus has provided, Thanks a lot btw for the nice editor scripts :). But sadly the WGT named bones were not my problem and actually i even had some problem after they have been deleted such as the text below that appears in the console:

“[mecanim]: BindSkeleton: cannot find Transform ‘WGT-VIS-upper_arm_pole_R’ UnityEditor.DockArea:OnGUI()”

I have tried couple other things to test if assigning the rig of my character in Unity for Mecanim is creating the problem. But i ended up finding the solution to my problem by just exporting my character FBX again and clicking “Only Deform Bones” in the export options of the blender. I have no idea about what it really does. But the size of my FBX decreased from 10.4 mb to 6.1mb which makes more sense for just couple of animations attached to it.

So what i recommend that anyone who faces this problem to try exporting it again with “Only Deform Bones” option clicked in Blender.

1 Like

Just as a quick note: Rigify and thus Rigify to Unity are NOT compatible with Mecanim!

You may test that: When you animate in Blender, instead of just keyframing the changed bones, try to keyframe all the bones and see if that works.

I recently watched a video about the rigging of the two main characters in “The Last Of Us” - 98 joints in the face and 300+ joints in the body.

That seems a long way from 30.

The Last Of Us – Character Rigging and Modeling

Currently I’m following a workflow described by Lee Salvemini at :

Introduction to Rigging!

which seems like one of the options that Dantus is suggesting.

To me - an interesting thread.

cheers gryff :slight_smile:

= in the body