Difference between revisions of "NIF file"

Jump to navigation Jump to search
4,701 bytes added ,  14:41, 27 August 2010
I know I haven't gotten even remotely all of the important block types here, but these are the ones I know
imported>Qazaaq
m (NIF Files moved to NIF file: Allows for direct use in sentences, the ''s'' can be appended easily if the plural form is required.)
imported>DragoonWraith
(I know I haven't gotten even remotely all of the important block types here, but these are the ones I know)
Line 10: Line 10:
== Importer/Exporter ==
== Importer/Exporter ==
See the [[NIF Importers and Exporters]] page for exporters for [[Blender]], 3ds Max and Maya.
See the [[NIF Importers and Exporters]] page for exporters for [[Blender]], 3ds Max and Maya.
== Structure ==
NIF files contain separate "blocks" that are structured in a tree-like manner. The "root" block, usually the first in the NIF, is a <tt>NiNode</tt>, a block type which supports collision data, extra data, properties, children, etc., each of which are, themselves, blocks. The most basic block is a <tt>NiObject</tt>, though most NIF files probably don't have any <tt>NiObject</tt> blocks - instead, the blocks of the NIF will all be sub-classes of the <tt>NiObject</tt>.
Some of the major block types are presented below. These blocks fit into the hierarchy of sub-classes as follows:
* NiObject
** NiObjectNET
*** NiAVObject
**** NiGeometry
**** NiNode
*** NiProperty
** NiExtraData
The complete hierarchy can be found in the [http://niftools.sourceforge.net/doc/niflib/classNiflib_1_1NiObject.html Niflib documentation]. The functions available to Niflib for each block type can be a useful way to determine what the block can do and what it is used for.
=== NiObjectNET ===
As mentioned above, the <tt>NiObject</tt> block is the most basic block type. <tt>NiObjectNET</tt> blocks are a type of <tt>NiObject</tt>, that is, a sub-class of <tt>NiObject</tt>, and can have extra data (see below) and/or animation controllers. <tt>NiObjectNET</tt> blocks, and all blocks derived from them (of which there are many), also have names.
=== NiAVObject ===
A sub-class of <tt>NiObjectNET</tt>, <tt>NiAVObject</tt> blocks inherit the ability to have extra data, animation controllers, and names. They further add the ability to translated, rotated, or scaled, can have collision blocks associated with them, have a visibility value, and can have property blocks attached. The children of <tt>NiNode</tt> blocks are <tt>NiAVObject</tt> blocks, which makes them quite important. Further, a number of very important blocks, such as <tt>NiGeometry</tt> and <tt>NiNode</tt> blocks, are sub-classes of <tt>NiAVObject</tt>.
=== NiGeometry ===
<tt>NiGeometry</tt>, a sub-class of <tt>NiAVObject</tt>, generally contains information about the actual shape of the mesh. Importantly, both <tt>NiTriShape</tt> and <tt>NiTriStrips</tt>, the two main ways of storing the mesh information, are descendants of the <tt>NiGeometry</tt> block, sub-classes of the <tt>NiTriBasedGeometry</tt> block that is itself a sub-class of <tt>NiGeometry</tt>.
=== NiNode ===
<tt>NiNode</tt> blocks are a sub-class of <tt>NiAVObject</tt> blocks, and therefore support all of the features of <tt>NiAVObject</tt> blocks. The root of a NIF file is always a <tt>NiNode</tt> block, so every NIF has at least one. <tt>NiNode</tt> blocks have a list of children - which are <tt>NiAVObject</tt> (or any sub-class, including <tt>NiNode</tt> itself) blocks. <tt>NiNode</tt> blocks can also have a list of effect blocks, as well as skeleton and skin information.
=== NiProperty ===
<tt>NiProperty</tt> is a sub-class of <tt>NiObjectNET</tt>, and therefore can have names or have extra data or animation controllers associated with them. The <tt>NiProperty</tt> class itself does not add new features, but the various sub-classes of <tt>NiProperty</tt> allow a variety of different properties (such as materials or texturing) to be associated with a <tt>NiAVObject</tt> by being included in the <tt>NiAVObject</tt> block's property list.
=== NiExtraData ===
<tt>NiExtraData</tt> is a sub-class of <tt>NiObject</tt>, and therefore inherits almost nothing aside from the most basic features of NIF blocks. Like <tt>NiObjectNET</tt> blocks, <tt>NiExtraData</tt> have names - it is worth noting that, unlike most blocks with names, which descend from <tt>NiObjectNET</tt>, <tt>NiExtraData</tt> blocks do not. They are associated, however - <tt>NiExtraData</tt> blocks are included in a NIF by being added to a <tt>NiObjectNET</tt> block's extra data list. These blocks simply supply additional, optional information about the <tt>NiObjectNET</tt> block to which they are attached. Most sub-classes of <tt>NiExtraData</tt> simply supply a single additional variable a given type - <tt>NiIntegerExtraData</tt> blocks add another integer, while <tt>NiStringExtraData</tt> add another string.
What the <tt>NiExtraData</tt> means is generally indicated by the block's name. For instance, the "Prn" block is a <tt>NiStringExtraData</tt> that exists in the root <tt>NiNode</tt> block's extra data list in NIF files associated with equipable items. In this case, the value of the string dictates where the mesh appears on a character when equipped (a value of "SideWeapon" indicates a weapon that is sheathed on the hip, while "BackWeapon" is a weapon sheathed over the shoulder, and "Torch" is an item held constantly in the left hand).


==See also==
==See also==

Navigation menu