Blender 2.7+ Nif Exporter Tutorial


63 posts in this topic

Posted (edited)

This tutorial will cover the basics of exporting statics from Blender 2.7+ to a Skyrim .nif as well as explain what does what when it comes to exporting. Depending on how you work, you may find this easier than the old 'exporting via 2.49b' method. I believe this method takes a little more work to get set up, but once it is you can export directly to Skyrim with as little messing around in NifSkope as possible, allowing you to quickly test small changes to your static models with little hassle. I will assume you have a basic knowledge of Blender, and I will only be covering the Blender to .nif exporting for static models with collisions. I will not be covering loading these models/placing them into the Creation Kit, nor any modelling techniques.

UPDATE:

Still haven't had a chance to review the issues that are in the tutorial. Been busy with implementing bug fixes(weird situation) and getting them through the review process. The review process generally a large amount of time to iterate through to a full & final solution, (coding, writing tests and documentation) to the level of quality that we are now aiming for. What has been happening in generally what happens is the bugs are worked on concurrently, while the first is in review, the next is being having an initial implementation. So its kinda been a bit of a cycle of fixes in for review, coding more, the result being builds not getting created.

I still believe that setting the bar high to ensure quality is the right thing to do, as we sift through years maintainance. But in most of the cases for users interested in using the plugin at the moment, are willing to just get their hands on it and in most cases the initial implementation is "good enough" to work through their problem. This tutorial reflects that.

So what I am trying out is a new branch which will be used to make builds available all the time. This branch is basically a dump of all the latest fixes that are under review, with no guarantee of quality. We will also try and get more frequent development build created. 

TLDR; all builds are going to be made available via - https://github.com/niftools/blender_nif_plugin/releases

The next thing is feedback, everything from usability to bugs - we encourage people first and foremost to drop by the IRC - www.niftools.org/chat.html (no registration required) for a chat about your issues.

  • If there are issues with the in-progress bug fixes, those can be addressed immediately as part of the open issues.
  • If new issues are found and are features we want to support as part of they current milestone (see below), then they will be prioirtised first - (current milestone focus, object, textures & materials)
  • If issues are found, out of scope, (eg, armature support) they will be prioritised as part the corresponding milestone in the roadmap.

This is the backlog of issues, - https://github.com/niftools/blender_nif_plugin/milestones
Each milestone has a "theme" of feature support as some new feature were added ad-hoc, which is any of the latest bug fixes generally are easy to fix, but the full solution requires re-implement entire features. That said, the roadmap is flexible as we want to meet user needs.

\Neo
 

 

Getting Started

To export your models, you will require:

  • The Blender 2.7+ Nif Exporter by Ghostwalker71. His NifTools forum thread can be found here and the link to his plugin is in his signature. The NifTools team has since released a newer version which remains mostly the same with a few changes. I've covered those changes in this post.
  • NifSkope. The most recent release is 2.0 Pre-Alpha 6, a link to it is on the NifTools forums here.
  • NifUtilSuite. Once again, the NifTools forum thread is here.
  • You will also require Blender 2.7+, the most recent version, as well as previous versions can be found on the Blender website.
  • You will also need a .nif file to use as a template when using ChunkMerge.

Once you have the appropriate files downloaded, install them all, all of the links above should have a readme file somewhere regarding each program.

Preparing in Blender

Depending on how you choose to model, you can do this as you go or at the end as one whole process, and it doesn't matter which order you do these steps as long as they are all completed before you try to export. I recommend modelling in Blender units so you do not have to scale your model upon exporting, as 1 Blender unit is equal to 1 Skyrim unit. The reason for this is that if you are creating a tiling object, scaling on exporting will most likely put out your measurements by the slightest values and cause visible breaks and seams.

Once all of your modelling work is complete, you need to make sure to apply all of your transformations. If you don't this can cause some issues once it is in-game. To apply all of your transformations, press 'A' to select all and then press 'Ctrl + A' and select Rotation and Scale. In the left toolbar you will also need to select location.After all of the transformations are applied to my completed model, I need to make sure that it is UV unwrapped just like you would with any other model.Once your model is UV mapped and had all of it's transformations applied, I will start going into detail about the Nif related requirements. In the Properties editor (by default on the right) select the Object tab. large.object.jpg.00d2f4d23cff763d33c2d1c This is where you set the properties of the objects you are trying to export into NiTriShapes. Please keep in mind that if you have more than one object in the scene, you will need to edit the object properties for all of those objects individually for all of the following steps. For Skyrim, the settings you will require are:

large.2.jpg.a650929122214f05180e81179147

Update: The newer version of the exporter looks a little different, but the settings are all the same. The Nif Version and User Versions have been moved to Scene Properties. If you don't know where that is, look at this post.

Once they are selected, you will need to select a shader type. For Skyrim statics we usually choose BS Lighting Shader Property. You must select one. Or else your entire export will fail. A generic static nif will need these shader flags selected:

large.3.jpg.4cac81cd083fc41b3016df59425flarge.4.jpg.40522a94b4e485b52a82a20fe284

That is all you need to do in the Object Properties tab. I usually move on to the Materials Properties, it looks like a checkered sphere. large.material.jpg.2a7a21f996f62daa699cf For more information on how the object properties and your nif properties are linked, see Overview of Plugin Options

If you have not done so throughout your modelling process, you will need to create a material for each object. You can only have one material per object or your export will fail. So create a new material and play around with some of the settings. There are some Nif settings down the bottom, but they don't need to be changed in this tutorial. For more information on how the material settings and your nif settings are linked, see Overview of Plugin Options & Material Settings

Now I go to the Texture tab, which looks like a checkered square, by default it is on the right of the Materials tab. large.texture.jpg.45b5c4f4e8d103a29963fc

This is where we actually get to apply our textures, you can also apply your normal maps, etc. here was well. Once your texture is loaded up, scroll down to Mapping section and select Map - UVMap. You should do this for every single texture on every single object or else your export will fail. Another thing worth mentioning is that you need to have all of your textures in a folder that has a folder named 'textures' in it's file structure if you don't want to get any errors. If you don't, you will receive some errors, but your .nif will still export.

large.5.jpg.2c31ede74d902b25861cc47c27e2

Now we are done! Once you have followed all of the above steps, your model should export without a problem. Select everything you wish to export and go File - Export - .nif. In the side menu you need to make sure that Skyrim is selected. If it isn't, your model will not export, and all those version numbers you spent typing in were all for nothing.

You should get this gorgeous thing up the top. If you don't, you messed up. See the 'Errors' section for some help. You might also get a popup about vertex colors. You do not need to worry about that.

 

Collisions

Once your original model is all exported, you can start working on your collisions. The method and requirements are exactly the same as above, you pretty much have to prepare another model in Blender. Instead of having each object assigned a different material, this time you want each object to represent a different type of physics (eg. metal, wood, etc.).

Once that is all done, select your model and give it a smooth shading, then export it as a different file as opposed to your earlier one (I put a _c after all my filenames for collisions). Now we will need to open up our collision .nif we just exported in NifSkope.

Due to my test model being very simple, my collision is also very simple. In this case it's the exact same model, vertex paint and all. In the end this doesn't matter, because all that data gets deleted anyway if you follow this tutorial. So, using the left hand tree browser, select your BSFadeNode drop down and expand all the way down to the NiTriShape (By all the way down I meant one branch)

The BSLightingShaderProperty holds all of our vertex paint and texture/material data. The NiTriShapeData holds all of the geometry data. Right click on the BSLightingShaderProperty and delete it, because collisions don't need pretty colors.

P.S. As far as I know you can keep the BSLightingShaderProperty node there and nothing bad will happen. But it's better to be safe.

Your collision .nif should now look something like this:

large.10.jpg.0e3504df86c198259ed5cab1d98

Now we can save that, close down NifSkope and open up NifUtilSuite! This is the part that takes all of the geometry data from our .nif file and turns it into a collision. This part is pretty straightforward. Your target file is the file your original .nif file you exported first, the one that still has your BSLightingShaderProperty branch in it. Your collision file is the one you just edited and removed the BSLightingShaderProperty from. Your collision source should be either Collision fallback Mesh or just simply Mesh, because we are using the mesh to determine where the collisions are. Your collision materials will be different for every object, so you will need to select Name of NiTriShape for your Collision Materials. This way if you have different types of geometry on your model (wood and stone) they can be separated. Your settings should look a bit like this.

large.12.jpg.697383cb80ed406c561f3f332b1

Click on Add Collision. Your collision is now a part of your model. Now you can open up your original model in NifSkope to see how it went. Expand all your branches to see what you have. It should look something like this:

large.14.jpg.ca3155a81cb996e66d75c37a930

If so, that's good. We are nearly done. If it doesn't, something went wrong.

Now we need to add in some extra collision data that wasn't added in with ChunkMerge. Right click on the top BSFadeNode and select Node - Add Extra Data, then select BSXFlags. Click on your newly created BSXFlags and see what's inside of it. Double click on the value for Interger Data and change it to 130. This is what most static Skyrim models have theirs set to. I like to clean up my branches by moving the BSXFlags to the top of the nif by right clicking on the BSXFlags and selecting Block - Move Up.

large.15.jpg.dc106bfbec5edec8571266059b4

Now your collision works! The final thing to do is to determine what kind of material each object is. Open up your nif tree again and find your bhkCompressedMeshShapeData. You may have multiple depending on how many different objects were in your collision file. Select the node and go down to Chunk Materials. Go down the two branches and you will find a line that says material. Open up the selections in the value column and select what you want that part of the mesh to be made out of.

large.16.jpg.e21e2c68d4e40560379584fcc35

Once that is done, you're all ready to go! It all sounds really complicated but after a little while it becomes a lot faster. All you have to do is open up the Creation Kit and start placing your new models.

Errors

No doubt you got some errors the first time around. These are the most common one's I have found and how to solve them.

large.error1.jpg.60ac9d1cd2d3641270dcde5

The version numbers and the game you are trying to export your nif to don't match up. You need to make sure that all of the objects in the scene have all had their version numbers set to the correct export version. Instead of saying 'Cube' it will say your object's name. Makes it a lot easier to narrow down.

large.error2.jpg.a36164225e366c45424835a

You have not applied a shader to an object. Every object must have a shader selected. In most cases, BSLightingShaderProperty.

large.error3.jpg.4c3f470e624c10edbbfadb8

You have applied a material to an object but that material doesn't have any textures.

large.error4.jpg.9fa0a6ffda129ade525fab7

You have not set the mapping to UVMap. Every individual texture in every material must be mapped to the UVMap

large.error5.jpg.a6e36154dea8ab549a7d71b

You have not UV unwrapped an object but somehow assigned a texture to the UV Map.

large.error6.jpg.fd553efdaa093ace8974b1c

You have n-gons in one of your objects. The exporter only supports tris and quads.

large.error7.jpg.d16fc1867c5d76d88d79b2e

One or more of your textures are not in a 'textures' folder. eg. C:\\Users\Desktop\mytextures. You should have a texture folder in there somewhere, like C:\\Users\Desktop\mytextures\textures or C:\\Users\Desktop\textures. Your model will still export but you will need to fix up your texture paths in the BSShaderTextureSet.

7s5Z1je.png

You have not correctly filled out the user versions for Skyrim.

Blender to NifSkope - Overview of Plugin Options

This is where I will go into the details of what you can change in Blender that the exporter recognizes.

NifTools Object Panel:

  • Nif Version, User Version 1 and User Version 2 -  all directly relate to the Nif Version found in the Header of the .nif
  • Nif Root Node -  Will be the root node of your .nif. Self explanatory.
  • Tangents Flags - related to each corresponding object's 'Extra Vectors Flags' properties. It can have a value of None or Tangents_Bitangents, where None is any value other than 16 and Tangents_Bitangents is 16. If set to None, your model's normal maps won't work.
  • UPB - Unknown, I have not experimented.
  • BSXFlags - Does not work. BSXFlags is used for collisions and must be added in via NifSkope.
  • Consistency Flag - Used to select Static/Mutable/Volatile. Not sure what else.
  • Object Flag - Directly related to the 'Flags' property in each NiTriShape.
  • Nif LongName - Unknown. I believe it has no effect.

 

NifTools Object Extra Data Panel

  • Unknown, possibly used to add in BSXFlags and other extra nodes. I don't believe it works at the moment.

 

BS Inv Marker

  • I believe it is used to set a rotation for an inventory item

 

NifTools Shader Panel:

  • All are mostly self explanatory and can be experimented with.

 

Flag Panel

  • Unknown

 

Material Color Panel

  • Ambient - Unknown
  • Emissive - Relates to Emissive Color in BSLightingShaderProperty
  • Alpha - Unknown
  • Lighting Effect 1 - Relates to Lighting Effect 1 found in BSLightingShaderProperty
  • Lighting Effect 2 - Relates to Lighting Effect 2 found in BSLightingShaderProperty

 

NifTools Dismember Flags Panel

  • Unknown

 

Material Settings

Several material settings relate to values in the BSLightingShaderProperty:

  • Specular - Hardness is related to the Glossiness property.
  • Specular - Intensity is related to the Specular Strength property.

 

------

 

 

I plan on continually updating this as the plugin is updated. Please feel free to correct me on anything I may have gotten wrong. Any questions feel free to ask. I hope I have covered everything for the time being. If you are having trouble either post in this thread, look through the documentation yourself, or at least check on the bug tracker to see if the problem has been reported yet.

Edited by Lord Hayden
Add to the error log
10 people like this

Share this post


Link to post
Share on other sites

Posted (edited)

Good to see someone got around to this. Small note: with the error saying it isn't pointing to any textures it will still export a usable nif that can be modified in nifscope!

Secondly, you can avoid most of these steps by importing a static .nif, delete all but one nitrishape, go into edit mode and delete everything and import a cube while still in edit mode to keep all the correct settings.

Edited by Spectral Dragon
1 person likes this

Share this post


Link to post
Share on other sites

Posted

Thanks, I think I fixed that part up. :) You wouldn't happen to know if it's possible to export a BSXFlags node without having to add one in manually?

Not sure about that one I'm afraid.

1 person likes this

Share this post


Link to post
Share on other sites

Posted (edited)

I have followed the guide and here's what i get when exporting:

wtfisipo_zpssrrke6uy.jpg

I'm assuming you made your .nif from scratch and aren't editing an imported .nif? I've never come across this error before. If you don't mind sending me the .nif I'd love to look it over and see if I can solve the issue. :)

EDIT:

This issue has been solved. When importing Oblivion files, you need to make sure to delete any data that isn't related to geometry from the .nif before importing into 2.7+. Once that is done, you have to do is change the .nif version numbers and texture paths if need be to Skyrim's. The only extra step I had to take before exporting the model was to delete the empty that seems to be linked to some animation data, leaving only the objects behind.

This is the imported .nif file:

large.step3.jpg.cc2022d1d4e21389e4a4b091

This is what I had to make it look like to export:

large.step4.jpg.69317b1a6be1bd85315e94d3

After that the file exported fine and I had no other issues.

Edited by Lord Hayden
1 person likes this

Share this post


Link to post
Share on other sites

Posted

Hi, sorry for resurrecting old post but i'm trying to export a blend file to nif from blender 2.77a and my Niftools Object Panel does not look like your first image, instead looks like this atached image. What version did you use for this tutorial?

Captura3.PNG

Share this post


Link to post
Share on other sites

Posted (edited)

No problem at all, that's what this thread is for. I've been meaning to update it with the most recent version of the exporter. Everything is mostly the same with a few changes to make life easier. The only thing you need to worry about in your Niftools Object Panel is:

Nif Root Node (should be BSFadeNode)

Consistency Flag (usually CT_STATIC)

Object Flag (14)

It should look something like this.

large.tutupdate1.jpg.d9789aa9375b1b1953b

The newer version of the exporter has moved the Nif Version and User Versions to the Scene Properties tab, which looks like this large.tutupdate2.jpg.6562bc2385433e9f47b

Down the bottom you just need to change the user versions in the Niftool Scene Panel. From what I can tell the Nif Version no longer functions and works just fine when left at 0. Make sure when exporting to select 'Skyrim' as your selected game so the user versions will match up. The exporter should automatically set the Nif Version from whichever game you select.

large.tutupdate3.jpg.b71d2f3b311547e8003

For the tutorial I used Ghostwalker's exporter, but the NifTools team has since released a newer version which can be found here. I also try to keep the Beyond Skyrim website tutorial as up to date as possible.

Edited by Lord Hayden

Share this post


Link to post
Share on other sites

Posted

I can't believe you replied! I thank you. I set everything like this tutorial but still not working. I got the following error trying to export the file using the new nif plugin:

 

I atached to this reply the blend file i'm trying to export. If you could tell me what i´m doing wrong it will be really appreciated...

Sin título.png

untitled.rar

Share this post


Link to post
Share on other sites

Posted (edited)

Happy to help. I'll have a look at it now and see if I can find a fix. By the looks of the error report it might have something to do with an armature/bone in the model.

Just curious, what are you planning on using the model for? I'm familiar with exporting statics, but if you're requiring animations/bones/weight painting on it I might not be able to help much further.

EDIT:

I've managed to get the head exported. I had to fix a few errors I came across and cut a few corners until I can look into some errors a bit more.

First of all, the error you are getting is due to the bones. I'm assuming you imported a .nif and havn't changed anything to it since?

There were a few other errors I encountered after deleting the bones. First one was one of your textures (MaleHead.dds) didn't have it's mapping set to UV Map. Secondly, there was an n-gon error in there as well, which I solved by triangulating all of the faces before exporting.

If all you need is the geometry, then there's your model all fixed. If you do need those bones though, I'll have to look into it more to see if it's doable at this point.

Edited by Lord Hayden

Share this post


Link to post
Share on other sites

Posted

Thank you. I'm doing this because i wanted to remove the ears from a default male head of skyrim, and i wanted to put cat ears (i already have the file khajiitears.nif and the ear texture so i created a headpart and try to add to this malehead using the creation kit), i trying to do a necko race for skyrim. I know there is a few neko mods out there but i wanted this neko race have the same atributes and skills from breton race so i can have a mage cat race. I don't know if i'm doing the right way or there's something easier to achieve my goal.

-I deleted the bone thing (the bones are: NPC Head [Head] and NPC Spine2 [Spn2] right?)

- Second, the Uv Map thing i forgot was this?

Captura4.thumb.PNG.24ef25713af40cb562087

And finally, I don't get your last point: "Secondly, there was an n-gon error in there as well, which I solved by triangulating all of the faces before exporting."

How do you did this? I neither understand what do you mean with n-gons. Do you mean the triangles in the MaleHeadIMF?

Captura5.thumb.PNG.ba5b80402add38c299edb

 

 

Share this post


Link to post
Share on other sites

Posted

That UV Mapping part looks fine now.

N-gons are faces with more than 5 sides/edges. The exporter can only handle tris and quads (three and four sided faces). As you can see in your model mostly everything is in triangles. My best bet is somewhere between linking the two meshes/editing meshes you might have created a face with more than 5 sides. To fix this, jump into edit mode, select all of your faces and then just search for Triangulate Faces. Ctrl - T is the default hotkey for it.

Share this post


Link to post
Share on other sites

Posted

i triangulated faces as you told me:

triangular.thumb.png.7185f260ef80d6c4321

 and then try to export using this settings:

Captura6.thumb.PNG.256af74388a1abc3ccd7a

and i got this error:

 error.thumb.png.67e029bd5a37eed82d184c64

What i'm doing wrong now? i'm begining to frustrate ... =( 

exportmyfilestupidblender.rar

Share this post


Link to post
Share on other sites

Posted

Sorry my fault, I forgot to mention that one.

To get it to export you will need to delete the vertex groups found in the Object Data tab.

large.vtx1.jpg.db543a402a36393eecc63e1b5

So it looks like this

large.vtx2.jpg.425c1ed7a886757b9e0dc56b3

That should fix it. As for making that new race for Skyrim, I'm not sure how far you can get with only the model, it might require those bones and vertex groups, which as far as I know aren't supported by the exporter yet. I believe you might be able to do something like this with 3DS Max and it's Nif exporter, I'm not very familiar with that one. Give it a go anyway and see what you can manage. When it comes to replacing body parts on characters my knowledge is pretty limited. This tutorial was mainly written just to cover static models like houses and stuff.

Share this post


Link to post
Share on other sites

Posted

I sucesfully exported the head and i try to use as a headpart in the creation kit but i ending having no head at all...

creationkit.thumb.PNG.70f3c7ee6f73c02f75

A headpart has a nif file and a try file, i dunno how to edit try files so i used the default malehead try file. There is a way to edit a try fie? I think i should try to download 3d max and see how it works, the problem is that the program is very heavy (more than 3GB)... 

Share this post


Link to post
Share on other sites

Posted

Tri file.

The problem you're going to get is that Blender won't export BSDismemberSkinInstance (defines pieces flying like beheading) or the bone/skin stuff required for your armor part to move in game. Without those you'll likely face issues similar to what you're seeing now. No matter what you do, Blender is not capable of creating that stuff so is not suitable for armor/character/creature modeling. It's not possible until the plugin is updated to handle those things and development is extremely slow on that plugin.

3DS Max is the only viable sottware for doing creature/armor/character modeling in Skyrim.

http://afkmods.iguanadons.net/index.php?/topic/4136-nifskope-20-dev/

http://www.autodesk.com/education/free-software/3ds-max

https://github.com/figment/max_nif_plugin/releases

1 person likes this

Share this post


Link to post
Share on other sites

Posted

I sucesfully exported the head and i try to use as a headpart in the creation kit but i ending having no head at all...

Hidden Content

A headpart has a nif file and a try file, i dunno how to edit try files so i used the default malehead try file. There is a way to edit a try fie? I think i should try to download 3d max and see how it works, the problem is that the program is very heavy (more than 3GB)... 

Removing the vertex groups is why your getting the issue in the CK. They are used to map the bones to vertices to state what influence each bone has on any given vertex.

@Meliodas BSDismemberSkinInstance do get exported.

@Lord Hayden I'll create follow on post for each of the issue you raised above in relations to current version, known issues, status, prioritisation, etc. when I get a chance.
Awesome work btw.

3 people like this

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now