Oni Central Forum

A forum for the Oni community

You are not logged in.

#1 01/03/21 10:01

Delano762
Member
From: Poland
Registered: 12/29/10
Website

Geyser's Blender IK/FK rig for animating characters

Introduction

This tutorial explains how to create animations for Oni using Geyser's Rigify rig for Blender, which vastly improves the animation-making process we had with XSI so far that EdT invented, and also allows us to switch to Blender for animating.

Before I start explaining how to do that, it's important to understand what a rig, Inverse Kinematics (IK) and Forward Kinematics (FK) are.

Also an important note - this tutorial, in its current state, is highly unfinished, and is more of a bunch of loose notes than a well-defined and written tutorial.

Also, there is no explanation of all the rig controls, but I think they're easy enough to get a hang of them just by playing with them. You can also contact me on Discord for an explanation, as that should take about 5 to 10 minutes via Voice Chat.

The reason this is in such a state is because I wanted the rig to be available by now rather than spending huge amounts of time which I don't have on correcting this tutorial.


Theory - What is a rig, IK and FK?

Let's suppose you have created a 3D character model for any post-2001 game.

You will not be able to animate it yet - that's because the model is just a mesh - it's basically a set of polygons that may or may not be textured and that's it.

Putting it simply, the model is lacking any way to control it, a way to move all the body parts around.

What the model requires for that is a rig - a set of controls that allow to move the model, kind of like it was a marionette.

The rig will include an armature - it's essentially a skeleton of which bones will control all the corresponding body parts of the model.

A good rig should also contain IK and FK controls. For the moment, I will just redirect you to the following video as an explanation of what IK and FK is. This is the easiest to understand explanation of these terms - anything else I've seen felt like academical mumble to me.



Gibberish explanation of IK and FK

In short, FK are controls that allow you to move the bones starting from the root bone down to the remaining bones in the hierarchy. Useful for e.g. punches, but terribly slow if you use it for everything, as making a change in a bone that's high in the hierarchy will change the position of the bones that are down in the hierarchy. E.g. changing the position of the root bone (usually it's the pelvis) will change the position of every other bone in the armature, forcing you to re-do the entire pose, and  doing that frequently will make your animation look very twitchy.

IK controls allow you to control bones starting from the end bone, up the hierarchy. So, you move the hand, the entire arm follows it. You move the torso, the hands and feet stay in place - no need to redo them. Fantastic if you want to keep some limb, especially leg during a kick, in place. You could make an entire animation using IK only, but IK is a bit less optimal than FK for e.g. swings, as you have little to no control over the joints that aren't the bone that you're controlling, since they're automatically repositioned.



Oni's 19-bone system

So, usually if you pick any 3D video game, its character models are essentially a single mesh with the addition of some separate meshes like eyes, tongue and maybe certain parts of clothing, which, once rigged, can distort and stretch as they move around.

Oni differs from that by having its character models consist of 19 rigid body parts, starting with the pelvis as the root bone. The root bone can be moved around and rotated, and remaining bones can only be rotated.

Konoko_bodyparts.png

OniSplit allows exporting character models and TRAMs (Oni's animations) interpreting all the bones as objects which depend on each other via parent-child relationship, effectively allowing FK-only animation, which was the only way to create anims for Oni until this rig became available.

However, animating using FK only is extremely time-inefficient to a point where it's essentially counterproductive - we're talking 20 to 100 times more work than if you animate using both IK and FK, or even just IK.

Therefore, IK is absolutely necessary for Oni.

On a side note, there are exceptions where an FK-only rig will be sufficient (very simple skeleton and short anims), as setting up an IK rig is a hard and time-consuming thing to do, and doing your anims with FK alone will be just faster than spending all the time researching an IK rig. Regardless, this is not the case for Oni.



How to import animations and models to Blender, and how to use Geyser's rig

During this summer, Geyser designed a Blender rig based on the Rigify plugin, that allows animating Oni characters with both IK and FK controls.

You can download the rig here, and you will need Blender to use it.

Not sure what else can I add, so I'll just move straight to the tutorial - basically the entire process is to export the anims from Oni, import them to Blender using OniSplit (Don't use OniSplit GUI, as it creates certain problems with the animations, and it doesn't support Blender anyway), constrain the model to the rig, animate it, bake each frame in each bone, remove constraints, export from Blender and import to Oni.

1) Make sure you're using the latest OniSplit - it's version 0.9.99.2 as of the time this post was written.
2) Extract as a DAE the TRAM you want to modify or use as a first-frame base, using commands available in this Oni-Blender tutorial by EdT.
3) (OPTIONAL BUT RECOMMENDED) This is not mandatory but I personally recommend animating with textured models. Unfortunately OniSplit does not support exporting animations with textured models yet, so what you will need to do is extract the relevant ONCC as DAE using the appropriate command from the above document.
4) Open Blender and open KonokoRig3.blend.

5) There are a number of things available in the project that have to be noted:
- The rig (the wireframe objects) - note the two pyramid-shaped objects - those control the influence of bone constraints in the rig via their position.
- Konoko model, which has no suffix in its body part names - this is what you will be animating. Note that unlike the Konoko models below, this has object constraints - this is what's constraining the model to the rig.
- In the scene viewer, the Pose1 and Pose2 collections, containing two animated Konoko models. The collections allow you to quickly hide and unhide all the body parts within them by just clicking at the relevant icon.

The way importing and constraining the animations to the rig works is that you delete one of the existing characters (two if it's a throw), then import your anims, constrain the anims to the rig, keyframe the relevant frames, disable the constraints, and you're ready to animate! So, moving forward:

6) (OPTIONAL BUT RECOMMENDED) If you don't replace the rigged model with anything else (which will require copying object constraints), assign all the relevant textures in the shading tab and base color nodes of each body part.
7) Select File/Import/Collada.
8) Set the scene Frame Rate to 60fps - it's in Output Properties.
9) Check "Import Units" box - this is critical and hard to fix if you don't check it and import your model without it, so always make sure you have it checked.
10) Import the TRAM.
11) (OPTIONAL BUT RECOMMENDED) Assuming you did step 3, go to the Shading tab. There should be a checkered ball icon in the middle, right next to the "Slot" panel - that's the Material Panel. In Object Mode, select each bone and assign the correct texture to it by selecting the texture in the material panel. This is possible because the TRAM file is linked to the character model file, and once step 3 is done, the character model file contains all the links to the textures AFAIK.
12) If there are any body parts that have alpha channel issues (and usually there always are), which make them display certain parts as black or white, select the affected body parts, and connect the Alpha socket of the Base Color to the Emission socket of Principled BSDF node and set Emission Strength of the node to 0.
13) (OPTIONAL) If you find any of the body parts too shiny for your taste, lower the Specular value in Principled BSDF.
14) Move the new model to the Pose collection from which you deleted the earlier Konoko model.
15) Use the Rig bone constraint target setting script to retarget the bone constraints of the rig.
16) Select the rig and go to pose mode.
17) For each frame that you want to remain in your animation, while having all the bones selected press Ctrl+A, select Apply Visual Transform to Pose and keyframe it.
18) Disable bone constraints on the rig using the Script for enabling/disabling constraints in selected objects.

19) You can now animate using the rig. I will explain controls of the rig in another post, as this is already a wall of text.

20) Once your animation is ready, use the Visual Transformer script to bake the rig keyframes into the character model.
21) Create a backup of your project, or at least the model.
22) Select all the body parts of the character in Object Mode, select Object / Constraints / Clear Object Constraints.
23) Export the model as DAE in accordance to the "Exporting" section of EdT's Oni-Blender tutorial.
24) Convert the DAE to a TRAM using the right command from EdT's Oni-Blender tutorial.
25) Insert the converted animation to your package, make sure it's listed in the TRAC and test it.

Last edited by Delano762 (01/03/21 11:01)


Circus Afro, Circus Afro, Polka Dot, Polka Dot!

Offline

#2 01/09/21 11:01

TOCS
Member
From: Denmark
Registered: 04/04/07

Re: Geyser's Blender IK/FK rig for animating characters

How did I miss this? Just the kind of post we needed. And probably really helpful for people wanting to set-up proper real-time texturing too!

Offline

Board footer

Powered by FluxBB