NIF file

From the Oblivion ConstructionSet Wiki
(Redirected from NIF Files)
Jump to navigation Jump to search

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]