Difference between revisions of "Arcane University:Mesh Export to NIF"

The Beyond Skyrim Wiki — Hosted by UESP
Jump to: navigation, search
(General NIF structure)
(PyNifly)
 
(62 intermediate revisions by 5 users not shown)
Line 1: Line 1:
Meshes can be exported by the following applications:
+
{{Trail|3D Art}}[[Category:Arcane University-3D Art-Mesh Export to NIF| ]]
 +
In order for your mesh to be used in Skyrim, it must be in [[AU:NIF Data Format|.nif]] format. There are several ways to do this, depending on what 3D software you use.
  
* Blender export plugin (Version 2.69 and 2.7x)
+
* Any 3D programs (see requirements)
* 3DS MAX export plugin (Versions xxx)
+
** CK-CMD
* CK-CMD
+
** Outfit Studio
 +
* Blender
 +
** Blender Niftools Addon
 +
** PyNifly
 +
* 3DS MAX
 +
** 3DS Max Nif Plugin
  
 +
A number of these methods do not directly support Special Edition nifs. However, this can be circumvented using [https://www.nexusmods.com/skyrimspecialedition/mods/4089/ SSE Nif Optimizer] or [https://www.nexusmods.com/skyrimspecialedition/mods/23316 Cathedral Assets Optimizer], both of which can convert LE meshes to SE format and the other way around.
  
== General NIF structure ==
+
== CK-CMD ==
 +
[[AU:CK-CMD for Skyrim|CK-CMD]] is an independent command-line software you can use to, among many other things, convert FBX files to NIF and the other way around. You can download it on its [https://github.com/aerisarn/ck-cmd GitHub page]. The advantage of this method is that it allows for exporting for any 3D program that can export to FBX. Limitations: Does not directly support SE nif files.
  
BSShaderProperties and BSTextureSet
+
== Outfit Studio ==
NIF (Netimmerse Gamebryo) files in Skyrim are the files that hold the 3D Model information necessary to display objects in the game. When you open a NIF file in NifSkope, every NiTriShape represents a 3D Object instance. A single NIF file can have multiple instances of these and they can reside under various parent nodes.
+
The process for exporting using Outfit Studio is documented on [[AU:Outfit Studio Export|Outfit Studio Export]]. The advantage of this method is that it allows for exporting for any 3D program which can export to OBJ. The disadvantage is that you have to work with intermediate files, which makes it harder to quickly test out small edits in-game. Limitations: The OBJ format cannot store vertex weights or vertex colors, so any rigging will need to be done within Outfit Studio.
A NiTriShape can have the following child properties among others:
 
● NiTriShapeData is the actual mesh.
 
● BSDismemberSkinInstance is the information necessary to handle limbs being dismembered from the base mesh. Those nodes hold all skinning/rigging data. They tell the mesh how to deform during animation
 
● BSLightingShaderProperty holds lighting and texture information.
 
● NiAlphaProperty tells the game how to handle transparency in the mesh.
 
Nifskope Gamebryo NIF branch hierarchy example (object window):
 
1.1. Bethesda
 
  
[[File:branches1.PNG]]
+
== Blender Niftools Addon ==
 +
You can export directly from Blender using the [[AU:Blender Niftools Addon|Blender Niftools Addon]]. Which version you should use (and how you export) depends on which version of Blender you are using. It allows for directly exporting from Blender to a full NIF, but you will need to merge the created NIF with separately created collision using [[AU:Niftools/Chunkmerge for Skyrim|ChunkMerge]]. The advantage of this method is that you do not need any intermediate files and can export directly from Blender. Limitations: No collision handling, and does not directly support SE nif files. Both of these limitations can be handled with workarounds.
  
== Setting up the Nif-specific collisions and physical properties (mass center, material data, inventory marker, nif cleaning) ==
+
=== Blender 2.7x ===
 +
The process for direct export from Blender 2.7x is documented on [[AU:Blender 2.7x Export|Blender 2.7x Export]].
  
== Setting up the Nif-specific shader properties and texture sets==
+
=== Blender 2.8+ ===
 +
The process for direct export from Blender 2.8 or up is documented on [[AU:Blender 2.8+ Export|Blender 2.8+ Export]].
  
=== Shader Types ===
+
== PyNifly ==
 +
[[AU:PyNifly for Skyrim|PyNifly]], like the Blender Niftools Addon, allows for direct import/export of nif files. Unlike the Blender Niftools Addon, it has support for SE nif files and handles simple collisions (non-MOPP).
  
* '''Default Shader'''
+
== 3DS MAX Nif Plugin ==
 +
The process for direct export from 3DS MAX export using especially made plugin is documented on [[AU:3DS MAX Export|3DS MAX Export]]. It allows for direct export from 3DS MAX to a full NIF. The advantage of this method is that you do not need any intermediate files and can export directly from 3DS MAX. The disadvantage is that it does not work for every version of 3DS MAX, and will therefore need to be updated when updating 3DS MAX. Limitations: Does not directly support SE nif files.
  
* '''Environmental Shader'''
+
== See Also ==
[[File:shader1.png]]
+
* To review the specifics of the NIF data format used for meshes, check [[Arcane_University:NIF Data Format|Nif Data Format]].
 +
* To review the specifics of the DDS data format used for textures, check [[Arcane_University:DDS Data Format|DDS Data Format]].
  
General Structure of a Mesh
+
[[Category:Arcane University-3D Art| ]] [[Category:Arcane University-Method| ]]
 
 
 
 
Make sure, that you visualize it as tree diagram.
 
 
 
 
 
Note that there is a hierarchical order, similar to shoulder -> arm -> hand -> finger.
 
In theory, your mesh could be sorted differently, but most meshes look like this. If you see slight variations, don’t worry too much,
 
the system behind is the same.
 
 
 
The top level is most commonly a BSFadeNode (static bodies) or a Ninode (Skinned rigged meshes) or a BSLeafAnim/tree node (plants).
 
The BSX Flag below is for activating the collision. The bhkCollision object is the mesh of the collision.
 
 
 
The first sublevel has the Nitrishape, which is the “body” of the mesh. There can be as many as you want.
 
 
 
Each Nitrishape then has a second sublevel, which contains a NirtiShape Data tab and the LightingShaderProperty.
 
This is where we set up the way the mesh is rendered. Here, we set the shader type and the shader flags and controllers.
 
 
 
If you double click on the BSLightingshaderProperty, you find the third sublevel, the TextureSet, which contains your texture slots.
 
For detailed information on DDS formate texture files, please click here.
 
For detailed information on texture sets/texture slots of shaders, click here.
 
 
 
 
 
Meshes can be rendered in Skyrim according to their BSLightingShaderProperty (this article) or the BSEffectProperty (more here).
 
 
 
Most commonly used BSLightingShaderProperties are Default shader type (“0”) and Environment Map shader type (“1”).
 
You set your mesh shader property type in BSLightingshaderproperties. Note that each Nitrishape can only have one shader type and a small range of optional shader flags and use specific controllers(see below).
 
 
 
But, if needed, you can simply use multiple Nitrishapes combined on top of each other. As an example, it might make sense to split your mesh into subsections by material (metal, leather) and export each as a different Nitrishape (first sublevel) into the same mesh. Consider a leather armor for instance. I would suggest having an organic leather/cloth part (which usually absorbs light to a high degree and would use the default shader type) and the metal elements (which would reflect light stronger and profit from cube maps used in the environment map shader type).
 
 
 
 
 
Available Shader Flags, Controller Settings, and Texture Slots
 
 
 
BSLightingShaderProperty Shader Types
 
BSShaderFlags
 
Controller Settings
 
BSTextureSets
 
They have their own unique requirements. They need specific Texture Slots to be filled, depending on their character.
 
 
 
 
 
 
 
Most Common Shader Types
 
 
 
Default (0) Shader Type
 
Default Shader Type
 
 
 
use:
 
Assets with color, height, and specularity.
 
common examples:
 
rocks, clothes, furniture, stones, plants, sometimes metals if specularity is done in a way that can pretend metallic reflections.
 
necessary slots:
 
1) base color/diffuse map
 
2) normal map with specularity in alpha channel (optional)
 
necessary flags:
 
those who are marked green above under shader flags, for export; and additionally what you need
 
(vertex paint, specularity for example, if you learned how to apply these)
 
 
 
Example picture above, and shader settings of another example below.
 
 
 
 
 
The textures: 1) diffuse (base color) in slot 1, and 2) normal map with optional specularity in the alpha channel in slot 2 of the BSTextureSet.
 
 
 
 
 
 
 
Environment Map (1) Shader Type
 
Comment regarding Parallax shaders
 
 
 
=== Texture Types ===
 
 
 
[[Category:Arcane_University]]
 

Latest revision as of 20:19, 11 July 2022

< Arcane University:3D Art

In order for your mesh to be used in Skyrim, it must be in .nif format. There are several ways to do this, depending on what 3D software you use.

  • Any 3D programs (see requirements)
    • CK-CMD
    • Outfit Studio
  • Blender
    • Blender Niftools Addon
    • PyNifly
  • 3DS MAX
    • 3DS Max Nif Plugin

A number of these methods do not directly support Special Edition nifs. However, this can be circumvented using SSE Nif Optimizer or Cathedral Assets Optimizer, both of which can convert LE meshes to SE format and the other way around.

CK-CMD[edit]

CK-CMD is an independent command-line software you can use to, among many other things, convert FBX files to NIF and the other way around. You can download it on its GitHub page. The advantage of this method is that it allows for exporting for any 3D program that can export to FBX. Limitations: Does not directly support SE nif files.

Outfit Studio[edit]

The process for exporting using Outfit Studio is documented on Outfit Studio Export. The advantage of this method is that it allows for exporting for any 3D program which can export to OBJ. The disadvantage is that you have to work with intermediate files, which makes it harder to quickly test out small edits in-game. Limitations: The OBJ format cannot store vertex weights or vertex colors, so any rigging will need to be done within Outfit Studio.

Blender Niftools Addon[edit]

You can export directly from Blender using the Blender Niftools Addon. Which version you should use (and how you export) depends on which version of Blender you are using. It allows for directly exporting from Blender to a full NIF, but you will need to merge the created NIF with separately created collision using ChunkMerge. The advantage of this method is that you do not need any intermediate files and can export directly from Blender. Limitations: No collision handling, and does not directly support SE nif files. Both of these limitations can be handled with workarounds.

Blender 2.7x[edit]

The process for direct export from Blender 2.7x is documented on Blender 2.7x Export.

Blender 2.8+[edit]

The process for direct export from Blender 2.8 or up is documented on Blender 2.8+ Export.

PyNifly[edit]

PyNifly, like the Blender Niftools Addon, allows for direct import/export of nif files. Unlike the Blender Niftools Addon, it has support for SE nif files and handles simple collisions (non-MOPP).

3DS MAX Nif Plugin[edit]

The process for direct export from 3DS MAX export using especially made plugin is documented on 3DS MAX Export. It allows for direct export from 3DS MAX to a full NIF. The advantage of this method is that you do not need any intermediate files and can export directly from 3DS MAX. The disadvantage is that it does not work for every version of 3DS MAX, and will therefore need to be updated when updating 3DS MAX. Limitations: Does not directly support SE nif files.

See Also[edit]

  • To review the specifics of the NIF data format used for meshes, check Nif Data Format.
  • To review the specifics of the DDS data format used for textures, check DDS Data Format.