Difference between revisions of "Creating an armour for Skyrim. Part 2"

From Nexus Mods Wiki
Jump to: navigation, search
m (Adjust the armour after testing it in game)
Line 173: Line 173:
 
As the _0.nif and _1.nif files of the armour are exactly the same, you will see no changes when you move the weight slider for your character.
 
As the _0.nif and _1.nif files of the armour are exactly the same, you will see no changes when you move the weight slider for your character.
  
==== Adjust the armour after testing it in game ====
+
=== Adjust the armour after testing it in game ===
 
[[File:Armour_22_clipping.jpg|right|thumb|Clipping]]
 
[[File:Armour_22_clipping.jpg|right|thumb|Clipping]]
  

Revision as of 16:51, 14 January 2012

Overview

This is the part 2 of the tutorial for creating an armour or outfit for Skyrim. You can find the first part of the tutorial here Creating an armour for Skyrim. Part 1

Creating an armour for Skyrim

Create the _0.nif armour mesh

Cut parts of the body hidden by the armour

Cutting the hidden body parts

Once you've copied all the weights from the body to your armour and set the dismemberment vertext groups select the body in Object mode and go to Edit mode. In Edit mode select all the faces of the body that are completely hidden by the armour or outfit you are creating. Make sure that all the faces you are selecting are completely inside the armour because if you delete a face that is only partially hidden by the armour you'll see a hole in your character's body when using the armour.

This step is optional but it is worth doing it because:

  • you won't have to solve clipping problems because in almost no pose the body will go through the armour
  • the size of the mesh will be smaller, increasing performance
  • Bethesda does it ;)

Export the armour

Importing a new skeleton
Exporting the armour

Now you are ready to export your armour in nif format, that is the one Skyrim's meshes use.

First thing is to import a new skeleton for your armour:

  1. Make sure that on the Blender screen you see all the objects that form the armour, including the parts of the body that are not hidden by the armour, and that you don't see anything that is not going to form part of your armour (like the light or the camera. If you see those objects move them to another Blender layer and set that layer to invisible or Blender will export those objects toghether with your armour).
  2. Make sure that you have deleted all the skeletons you imported with the parts of the body, as explained at the beginning of this tutorial.
  3. In Object mode select one of the objects that form part of your armour and press the A key twice so as to select all objects of the armour.
  4. Select the menu option File -> Import -> NetImmerse/Gamebyro and select the _0.nif file of the body you imported before for creating the armour (for example the modified femabody_0.nif).
  5. In the screen that contains the importing parameters select the option Import Skeleton Only + Parent Selected as shown in picture Importing a new skeleton and press the OK button.

Now you have a skeleton in Blender and it is the parent of all the objects that form your armour.

To export the armour:

  1. In Object mode select the skeleton you've just imported and press A twice to select all parts of the armour and the skeleton.
  2. Press the Ctrl + A keys and select the option Scale and Rotation to ObData from the pop up menu.
  3. Keeping the skeleton and all the parts of your armour selected, select the menu option File -> Export -> NetImmerse/Gamebyro, enter the name of the nif file for your armour (for example MyArmour_0.nif) and the folder where you want to save it.
  4. Set the exporting parameters as shown in the picture Exporting the armour. It is important that the parameters are set like this:
    1. Fallout 3 -> selected
    2. Stripify geometries -> deselected
    3. Smoothen Inter-Object Seams -> selected
    4. Flatten Skin -> deselected
    5. Export Skin Partition -> selected
  5. Press the OK button and wait until Blender finishes saving the nif file.

Adjust the armour in Nifskope

Adjust the armour properties

Editting the NiHeader in NifSkope
Getting rid of the Scene Root node
Getting rid of the Scene Root node 2
Deleting unwanted nodes
Setting the properties of the body data
Adjusting the dismemberment data

As the modelling tools are not yet fully adapted to Skyrim, we need to do several adjustments in NifSkope before we can test the armour mesh in game. I am explaining the steps in the order I find it makes things faster and easier (after having done this more than 10 times for only one mesh, I think I've finally found the fastest way! :) )

  1. Load the mesh you've just created into NifSkope (for example MyArmour_0.nif)
  2. First of all, edit the NiHeader to make it compatible with Skyrim (this is the reverse step of what you did for being able to import Skyrim meshes into Blender):
    1. In the Block detais section, expand the NiHeader property as shown in picture Editting the NiHeader in NifSkope
    2. You'll see that the User version property has a value of 11. Double click on the 11 and then change it to 12.
    3. Then go to the User version 2 property, that has a value of 34. Double click on the 34 and then change it to 83.
  3. Next thing is to get rid of the Scene Root node that Blender has exported with the armour:
    1. Expand the Scene Root node as shown in picture Getting rid of the Scene Root node.
    2. Browse down the Block details section until you see the Children property.
    3. Expand the Children property. You'll see it contains the node of the armour (in the picture, the 1-bbe2femalebody_0 node). Double clik on the number of this node and delete it, so the Children property points to None.
    4. Now you'll see something like what is shown in picture Getting rid of the Scene Root node 2: the bbe2femalebody_0 is not under the Scene Root node anymore.
    5. Select the Scene Root node and press Ctrl + Del or right click and select Block -> Remove Branch.
  4. Save the nif file.

Now you are ready for the second batch of adjustments:

  1. Load the nif file again in NifSkope.
  2. You'll see that some new nodes appear just below the armour node (bbe2femalebody_0 in the example) as shown in picture Deleting unwanted nodes. These nodes correspond to properties that are not compatible with the nif version used by Skyrim, so you have to delete them.
    1. Select the first one (BSShaderPPLightingProperty in the picture) and press Ctrl + Del or right click and select Block -> Remove Branch.
    2. Do the same with all the other nodes (NiSpecularProperty, NiMaterialProperty, etc) until you only see the armour node (bbe2femalebody_0 in the example).
    3. Save the nif file (this is not strictly required but is a good practive to save often just in case).
  3. Expand the root Ninode (bbe2femalebody_0 in the example) as shown in picture Setting the properties of the body data.
  4. Expand the node that contains the body parts that are shown by the armour (the newBBE_1_noweight in the picture).
  5. Select the NiTriShapeData node of the body parts.
  6. Browse down in its Block details until you see the Num UV sets and the Has Normals properties:
    1. The Num UV sets will have a value of 4097. Double click on the 4097 and change its value to 1.
    2. The Has Normals property will have a value of yes. Double click on the yes and change it to no.
    Note: You only have to edit these properties for the body nodes. They are fine as they are for the armour/clothing nodes.
  7. Select the BSDismemberSkinInstance node of one of the NiTriShape nodes of your armour as shown in picture Adjusting the dismemberment data.
  8. In the Block details section expand the Partitions property.
  9. Expand the second Partitions property.
    1. Make sure that the Part Flag property has bloth flags selected: PF_EDITOR_VISIBLE and PF_START_NET_BONESET. If not, double click and select both flags from the drop down list.
    2. The Body Part property will contain one or more of the body parts ypu've created in Blender (BP_TORSO, BP_LEFTLEG or BP_RIGHTARM). Double click on these values and change them to:
    3. From BP_TORSO to 32
    4. From BP_RIGHTARM to 34
    5. From BP_LEFTLEG to 37
  10. Repeat this steps for all the BSDismemberSkinInstance nodes of all the NiTriShape nodes of your armour.
  11. Save the nif file.

Add materials and textures

Adding a BSLightingShaderProperty node
Moving the BSLightingShaderProperty node to its right position
Moving the BSShaderTextureSet node to its right position
BSLightingShaderProperty settings for the body
BSLightingShaderProperty settings for the armour
BSShaderTextureSet block details
Texture files for the body
Texture files for the armour
Adding transparency

The next step consists in adding materials and textures to all the NiTriShape nodes that form your amour. To do that:

  1. Load the nif in NifSkope
  2. Select one of the NiTriShapes, for example the newBBE_1_noweight in the example nif)
  3. Right click and select Block -> Insert from the menu
  4. A new menu will pop-up. Select Bethesda -> BSLightingShaderProperty. This will add a new node at the end of your nif file.
  5. Select the NiTriShape node but it is not under the NiTriShape node, as shown in picture Adding a BSLightingProperty node. To correct this:
    1. Note down the number of the new node you've just added (2 in the example picture)
    2. Select the NiTriShape node again and browse down in the Block Details until you see the Properties property as shown in picture Moving the BSLightingShaderProperty node to its right position.
    3. Expand the Properties and in the first value change the None to the number of the node you've added (2 in the example). Now the BSLightingShaderProperty node has moved and is shown under the NiTriShape node.
  6. Select the BSLightingShaderProperty node, right click and select Block -> Insert.
  7. A new menu will pop-up. Select Bethesda -> BSShaderTextureSet. This will add a new node at the end of your nif file. To correct this:
    1. Note down the number of the new node you've just added (3, for example)
    2. Select the BSLightingShaderProperty
    3. Browse down the Block details sections until you see the Texture Set property and change its None value to the number of the BSShaderTextureSet node (3, in the example). This will move the new node under the BSLightingShaderProperty node.
  8. Repeat these steps for all the NiTriShapes that form your armour, adding to them a BSLightingShaderProperty and a BSShaderTextureSet nodes.

The next step consists in setting the right properties for the BSLightingShaderProperty nodes you've just added.

  1. Select the BSLightingShaderProperty node you are going to edit.
  2. Set its properties in the block details:
    1. Picture BSLightingShaderProperty settings for the body shows the settings for all the properties that are used for the body nodes (the parts of the armour where the body is shown).
    2. Picture BSLightingShaderProperty settings for the armour shows the settings I've used for all the properties that are used for the armour nodes.
  3. Repeat this for all the BSLightingShaderProperty nodes of all the NiTriShape nodes that form your armour.

The last step is to add the textures to your armour:

  1. Expand the BSLightingShaderProperty node.
  2. Select the BSShaderTextureSet.
  3. In the Block detils section you'll see that the Num Textures properties is set to 6 as shown in picture BSShaderTextureSet block details. Skyrim uses 9 textures so you will have to fix that:
    1. Double click on the 6 and change it to 9.
    2. Right click on the purple flower of the Textures property and select Array -> Update. Now you will have 9 lines to add textures.
  4. Expand the Textures properties and associate the texture files you created previously in GIMP:
    1. Picture Texture files for the body shows the texture files associated to the body (the parts of the armour that show the skin).
    2. Picture Texture files for the armour shows the texture files associated to the armour.
    3. Repeat this for all the BSShaderTextureSet nodes.
  5. Save the nif file.

It is important that each texture type goes to the right place. The top one has to be the diffuse map (the colour), the second one the normal map.

Check that the texture files begin like this: textures\... as shown in the Texture files for the armour image. If the links to the files begin like C:\Program files\Steam\SteamApps\Common\Skyrim\Data\textures\..., or \textures\... the game may not be able to upload them and you'll see the armour black, purple or invisible.

Apply the textures on both sides of the mesh

Some armour or outfit meshes are made by flat surfaces, and then, if the textures are only applied to the top of the surface, the cloth will be invisible in game when viewed from some angles (for example, the inner part of some skirts will be invisible).

You can tell the mesh to apply the texture on both sides to fix this problem. To do this:

  1. Select the BSLightingShaderProperty of the NiTriShape where you want to apply the texture to both sides.
  2. In the Block details section look for the Shader Flags 2 property.
  3. Select the SF_Double_Sided flag as shown in picture BSLightingShaderProperty settings for the armour.

Add transparency

You may need to have a part of the mesh transparent or semitransparent. To do that:

  1. Select the NiTriShape node that contains your mesh and right click on it
  2. Select Block -> Insert from the pop up menu
  3. Select NiA... from the drop down list and then select NiAlphaProperty.
  4. The new node will be added at the end of the nif file. To place it in its right possition:
    1. Note down the number of the new node you've just added (29, for example)
    2. Select the NiTriShape node again and browse down in the Block Details until you see the Properties property as shown in picture Moving the BSLightingShaderProperty node to its right position.
    3. Expand the Properties and in the second row value change the None to the number of the node you've added (29 in the example). Now the NiAlphaProperty node has moved and is shown under the NiTriShape node as shown in picture Adding transparency.

Select the NiAlphaProperty node you've just add and in Block Details look for the Flags parameter and set it to a the value that makes the armour look better in game. Some values that work:

  • Flags = 4844, Threshold = 127: this works for ENB series but in some lighting conditions produces some artifacts.
  • Flags = 4845, Threshold = 0: this seems to work fine in most cases.

Once you've modified all these parameters, save the nif file of your armour.

Add the armour to the game

As the CK has not been released yet, I am going to explain here how to add the armour as a replacer of an existing one. You have to name your mesh like the one in game that you want to replace, and place it under the same folder where the vanilla mesh is. You can use SripterRon's FO3 Archive Utility to look at the name of the nif files and folders used in game. For example, for making a replacer of the wedding dress:

  • place the nif file in the folder Data\meshes\clothes\weddingdress\
  • rename your nif file to outfit_0.nif
  • make a copy of your nif file and rename it to outfit_1.nif.

We are going to test first the _0.nif armour mesh. When it works perfectly in game, we will create the mesh for the _1 body. As the _0.nif and _1.nif files of the armour are exactly the same, you will see no changes when you move the weight slider for your character.

Adjust the armour after testing it in game

Clipping

Test your armour in game. Test it with your character in several poses: standing up, holding a weapon, walking, running, etc.

Most likely in some poses you will see parts of the body clipping throught the armour, as shown in picture Clipping.

If this only happens in some unusual poses, like some added by mods, you can leave your armour as it is. But if this happens in usual poses in game you'll have to work a little more on your armour to eliminate this clipping effect.

Load your armour into Blender again and in the areas where the body clips through the armour try some of the following methods:

  • move the vertices out, separating them from the body. After doing this take a look at your armour's shape in those areas and, if it has deformed too much, move the surrounding vertices to fix the shape.
  • cut the parts of the body that are under the armour in those areas, if it is possible to cut them without leaving holes in parts that are not covered by the armour.
  • if you cannot fix the clipping issues with any of the two previous methods you will probably have to slightly modify the weights of those areas. Try different weights until you find out what works better.

Repeat the testing and fixing process until the armour works fine in game and you'll be done with the _0.nif.

References