Mesh Geometry¶
The following section deals with
Objectwhich are of type ‘MESH’, containing Mesh Data(Mesh-Object)Each
Objectis exported as a combination ofNiTriShapeandNiNode.The
Meshis exported to aNiTriShape’sNiTriShapeData.
Example:
Start Blender and empty the scene.
Create any Mesh-Object to the scene, eg. cube primitive:
Give the Object an appropriate name.
In the Object Tab
Generic names are automatically generated, unique names help distinguish objects,
The Nif format only supports triangle based geometry.
Blender quads and n-gons are exported as triangles, which may lead to differences in rendered geometry.
Strips (
NiTriStrips) are available but not developer supported as they are unnecessary for current hardware.
Double-Sided Mesh¶
Each triangle is composed of 3 vertices, edges and a face.
To decide which way the face is pointing a vector(normal), perpendicular to the face is used.
This normal vector can be flipped to either side of the triangle; a common source for triangles appearing to not render.
Sometimes you want to allow the mesh to ignore the normal and render both sides, eg a cloak.
In the Properties Editor, in the Material Properties Tab
Enable/Disable Backface Culling, see notes for more detail.
Double Sided Mesh
Adds a
NiStencilPropertyor similiar, see Properties - Stencil Property for more info.
UV Unwrapping/Mapping¶
UV-unwrapping is the process of unfolding all the faces onto a flat plane, see Cube Unwrap.
The UV-unwrapping process creates a UV Map layer.
The UV Map Layer is used to layer connect a
TexturetoMeshand allows visual representation of where each face is located on texture.Each
TextureSlotrequires that the user select the UV Map Layer that was generated by unwrapping, See Textures Section.
Example:
In Edit Mode, select the faces you want to unwrap.
Press
U, select Unwrap > Smart UV Project or an unwrapping algorithm of your choice.
Notes:
UV-unwrapping adds a
MeshTextureFaceLayerto the Object.Although Blender allows multiple
MeshTextureFaceLayer, most versions of the Nif format only support one UV layer
Vertex Color & Alpha¶
Example:
Switch to Vertex Paint mode, this automatically adds a base vertex colour layer. Make sure you name this layer ‘RGBA’
Apply the desired vertex colours evenly to the vertex.
You can alter the alpha channel using the ‘Add Alpha’ and ‘Erase Alpha’ brushes.
Notes:
The Nif format only supports a single colour per vertex, whereas Blender vertex colour per face vertex.
Blender treats the vertex as if the faces had been split apart, each face can have a different colour for that vertex.
On export, the scripts will take an average of colours.