Facial expressions in animations

From the Oblivion ConstructionSet Wiki
Jump to navigation Jump to search


Tools used in this tutorial

Required

Optional


Introduction[edit | edit source]

There are several tutorials out there to import animations into Oblivion. The files that they generate, kf files, tell the game engine how to move the several bones of the skeleton.

Faces don't contain bones though, so facial expressions (mouth movement, eye blinking, ...) cannot be controlled this way.

There is a way though. Here's how.

Tools Needed[edit | edit source]

You don't need much, but there are a few tools needed:

  • the latest version of NifSkope
  • FaceGen Modeller 3.1 or higher. Demo version (not needed but useful for testing)


What to do in Nifskope[edit | edit source]

Open up Nifskope and load the animation kf file.

Inside the kf file, there is an entry under the root NiControllerSequence block that is called NiTextKeyExtraData (mostly located at the bottom). This is the block where the action is. Select the block. In the details window, there is an entry 'Text Keys'. Open it and it will contain at least two sub Text Keys entries.

If you look at them (open them one by one), they each have a name in their Value entry, describing what they do. The two that must be there are called 'start' and 'end', and their 'Time' values will denote when the animation will respectively start and end.

Now we will add a new Text Keys block to enter a facial expression. To do so, select the NiTextKeyExtraData block and increase it's Num Text Keys value by 1. After that, rightclick on the parent Text Keys block and choose 'Update array'. There should now be one extra and empty Text Keys block at the bottom of the list.

Before telling you how to enter facial data in it, it's time to tell a little about FaceGen in the next section.

FaceGen[edit | edit source]

Oblivion uses FaceGen for rendering facial animations. If you have downloaded the demo version, you can start it up now.

In FaceGen, there is a morph tab. Inside it, you have several labeled sliders. Each slider represents a certain expression. Slide it, and you see the face changing expression. You can also combine expressions to form unique expressions, giving you numerous combination possibilities.

Here's the trick now: the expression labels are more or less repeated in the animation files. You can use FaceGen to search for the perfect expression combination, and then use nifskope to fill it in.

The next section will tell you how to do that.

Editing the Text Keys[edit | edit source]

Two sections ago, you have created a new Text keys block. In the Time value, enter the time you want the facial expression to begin.

In the Name value, you enter the expression(s) you want, in this form


ENUM: Face Expression_name Slider_percentage Buildup_time Hold_time Fadeout_time


ENUM: Face is obligated

Expression_name: FaceGen label. See list below.

Slider_percentage: The value of the morph slider, in percentage.

Buildup_time: Amount in seconds to go from 0 to the choosen percentage.

Hold_time: Amount in seconds the expression will remain at it's percentage.

Fadeout_time: Amount in seconds to go back to 0.


If you choose Fadeout_time to be 0, the expression will remain until another expression overrules it.

You can also combine expressions in the one text key by putting them on separate lines (use numpad enter to go to the new line) with a maximum of 9 lines.

Example:

ENUM: Face Oh 100 0.5 2.5 0.2
ENUM: Face Ooh 50 0.5 2.5 0.2

This is a blowing expression, consisting of 100% Oh and 50% Ooh. It will be build up in 0.5 seconds, hold for 2.5 seconds, and fade in 0.2 seconds.

Note: Experiments showed that the build up time has limits. If too big, the overflow will be added to the hold_time.

List of Expressions[edit | edit source]

The following is a list of expressions that where found by Scanti by extracting the name list from the tri files that come with Oblivion. Not all have been tested yet.

Aah

Anger

BigAah

BlinkLeft

BlinkRight

BMP

BrowDownLeft

BrowDownRight

BrowInLeft

BrowInRight

BrowUpLeft

BrowUpRight

ChJSh

DispAnger1

DispAnger2

DispAnger3

DispAnger4

DispHappy1

DispHappy2

DispHappy3

DispHappy4

DST

Eee

Eh

Fear

FV

Happy

I

K

LookLeft

LookDown

LookRight

LookUp

N

Oh

Ooh

R

Sad

SquintLeft

SquintRight

Surprise

Th

W

Sounds[edit | edit source]

It doesn't stop here. You can also play sounds from animations. Do the same as described above, but type as value:

Sound:soundobject_name

Soundobject_name needs to be a valid name in the CS's sound objects.

Example:

Sound: NPCHumanChew

Will play a chewing sound.

Conclusion[edit | edit source]

Now, facial expressions can be done in oblivion. I have made this smoking animation for the Smokeable clay pipe mod, which shows what neat things you can do with facial expressions: Click to play

I hope this tutorial can be useful to others as well.