Difference between revisions of "NIF file"

From the Oblivion ConstructionSet Wiki
Jump to navigation Jump to search
imported>JOG
Tag: Manual revert
 
(15 intermediate revisions by 7 users not shown)
Line 1: Line 1:
== NIF Files ==
== NIF Files ==
NIF files are the meshes of TCS. Currently the options to edit NIF files are limited because no NIF exporter for the Oblivion format has been released by Bethesda.  Hopefully they will soon.
NIF files are the meshes of TCS.  
 
New .nif files need to be stored in ..\Oblivion\Data\Meshes or a subfolder thereof.


The existing NIF files can be used in creating new objects in the TCS.  They will have to be extracted from the BSA files first.  See the Meshes and Textures category page for extracting details.
The existing NIF files can be used in creating new objects in the TCS.  They will have to be extracted from the BSA files first.  See the Meshes and Textures category page for extracting details.


With the tool [[NifSkope]] you can do some rudimentary modifications on existing NIF files, like retexturing, adding transparency or emmissive color ("glowing" meshes). You can also remove polygon-blocks when the NIF consists of more than one, but you can't change the model's general shape.
== Importer/Exporter ==
See the [[NIF Importers and Exporters]] page for exporters for [[Blender]], 3ds Max and Maya.


With the tool [[NifSkope]] you can do some rudimentary modifications on existing NIF files, like retexturing, adding transparency or emmissive color ("glowing" meshes). You can also remove polygon-blocks when the NIF consists of more than one, but you can't change the model's general shape.
== 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.


== Retexturing ==
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).
Even though they can't be edited currently, they can be re-textured, see the [[NIF_Retexturing|NIF Retexturing]] page for details.


==See also==
*[[Retexturing]]
*[[NIF Importers and Exporters]]


== Exporter ==
The [[Talk:Main_Page#Custom_Models|Main Discussion]] page has a post about using a Civ4 exporter thats partially compatible with the Oblivion NIF format.


[[Category:Meshes and Textures]]
[[Category:Meshes]]
[[Category:Animations]]
[[Category:Data_Files]]

Latest revision as of 13:12, 21 December 2023

NIF Files[edit | edit source]

NIF files are the meshes of TCS.

New .nif files need to be stored in ..\Oblivion\Data\Meshes or a subfolder thereof.

The existing NIF files can be used in creating new objects in the TCS. They will have to be extracted from the BSA files first. See the Meshes and Textures category page for extracting details.

With the tool NifSkope you can do some rudimentary modifications on existing NIF files, like retexturing, adding transparency or emmissive color ("glowing" meshes). You can also remove polygon-blocks when the NIF consists of more than one, but you can't change the model's general shape.

Importer/Exporter[edit | edit source]

See the NIF Importers and Exporters page for exporters for Blender, 3ds Max and Maya.

Structure[edit | edit source]

NIF files contain separate "blocks" that are structured in a tree-like manner. The "root" block, usually the first in the NIF, is a NiNode, a block type which supports collision data, extra data, properties, children, etc., each of which are, themselves, blocks. The most basic block is a NiObject, though most NIF files probably don't have any NiObject blocks - instead, the blocks of the NIF will all be sub-classes of the NiObject.

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 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[edit | edit source]

As mentioned above, the NiObject block is the most basic block type. NiObjectNET blocks are a type of NiObject, that is, a sub-class of NiObject, and can have extra data (see below) and/or animation controllers. NiObjectNET blocks, and all blocks derived from them (of which there are many), also have names.

NiAVObject[edit | edit source]

A sub-class of NiObjectNET, NiAVObject 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 NiNode blocks are NiAVObject blocks, which makes them quite important. Further, a number of very important blocks, such as NiGeometry and NiNode blocks, are sub-classes of NiAVObject.

NiGeometry[edit | edit source]

NiGeometry, a sub-class of NiAVObject, generally contains information about the actual shape of the mesh. Importantly, both NiTriShape and NiTriStrips, the two main ways of storing the mesh information, are descendants of the NiGeometry block, sub-classes of the NiTriBasedGeometry block that is itself a sub-class of NiGeometry.

NiNode[edit | edit source]

NiNode blocks are a sub-class of NiAVObject blocks, and therefore support all of the features of NiAVObject blocks. The root of a NIF file is always a NiNode block, so every NIF has at least one. NiNode blocks have a list of children - which are NiAVObject (or any sub-class, including NiNode itself) blocks. NiNode blocks can also have a list of effect blocks, as well as skeleton and skin information.

NiProperty[edit | edit source]

NiProperty is a sub-class of NiObjectNET, and therefore can have names or have extra data or animation controllers associated with them. The NiProperty class itself does not add new features, but the various sub-classes of NiProperty allow a variety of different properties (such as materials or texturing) to be associated with a NiAVObject by being included in the NiAVObject block's property list.

NiExtraData[edit | edit source]

NiExtraData is a sub-class of NiObject, and therefore inherits almost nothing aside from the most basic features of NIF blocks. Like NiObjectNET blocks, NiExtraData have names - it is worth noting that, unlike most blocks with names, which descend from NiObjectNET, NiExtraData blocks do not. They are associated, however - NiExtraData blocks are included in a NIF by being added to a NiObjectNET block's extra data list. These blocks simply supply additional, optional information about the NiObjectNET block to which they are attached. Most sub-classes of NiExtraData simply supply a single additional variable a given type - NiIntegerExtraData blocks add another integer, while NiStringExtraData add another string.

What the NiExtraData means is generally indicated by the block's name. For instance, the "Prn" block is a NiStringExtraData that exists in the root NiNode 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[edit | edit source]