NifSkope Alchemy
This article has been marked by editors as one needing attention. Please see the Talk page for details. If you can update the article, please do so.
I'd like to start by saying this is more of a resource guide than a tutorial. And it is probably not much of a newbie guide. This is a guide showcasing the various tidbits using NifSkope we've discovered at the TES4 forums. All information given is learned and therefore subject to be quite wrong and/or incomplete.
I will cover the basics of importing and exporting meshes, but not problems and guidelines for this. That is a whole subject by itself.
At the time of this writing, NifSkope is at v0.8.2 and there is no official Exporter for Nif files available from Bethesda yet. What we can do, is change textures, swap out models and materials, add new effects to our nif files, and a few other tricks.
The NifTools team has kindly produced said NifSkope and is available at their webpage here.
The BSA unpacker by Ghostwheel is available here.
If you don't have it already, nVidia's .DDS plugin for photoshop (and apparently PaintShop) is available here.
So, you've unpacked your BSA Files. You know the basics of retexturing, and you have a fairly good grasp of how normal maps work. You've taken a gander as to how NifSkope works, and know that you can replace or modify the data given in a .nif file, but aren't sure where to start? Or, none of the above, in which case you might be reading the wrong guide :)
Let's rock.
I'll be using a pretend example of Meshes\mine\Sword.nif.
Base Textures[edit | edit source]
To start with textures, it is important to note that NifSkope needs to be configured properly. Since the 0.9.4 version you can have NifSkope do this automatically. Go to the Render menu >Settings. Push the Oblivion button in the Auto Detect field. The correct Oblivion Data folder path should appear in the Custom field. You can find more information of this feature at the Setting the Texture Search Path article of the niftools.sourceforge.net site. If you use an earlier version: Go to the Spells menu >Textures>Folders. Select Oblivion's Data\ folder. Not the textures folder, this spell sets Data\ as the base folder, and will fill in the correct path when you select a new texture file. NifSkope will use /'s instead of \'s in the path. This will only cause problems if you are referencing a texture from within the Oblivion .bsa files. Onward!
Nearly every nif has two texture files associated, stored in the dds format. The color map, and the Normal Map. Say, Sword.dds and Sword_n.dds. When you assign the Sword.dds, the Oblivion engine automatically seeks out Sword_n.dds.
If your filename has extra underscores in it, there will likely be problems, so: No Underscores. The only time to use underscores is the scenario where you are sharing a common normal map. If you have 3 glass swords that are identical except in color, you could share the same normal map by using an underscore in the name such as GlassSword_Red.dds, GlassSword_Green.dds, GlassSword_Blue.dds and the game engine will search for GlassSword_n.dds for each one...thus sharing the same normal map.
In the color map, the Alpha channel should be white, unless you are using transparency, then Black is transparent, and white is opaque. I will touch on how to enable Transparency later. For the normal map, the alpha channel controls the amount of specularity on the mesh, again, black=not shiny, White=Shiny.
Textures get changed like this:
+NiNode -+NiTriShape --+NiTexturingProperty ---+NiSourceTexture @ textures\weapons\mine\sword.dds
There's a little flower icon place of the @. Click on it to navigate to a new texture, and click open to assign a new texture. There's a few hitches here we've discovered: Sometimes Nifksope does funny things with the path, \'s and /'s here. If your mesh doesn't show up in-game, or is black or pink, try this:
Under the NiSourceTexture node, check +Texture Source in the Block Details view. It reads out thusly:
File Name | filepath | @ weapons/mine/sword.dds
This happens now and again, and it's incorrect. Double-click on the texture path to enter an edit mode, click on the text again to enter text edit mode. It should read: textures\weapons\mine\sword.dds.
Exporting a .TGA template of the UV mapping for the mesh can be done by:
- Right clicking on NITriStrips, Texture>Export Template.
- The default options should be good in most cases, you may want to bump up the texture size.
- Click the File button to Save to a location, and hit Save.
Glow Maps[edit | edit source]
Some nifs use Glow maps, and look like: Sword_g.dds. Much like the normal map setup, the engine automatically seeks out the _g.dds. They control how the material is affected by darkness. By default, Oblivion's engine will fade a texture to gray as it moves into darkness. The glow map can override that. Take a look at glass armor for an example. Looking at Sword_g.dds in photoshop, we see a graysale image. Black means not affected, and white is fully lit when in complete darkness. There is an alpha channel, but I haven't noticed it doing anything in my tests.
Another neat trick here, is to make a colored glow map. For example, black fading into an intense red. Now, you will see that as displayed in the light there is no red. When in the darkness, You will see the red, and how it fades out.
Say you retextured a chainmail cuirass, but want to use a glow map?
All you need is the glow map file in the correct folder with the correct name and a white emissive color.
The first thing to do is make sure your glow map is named with _g at the end. So if your texture file is 'Sword.dds', then your glowmap would be 'Sword_g.dds'.
Now, go to the NiMaterialProperty in NifSkope and click on the palette icon. Move the Emissive slider to White, and save.
You should now have a working glow map.
You can also assign a glow map in NifSkope. I know of a couple Oblivion nifs that have done this, and it doesn't seem to cause problems. Right click the NiTexturingProperty, and select Texture>Add Glow map. This method is really only good for seeing what you are doing in NifSkope, and only serves to make your nif a little bit bigger in filesize. But it can be handy to see what you are doing, if you need a reference while you are working on your textures.
Hair[edit | edit source]
Hair is a special case. Looking at Style01.nif, we see it references grey.dds. This is accompanied by grey_hh, grey_hl and grey_n. The color and normal maps work as usual. I haven't done real serious testing, but grey_hl seems to work for low-lights and extra color when changing hair color in the race menu. And I can't get grey_hh to do anything at all. But again, I haven't played much with them. I hope to get this section corrected.
Material Node[edit | edit source]
I don't have much to say for this one. You hit the palette button to change the lighting for your mesh, adjust the alpha and glossiness. :D
The name of material is used in Oblivion in some special cases at least. Marking material as 'skin' (lower case only) lets Oblivion know it should apply any skin-only shaders to it. Marking material as 'Hair' is important for Oblivion to apply the glossy hair rendering it uses.
Adding Property Nodes[edit | edit source]
Right clicking on a NiTriStrips node lets you attach new property nodes used for effects.
NiAlphaProperty - Allows for transparency, which is controlled by the Alpha channel of the color map. Hit the flag icon in Block details to see your options. NifSkope 0.8.1 has a problem here with Oblivion nifs, however. If you hit the flag/options, and the mesh shows up black in-game where it should be transparent, here's the fix for now:
- Double-click on the binary number next to the flag, and click again to enter text edit.
- Erase what is there, and type in 237, and hit enter. These are the same flags set, but without the extra digits in front. Now transparency works fine!
- 237= Enable Blending On, Src Alpha, Inv Src Alpha.
- 4845= Enable Blending On, Src Alpha, Inv Src Alpha, Enable Testing, Greater, 0,
- Sort Triangles. This seemed to help in some instances, but I'm not sure why.
- 4333= Enable Blending On, Src Alpha, Inv Src Alpha, Sort Triangles. This was found on the blood decals, and Stalagtites for cave pieces. *shrug*
- 4109= Enable Blending On, Src Alpha, One, Sort Triangles. Found on effects like cave fog or lightbeams.
NiStencilProperty is a z-buffer effect. Best used along with transparency and red wine. This is most useful for hair that only has one side. Bethesda meshes use two sets of polygons against each other for the flat parts of hair. I don't know much about the it's functions, but I've found it's usually set up like this:
Set Stencil Function to 4, Pass Action to 3, and Draw mode to 3.
There are other Property Nodes, but none of them really warrant enough attention for this guide. Feel free to play with them at your leisure!
Material Switching[edit | edit source]
For most clothes and some armors, the body parts are modeled in. If you wanted to switch part of the clothes to have the skin material on them, for example, try this:
Select NiTriShape, and expand Properties>Indices in block details. One is for texture, the other is for material. Change the index number reference to the index number of the other material used in the mesh.
If your mesh doesn't have skin on it, all you need to do is point the texture to the base skin textures in the textures\characters\imperial\ folder. In-game, the engine will adjust the skin tone and race to it's actor, just like normal.
There are 5(?) different shaders used in Oblivion, and it's easy to change which one your mesh uses:
Select NiTexturingProperty, and look down to the block details. Apply Mode is where it's at! Double click the Apply mode number, click again to enter text edit, change the number, and hit enter.
Here's my findings: 0: Probably not used. In my tests, it freaks out half the time on the alpha channel. 1: Doesn't seem to be used? It seems to work the same as #2. 2: The material most everything uses. 3: Is the glossy effect seen on glass. It also adds a reflection map, found in Textures\Effects\Reflection.dds. 4: Is the Parallax effect, whos effect is controlled by the color map's Alpha. It's only found on cave pieces and the CharGen Prison. Pretty processor intensive.
Mesh Switching[edit | edit source]
It is possible in most instances to copy and paste various bits from nif to nif. Meshes, for example.
Open the nif you want to copy a part from. I used \meshes\clothes\upperclass\01\f\shirt.nif.
Right click on the torso piece's NiTriShape, and select Block>Copy Branch. Now open another file, I used meshes\armor\ebony\f\cuirass.nif. Right click on the root- 0 NiNode and select Block>Paste Branch. The shirt's mesh shows up, and is a root node, not good. Make a note of the Node Number for this paste-job we just did.
Highlight 0 NiNode, expand Children>Indices. Double click index 1 (UpperBody), and click again to enter text edit mode, and change it to reflect the number of the index we just pasted in, and hit enter.
The shirt mesh is now in place of the previous ebony mesh on the heirarchy, and the ebony torso mesh got tossed out. All that's left is to delete that ebony torso node, and it's children (you psycho.)
Using this method is useful for switching many node types. Property Nodes go under Properties, meshes and NiNodes go under Children, and Extra Data for those special Extra Datas you know and love.