Difference between revisions of "Animation format"

From The Ghar Station Wiki
Jump to: navigation, search
(Created page with "== Animation data == Animation within a Gamebryo NIF is achieved using a combination of different techniques. ===Texture animation/scrolling=== Part of a NIF file. Uses a N...")
 
Line 3: Line 3:
 
Animation within a Gamebryo NIF is achieved using a combination of different techniques.
 
Animation within a Gamebryo NIF is achieved using a combination of different techniques.
  
===Texture animation/scrolling===
+
==Texture animation/scrolling==
  
 
Part of a NIF file. Uses a NiFloatsExtraData flag to specify UV texture co-ords to scroll. See [https://github.com/imathrowback/telarafly/blob/master/Assets/NIF/NIFLoader.cs#L566 NIFLoader.cs] source.
 
Part of a NIF file. Uses a NiFloatsExtraData flag to specify UV texture co-ords to scroll. See [https://github.com/imathrowback/telarafly/blob/master/Assets/NIF/NIFLoader.cs#L566 NIFLoader.cs] source.
  
===Character models===
+
==Character models==
  
 +
===NIF===
 
Most models in use a bone system to link the mesh (skin) with the bones, then the bones can be transformed.
 
Most models in use a bone system to link the mesh (skin) with the bones, then the bones can be transformed.
 
Model references are stored in telara.db in dataset 7305.
 
Model references are stored in telara.db in dataset 7305.
Line 17: Line 18:
  
  
 +
===KFM===
 
The animations for the model utilize a KFM (Keyframe) file.
 
The animations for the model utilize a KFM (Keyframe) file.
 
A [https://github.com/imathrowback/telarafly/blob/master/Assets/NIF/KFMFile.cs KFM file] contains a list of animations sequence ids and names. The names are not used in RIFT, instead the 'ID' is used to link to a KFB file.
 
A [https://github.com/imathrowback/telarafly/blob/master/Assets/NIF/KFMFile.cs KFM file] contains a list of animations sequence ids and names. The names are not used in RIFT, instead the 'ID' is used to link to a KFB file.
Line 24: Line 26:
 
   imp.kfm
 
   imp.kfm
  
 +
===KFB===
 
A KFB file is a NIF file containing the actual animation data. These files contain a series of data, each made up of 4 NIF blocks.
 
A KFB file is a NIF file containing the actual animation data. These files contain a series of data, each made up of 4 NIF blocks.
 
A KFB file uses a slightly different naming convention than the KFM.
 
A KFB file uses a slightly different naming convention than the KFM.
Line 63: Line 66:
 
|}
 
|}
  
 +
===Applying to the model===
 
The stored NIF data file within the KFB contains a list of NiSequenceData and NiBSplineCompTransformEvaluator that define how the bones should be transformed for each frame by evaluating a spline function.
 
The stored NIF data file within the KFB contains a list of NiSequenceData and NiBSplineCompTransformEvaluator that define how the bones should be transformed for each frame by evaluating a spline function.
 +
 +
See [https://github.com/imathrowback/telarafly/blob/master/Assets/AnimatedNif.cs#L143 AnimatedNif.cs].

Revision as of 23:59, 12 June 2017

Animation data

Animation within a Gamebryo NIF is achieved using a combination of different techniques.

Texture animation/scrolling

Part of a NIF file. Uses a NiFloatsExtraData flag to specify UV texture co-ords to scroll. See NIFLoader.cs source.

Character models

NIF

Most models in use a bone system to link the mesh (skin) with the bones, then the bones can be transformed. Model references are stored in telara.db in dataset 7305.

An example model might be

 imp.nif


KFM

The animations for the model utilize a KFM (Keyframe) file. A KFM file contains a list of animations sequence ids and names. The names are not used in RIFT, instead the 'ID' is used to link to a KFB file.

A KFM file uses the same naming convention as the NIF and is usually specified within the NIF entry in telara.db:

 imp.kfm

KFB

A KFB file is a NIF file containing the actual animation data. These files contain a series of data, each made up of 4 NIF blocks. A KFB file uses a slightly different naming convention than the KFM. In general if the NPC can wield different weapons, then the KFB file name changes depending on the type of weapon equipped. The actual strings can be gathered from dataset 230 such as:

 2h_staff
 1h_ranged
 dual
 etc.


These are then formatted with the name to give a valid KFB file:

 human_female_dual.kfb
 human_female_2h_staff.kfb



Each sequence in the KFB is made up of:

NIF Type Purpose
NiIntegerExtraData Contains the ID to link to the sequence within the KFM
NiIntegerExtraData Size of the uncompressed binary data of the next block
NiBinaryExtraData Compressed(ZLIB) NIF file stored as binary data.
NiBinaryExtraData Unknown additional data. Appears to contain references to animation triggers like sounds.

Applying to the model

The stored NIF data file within the KFB contains a list of NiSequenceData and NiBSplineCompTransformEvaluator that define how the bones should be transformed for each frame by evaluating a spline function.

See AnimatedNif.cs.