Mesh Geometry

  • The following section deals with Object which are of type ‘MESH’, containing Mesh Data(Mesh-Object)
  • Each Object is exported as a combination of NiTriShape and NiNode.
  • The Mesh is exported to a NiTriShape’s NiTriShapeData.

Example:

  1. Start Blender and empty the scene.
  2. Create any Mesh-Object to the scene, eg. cube primitive:
  3. Give the Object an appropriate name.
  • In the Object Tab
  • Generic names are automatically generated, unique names helps distingush 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), perpendecular 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 Object Data Tab
  • Enable/Disable Double Sided, see notes for more detail.
Double Sided Mesh - Adds a NiStencilProperty or 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 Texture to Mesh and allows visual representation of where each face is located on texture.
  • Each TextureSlot requires that the user select the UV Map Layer that was generated by unwrapping, See Textures Section.

Example: #. Create a mesh-object. #. In Edit Mode, select the faces you want to unwrap. #. Press U``, select Unwrap > Smart UV Project.

Notes:

Vertex Color

Example:

  1. Create a mesh-object.
  2. Switch to Vertex Paint mode, this automatically adds a base vertex color layer.
  3. Apply the desired vertex colors evenly to the vertex.
  4. Ensure you have added a material.

Notes:

  • The Nif format only supports a single color per vertex, whereas Blender vertex color per face vertex.
  • Blender treats the vertex as if the faces had been split apart, each face can have a different color for that vertex.
  • This image should clarify per-face vertes coloring
  • On export the scripts will take an average of colors.

Vertex Alpha

Vertex alpha is handled in the same way as vertex color. The only difference is that vertex alpha use grey scale.

Example:

  1. Create a mesh-object.
  2. Switch to Vertex Paint mode, If there are no vertex color layers this will create a new layer.
    you will need to add a second layer manually by clicking the + button in the vertex colors control panel located in the object data menu.
  3. In the brush menu on the left side of the screen, leave the color selector in the center and
    use the slider on the right side to change the level of shading with white being fully visible and black being fully transparent.
  4. Apply the shading to the vertices just as you would for Vertex Color

Notes:

  • Vertex alpha must use the second vertex color layer, even if there is no color applied in first color layer the default color layer must be in place.