NifSkope Comprehensive Guide

From the Oblivion ConstructionSet Wiki
Revision as of 15:46, 24 July 2007 by imported>Chuey (Moved heading 5 to section 2)
Jump to navigation Jump to search

Introduction

The purpose of this guide is to explain and walk you through the ins and outs of working in NifSkope. This guide should continue to be updated as new releases of the NifSkope tool is released. The guide should remain centered around the TES:Oblivion modding community by providing information and tutorials on creating mods for TES:Oblivion. Areas that need more information are noted throughout the guide so editing is encouraged if you have useful and correct information to add.

NIF Files and Installing NifSkope


What’s a NIF file?

Let’s start simple. A .nif file [example: dagger.nif] is created by the GameBryo Essentials Toolkit when the developer saves their final version of a game object. This object can be anything from a rock to a human head to a stone wall. GameBryo is the Game Engine that was used to create TES:Oblivion as well as TES:Morrowind before it.

These files are then compressed into a .bsa file by our good friends at Bethesda Softworks. The core need by modders to make new meshes and textures or edit existing ones is to have the ability to edit these NIF files. That is where NifSkope comes in.

NifSkope is a .nif viewer/editor available free from the NIFTools team. They have created this program to enable us to view and edit Net Immerse Files (NIF).

Downloading and Installing NifSkope

Now that we know what a NIF file is lets go get the NifSkope program.

  • Expand the 0.9.8 version using the + sign next to the version number.
  • Click on the link: ‘nifskope-0.9.8-windows.exe’
  • Save the file to your Desktop.
  • Now go to your desktop and double-click the icon ‘nifskope-0.9.8-windows’
  • Follow the prompts and install NifSkope to your computer’s hard drive.

Opening NifSkope for the First Time

Okay, so now we have NifSkope installed. Lets open it and see what’s inside.

  • Start -> All Programs -> NifTools -> NifSkope, NifSkope

Okay now we are in. First thing we need to do is tell NifSkope where the files we want to mod are.

  • Click: Render menu -> Settings…


This window controls NifSkope’s render window. You'll most likely never use 90% of the controls in here. We'll go into more detail on these later, so for now, all we are concerned with is the Auto Detect and Custom groups.

  • Auto Detect: Click ‘Oblivion’

You should have seen a file path appear in the Custom group. This file path should point to where you installed your TES:Oblivion game and then the /Data directory. If it doesn’t, then follow the instructions below. Otherwise click the small ‘X’ in the upper right and continue on to the next topic.

If the auto detect did not follow the correct path double click on the path it did provide. If it did not provide a path click the ‘Folder’ button. Either way enter the following:

  • C:/Program Files/Bethesda Softworks/Oblivion/Data

NOTE: This assumes that you installed the game into your C Drive, Program Files directory. If you are unsure of where you installed the game go to: Start, All Programs, Bethesda Softworks, Oblivion and right click on the ‘Oblivion’ icon and select ‘Properties’. In the ‘Target’ field you will find the install directory.

User Interface Overview

Now we will explore the user interface including all the buttons and menu items. Some of these you will always use and others never. But it is a good idea to at least understand what they all do.

The Main Window

NifSkope is amazingly intuitive and easy to navigate. The user interface is divided into the three primary (default) windows:

Render Window
  • The window on your right is the render window. This is where you will see the model your currently working on in 3D space. You can rotate, zoom, and pan in here. The blue line is your Z Axis; the red line is your X Axis; and the green line is your Y axis.
Block List
  • The window on your left is the block list window. This window displays the guts of your NIF file. This is where you will be editing and adding to the list of Ni data blocks (guts). The Ni data blocks are listed in a tree format much like a directory window. But we will get more into that later.
Block Details
  • The window at the top is the block details window. This window displays all the commands and instructions contained within each of the Ni data blocks. Editing or adding commands and instructions is how you create all types of effects on your meshes and textures.


There are also two non-default windows available to you. Lets go ahead and activate them so we can see what they offer us.

  • Click: View menu -> KFM
  • Click: View menu -> Reference Browser


KFM
  • This window displays the animation data contained within .kfm file types. KF and KFM files are file types used to 'pin' animations to models. This is an advanced topic which there is currently only limited information available on. Further information needed

NOTE: This doesn't mean that it isn't possible to create or edit animations. There has been talk on forums of the possibility of adding animations using Blender. If anyone has further information on this topic please add.

Reference Browser
  • This browser will display descriptions of of all the data strings contained within the selected block in the Block List window. It will also display descriptions on commands and instructions on selected items in the Block Details window. This is very useful but should only be opened when needed.


Close the KFM and Reference Browser windows using the same method used to open them or just click the 'X' in the upper right of each window.

Menu Items

NifSkope contains five menu drop downs. Some are obvious (Save, About, ect.) and some not so obvious (Optimize, Sanitize, ect.). We will explore these in more detail below so first lets open our a NIF file.

  • Click: File menu -> Load
  • Browse to your Oblivion install directory, then Data/meshes/weapons/iron
  • Click to highlight: battleaxe.nif
  • Click: Open


You now have the iron battleaxe open. The iron battleaxe will be our NIF file used in the next few sections so if you need to come back to a section later just reopen it and start from where you left off.

File, View, & Render Menus

Now that you have a NIF file opened you will see the three default windows mentioned earlier are now populated. We will walk through the functionality of each of them later. For now, lets start with the menus at the top of the screen. Go ahead and try each of the menu items as they're explained. This will give you some good real time experience with their functionality.

File
  • Load: Loads a NIF file from the selected file path.
  • Save: Saves the NIF file to the selected file path.
  • Import, 3DS: Imports an AutoDesk 3DS Max file.
  • Import, OBJ: Imports a .obj (Object) mesh file.
  • Auto Sanitize Before Save: NifSkope will run all the 'Sanitize' scripts on your NIF file prior to saving if this is check marked.
  • New Window: Opens another fresh window of NifSkope.
  • Reload XML: Reloads only the NIF file's XML code.
  • Reload XML + Nif: Includes the NIF data in the XML reload. Basically a complete reload of the currently opened NIF file. Use this if your in a situation where you deleted something you didn't mean to.
  • XML Checker: Use this to check for XML code errors in NIF files. Use the window to select a directory and associated block. NifSkope will check all NIF files in the selected directory or errors and display the results. It can also be used to find all NIF files within the selected folder that contain a specified Ni Block.
  • Resource Files: Used to find files within .BSA files, for example textures, which haven't been extracted. Further explanation/functionality needed.
  • Quit: Closes NifSkope. Beware! There isn't an auto save or a prompt to save your file first before closing.
View
  • Block List: Toggles window on/off.
  • Block Details: Toggles window on/off.
  • KFM: Toggles window on/off.
  • Reference Browser: Toggles window on/off.
  • Toolbars,Load Save: Toggles toolbar on/off.
  • Toolbars,View: Toggles toolbar on/off.
  • Toolbars,Animation: Toggles toolbar on/off.
  • Block List Options, Hierarchy: Changes the block list window to display Ni data blocks in an expanding tree format.
  • Block List Options, List: Changes the block list window to display Ni data blocks in a top down list format.
Render
  • Top: Positions the render view camera on the Z Axis (Blue Line).
  • Front: Positions the render view camera on the Y Axis (Green Line).
  • Side: Positions the render view camera on the X Axis (Red Line).
  • Walk: Enables walk mode. Use the W,S,A, and D key on the keyboard to pan and zoom the image in the render window.
  • User: Restores the render window camera position to the last 'Saved User View'.
  • Flip: Positions the render view camera in the opposite orientation. If viewing the +Z axis, clicking this will position the camera on the -Z axis.
  • Perspective: Switches the render window to an orthographic projection in normal view mode.
  • Save User View: Saves the current camera position. Restore by pressing 'User'.
  • Draw Axis: Toggles the X,Y,and Z axis image on/off.
  • Draw Nodes: Toggles the node images (like scene root) on/off.
  • Draw Havok: Toggles the havok meshes on/off.
  • Draw Furniture: Toggles the furniture animation markers on/off.
  • Show Hidden: Show hidden meshes contained in the NIF file on/off.
  • Show Stats: Show selected Ni block data in the render window on/off.


Render Window Settings

The render window settings control the search path, rendering, and lighting of the render window. These controls will make dramatic changes to the way your model is rendered and should be used sparingly. Lets walk through each of the setting options available to you.

Auto Detect
  • Pressing one of the buttons will cause NifSkope to seek out and find the directory your texture files are located in for the game named on the button. Then adds the result to the list of search paths.
Custom
  • Add Folder: Adds a new folder to the list of search paths.
  • Remove Folder: Removes the highlighted folder from the list of search paths.
  • Move Up: Moves the highlighted folder up in the search list.
  • Folder: Opens a directory browser and will change the highlighted folder to the new folder that is selected.
  • Look for Alternatives: If check marked, NifSkope will search for an alternative texture file if the corresponding .dds file is not found.
Render
  • Anti Aliasing: Enables your graphic card's anti aliasing feature in the render window.
  • Textures: Enables the rendering of mesh textures in the render window.
  • Shaders: Enables the rendering of shader effects in the render window.
Up Axis
  • Sets the render windows Positive Height axis. Meaning that by default the Z axis is up in height. Please add information on how this effects saved NIF files.
Culling
  • Cull Non Textured: If checked, NifSkope will not display meshes that do not contain an associated texture.
  • Cull Nodes by Name: If checked, NifSkope will not display Nodes containing the suffixes listed in the the text box.
Light
  • Changes the render window ambient, diffuse, and specular light color. Selecting and rotating the triangle via the outer circle sets the hue and selecting inside the triangle and dragging the small white circle sets the shade.
Frontal
  • Check marking this locks the light source to the camera position. Unchecking this locks the light source to the location specified in the 'Position' group.

NOTE: Use this to get a better look at how your model will appear in the game.

Position
  • Sets the light source's position if 'Frontal' is unchecked.
Presets
  • Sunny Day: emulates the lighting effect of a sunny day.
  • Dark Night: emulates the lighting effect of night.

NOTE: Again, use these to get a better look at how your model will appear in the game.

Colors
  • Changes the render window background, foreground, and highlight color. Selecting and rotating the triangle via the outer circle sets the hue and selecting inside the triangle and dragging the small white circle sets the shade. The sliders will adjust the transparency of the foreground and highlight objects.

NOTE: Foreground will change the hue and transparency of your bones and scene root nodes.


Spells Menu

Spells are scripts used by NifSkope to perform various functions on your opened NIF file. They perform very useful and permanent (no undo button) changes which enable you to configure a NIF file for use by the GameBryo Game Engine. They will save you lots of time when editing/creating NIF files so it is important that you know what each of them do. We will now walk through each of these spells and explain their function:

Animation
  • Attach .KF: Attaches animations to the opened NIF file. More explanation needed.
Block
  • Insert: Allows you to insert a new Ni Block into the Block List.

NOTE: Remember: The new Ni Block will be fresh. Meaning it will not contain any command or instruction data. Copy and pasting Ni Blocks from another NIF is generally a better way to add new ones. Use sparingly.

  • Remove by ID: Removes all Ni Blocks that contain the specified suffix. [Example: ^NiBS will delete all Ni Blocks with the suffix 'NiBS']. This is primarily used to prepare NIF files for import into external editors like Blender.

NOTE: We will get into what Blender is later in this guide.

Optimize
  • Combine Properties: Combines Ni Block properties that contain the same Block Data. [Example: Two different NiTriShapes both contain the same material property. But each material property has a different Block number. Running this script will convert them to the same block number.
  • Split Properties: This spell is the opposite of Combine Properties. When run, it will assign a unique block number to each property regardless if they are the same.
  • Remove Bogus Nodes: This spell will remove NiNodes from your Block List that do not contain any Ni Blocks or Ni Data.
  • Strippify All TriShapes: This spell will convert all NiTriShape block to NiTriStrip blocks.

NOTE: This is a very useful spell when creating weapons as weapon shape data is contained in NiTriStrip blocks as opposed to NiTriShape blocks like armor.

Sanitize

NOTE: All of these spells will run automatically if the 'Auto Sanitize Before Save' selection under the file menu is check marked.

  • Adjust Link Arrays: This spell will reorder and removed empty links in your array data. Arrays [example: children] are data contained inside Ni blocks that list one or more links to other Ni blocks.
  • Adjust Texture Sources: Replaces / with \\ in texture paths and automatically sets texture format options for Oblivion NIF files. [Example Pixel Layout to 6, Use Mipmaps to 1, etc.]
  • Reorder Havok Blocks: This spell places imported or edited Havok blocks like collision data blocks to the correct hierarchy order.
  • Check Links: This spell checks the NIF file's data block links for errors. Then displays any resulting errors in a prompt window.
Batch
  • Make All Skin Partitions: This handy spell will automatically create NiSkinPartition blocks for all Ni shape blocks containing armature bones. NiSkinPartition blocks are found in NIF files containing movement transforming meshes like body parts, armor, and clothing.
  • Update All Tangent Spaces: This handy spell will automatically update/create all the 'Tangent space (binormal & tangent vectors)' extra data blocks.


NOTE: Skin partitions, armature bones, and tangent space blocks will be explained in more detail later in the guide. For now, just remember where these spells are located and what the spell will do to your NIF file.


About Menu

Use the about menu to check the version number of NifSkope and Qt.

Toolbar Buttons

Now we will focus our attention to the toolbar buttons. This section of the guide will explain what the command is for each button; rather then re-explain all the same functions we went through in the menu section.

Load Save
  • This toolbar has buttons to load and save your NIF file. It also displays the file path for each.
View
  • This toolbar allows you to quickly switch between render window views and walk mode.
Animation
  • Play Button: Plays the animation embedded in the NIF file. You will see the animation play in the render window.
  • Slider Bar: Allows you to quickly move to a specific time in the animation play cycle.
  • Loop Button: Toggles the animation play loop on/off. If on, the animation will continue to play until the play button is pressed again. Turn off to play the animation only once.
  • Switch Button: The button name implies that it switches the play slider between animations when multiple animations are present. Confirmation needed that this is correct - use discussion page please
  • Pull Down Menu: This menu implies that it shows a list of the current animations contained in the NIF file when multiple animations are present. Confirmation needed that this is correct - use discussion page please


Once you feel you have a general understanding of all the user interfaces, menu items, and toolbar buttons you are ready to proceed to the next section.

The Render Window

The render window is where your model is displayed in 3D space. The model is fixed on three axis: X, Y, and Z axis and the point where these three axis meet is X0,Y0,Z0 in 3D space. Each axis is assigned a color: X Red, Y Green, and Z Blue. Each axis also has an arrow head which points in the positive direction. All of this will be important when trying to debug the location of a model in the game environment.

Meshes & Textures

You should still have the battleaxe.nif file open. If not, open it now. You should see the 3D model of the iron battleaxe in the render window. Before we get into any more detailed information it's important that you understand what your actually looking at. The battleaxe you see is actually a hollow mesh with a texture map skinned over the top of it.

Below are links to great Wikipedia articles on Polygonal Meshes and Texture Maps. It's highly recommended that you read these articles to get a better understanding of these two concepts. So get yourself a beverage of choice, click on the links, and read. Continue on with the guide when your done.

Orientating the Model

You can orientate the model by either rotating, panning, or zooming. In this section we'll try each of these. We will also learn about selecting meshes in the render window, setting 'Save User View', and Walk Mode. Try each of these as we go through them.

The Basics

Zooming
  • Place your cursor over the render window and rotate your mouse's center scroll wheel to zoom in and out.
Panning
  • Place your cursor over the render window then press and hold down the center mouse button to pan the view.
Rotating
  • Place your cursor over the render window and then press and hold the left mouse button to rotate the view.

Save User View

This function allows you to save an orientation of the model so you can quickly return to it again later. Lets try it:

  • Orientate the model to your liking.
  • Click: Render menu -> Save User View

Now the current orientation of the model in the render window has been saved.

  • Press the Z Axis View (Blue - View from above) toolbar button on the toolbar.
  • Now press the Restore User View (Lt Gray - Restore..) toolbar button on the toolbar.

The model is now re-orientated back to the view that you saved!

NOTE: Get familiar with using the toolbars. They will save you time over using the menus. There are 'hot keys' for many commands in NifSkope. For example you can press CTRL+F9 to Save User View.

Selecting Meshes

You can select a model's mesh directly in the render window. This is useful when adding/editing models that contain more then one mesh since you can pick a specific mesh visually.

Our battleaxe is made up of two separate meshes: the handle and the blades. Place your mouse cursor over the render window and follow along.

  • Click on the blade portion of the battleaxe with your left mouse button.

Notice how the blades become outlined with white lines. The white lines are showing you the mesh beneath the texture map. Now look over to the Block List window and expand '0 NiNode Battleaxe'.

Notice how the 10 NiTriStrip Battleaxe:0 is highlighted. NifSkope has highlighted this section of the block list because you've selected it's associated mesh in the Render Window. Now go back to the Render Window and select the handle. The highlight moves to 16 NiTriStrip Battleaxe:1 because block #16 contains the data pertaining to the handle mesh.

  • Right click on the blades portion of the battleaxe model.

Not only does the highlight move back to block #10 but a menu appears. This is the 'Model Editing Menu'. For now, just remember how to open the menu. We'll get into more detail on this menu's options further in the guide.

Walk Mode

The primary use of this mode is to give the perception of 'walking' near to the model in the render window. When this mode is active you will no longer have the ability to rotate the model. The view will be fixed parallel to the perceived ground plane that will be present in the game environment. Meaning if the Z axis is up, your view will be locked on the Y axis plane. Lets try this:

  • Click: Render menu -> Settings... -> Up Axis, set this to Z.
  • Close the Render Settings menu.
  • Press the 'Enable Walk Mode' (Dk Gray) toolbar button.
  • Hold your mouse over the Render Window.
  • Press and hold the center mouse button to 'walk' the model around the viewport.
  • Press and hold the left mouse button to move the model around the viewport.
  • Rotate the center mouse wheel button to zoom in and out.

Notice how the model rotates as you walk around it. This gives the perception of being a fixed object in 3D space and is how the model will appear when a player is walking near your object in the game environment.

Try this example:

  • Click: Open on the toolbar menu
  • Go to: Data\meshes\architecture\skingrad
  • Open: skhousemiddle01.nif
  • Click: Render menu -> Settings... -> Frontal, uncheck
  • Position -> Declination: -80, Planar Angle: 45
  • Click: Presents -> Dark Night
  • Close the Render Settings Window.

Now place your mouse cursor over the render window and walk left and right across the model. This will give the perception of walking past this Skingrad house at the dead of night with the moon overhead.

Play around with orientating the model of this house using both 'Save User View' and Walk Mode. Proceed on with the guide when you're ready to continue.

Now lets get our render setting back to default:

  • Click: Render menu -> Settings... -> Check: Frontal
  • Click: Presents -> Sunny Day
  • Close the Render Settings Window.
  • Reopen your iron battleaxe model. [Data\meshes\weapons\iron\battleaxe.nif]

The Guide Continues On Here: NifSkope_Comprehensive_Guide_Section2

WORK IN PROGRESS. SEE DISCUSSION PAGE.