Blender/Quick Start

From NifTools
Jump to: navigation, search

This article provides a quick introduction to the Blender import and export scripts.

Contents

Textures

Most games have their textures in DDS format. Blender 2.46 and up support reading DDS files, so make sure you use a recent version of Blender!

The following instructions explain how you can extract the textures of various games, so you can use them in your own models.

Morrowind

Extract the contents of Morrowind.bsa (and, if you have the expansions, also Tribunal.bsa and Bloodmoon.bsa) into for instance c:\src\morrowind

(use the BSA Browser). It is good practice to copy the BSA files to c:\src\morrowind before unpacking them, to prevent you from accidently overwriting the nifs installed in your game directory.

Oblivion

Same as Morrowind; be careful not to unpack the files in your game directory. Unpack the BSA files into for instance c:\src\oblivion using the BSA commander.

Import

Usage

  • Launch the script and select the nif file you wish to import.

Limitations

  • The script does not import particle effects, lights, and cameras.

Known Issues and Workarounds

  • In some cases imported objects appear misaligned. In that case select all objects (press A once or twice), grab them (press G), move your mouse a bit, and cancel the grab (press ESC). If that does not help, post a bug report.
  • The import of animation is quite slow, and it does not import or merge standalone animation tracks. These have to be merged in a geometry with skinning info beforehand.
  • For Morrowind, the animation track is imported as a single long sequence rather than as a list of Blender actions. The start and end points of the actions are stored in a text buffer and can be edited manually.

Export

Usage

  • create meshes (and empties, if you need them) in Blender. If you wish to animate meshes without using armatures and bones, then, when grouping, always make parent without inverse (in Object Mode, use CTRL-SHIFT-P).
  • create armatures and bones for animation
    • either edit bone envelopes, and parent your meshes to armatures with vertex groups; the vertex weights will be constructed using the bone envelopes
    • or, simply parent meshes to bones (armature must be in pose mode)
    • make sure the vertex weights are set properly: select the armature, go to pose mode, and play with the bones; the mesh should move with the bones
  • create UV coordinates (be sure to check the blender manual for more details on UV mapping)
    • create seams (3D View, Edit Mode, select seam vertices, CTRL-E) where you want the UV seams (as you cannot project for instance a sphere onto a plane, usually you'll need at least one seam)
    • in the 3D View, UV Face Select Mode, select all faces, press U->Unwrap
    • (optional) if you want to create your own texture: in the UV/Image Editor, UVs->Save UV Face Layout, and process the saved texture with your favorite 2D paint program
  • add materials to your meshes, and add one texture to each material, with the following settings:
    • texture map input: UV
    • texture map output: COL for diffuse map (base texture)
  • for each texture:
    • set texture type to 'Image'
    • either load a texture from 'c:\src\morrowind\textures', or put your custom texture in the 'C:\Program Files\Morrowind\Data Files\Textures' folder, and load it from there.
  • (optional) to export vertex colors, turn on the VCOL_PAINT flag in the material tab
  • (optional) Hull your model in a simple so-called collision mesh: see Blender/Collision.
  • (optional) if you suspect that some of the faces of your meshes are not convex, then you should let blender triangulate these meshes (press CTRL-T in edit mode with all vertices selected), because in that case, Blender's triangulation algorithm gives better results than the naive triangulation algorithm used in this script.
  • select the models that you wish to export, and run this script from the 'File->Export' menu. Note that the script looks for unparented parents of the selected objects, and exports these root objects along with all of their children, so you don't have to select the whole model.

Limitations

  • Particle effects, cameras, and lights are not exported.
  • Actions (for animation groups) are ignored. You can define animation groups in a text buffer called "Anim".
  • Oblivion mopps are experimental, and may not work well in the game. Therefore it is recommended to use collision primitives (box, sphere, capsule) or convex collision shapes instead.

Known Issues and Workarounds

  • Non-uniformly scaled objects cannot be exported. Workaround: apply size and rotation (CTRL-A). Unfortunately, this workaround does not work on empties.
  • Ambient and emit colors are obtained by multiplication with the diffuse color.
  • Blender double sided faces will be one sided in the NIF file (workaround: duplicate faces, or even better, use NifSkope and add a NiStencilProperty with Draw Mode set to DRAW_BOTH).
  • Export of directly animated meshes is buggy unless you parent without parent inverse (CTRL-SHIFT-P). Workaround: don't animate meshes directly; instead, parent meshes to the armature and animate the bones.
  • Parenting meshes to bones is buggy unless the bind pose coincides with the current frame of animation. There's not much that can be done about it at this point, as this is due to a limitation in the Blender Python API.
Personal tools