simsim899 added a topic in TutorialsNifSkope, Collision Meshes, Blender and more...A few months back I was asked by another member for some help making collision meshes. I wrote up a pretty detailed tutorial for them, and they suggested I should post it here as well. So, that's what I'm doing!
What follows will actually be several tutorials, as I will split my original PMs up into sections for each topic I explain about (and reword them slightly so it all makes sense).
PART 1: Setting up NifSkope
Okay, right. I looked at your test nif, and I can see the problem Where you have put the texture paths into the BSShaderTextureSet node, you have put in the whole path starting with the drive letter. But you only need to start the path for the texture with "textures\..." Which leads me to wonder - have you set up the paths to the texture folders you want to use in your NifSkope settings? If not, I will tell you how to do that What you need to do, is click on 'Render' and then navigate to 'Settings...'. Make sure you are on the 'Rendering' tab, and then add the folder of your Skyrim installation. You only need to point it to the Data folder, NOT the textures folder
PART 2: Setting up NifUtilsSuite
Download NifUtilsSuite, which you can find here: https://www.amazon.de/gp/drive/share?ie=UTF8&mgh=1&s=yrYeEdIVTFcsT9JhsIBJ4s
Then, the first thing you should probably do (I don't remember if this is completely necessary or not), is: wherever you have installed NifSkope - put that into it's own folder called 'NifTools'. Then extract NifUtilsSuite into that same folder. So it should look like this:
(It might not be necessary, but still, it keeps everything nice and organised this way And, depending how you've installed Blender, it may already be set up like this)
Okay so... next: Run 'NifUtilsSuite.exe', which you can find in the folder 'bin' (you'll probably want to make a shortcut for it). It should then ask you for some things (if it doesn't, navigate to 'options'' and click on 'Edit...', then go to the 'General' tab, to get the settings window up). The first thing you will need is to find your 'nif.xml' file. It can be found in the folder where you have installed NifSkope.
And... I figure actually a picture might be a quicker explanation here, so, basically, it needs to be set up like this :
Btw, the 'templates' folder is not there by default, you will have to make it. Just put it in your NifUtilsSuite folder. It can be left empty for now, we'll put something in it later
PART 3: Exporting your mesh and making it a Skyrim-compatible Nif
(The following instructions are based on as if you exported your mesh from Blender V2.49b, but most of this should also apply to meshes exported as nifs from any other 3D program)
Okay, I know what the problem is, and it's pretty easy to fix Basically, when you export as a nif from Blender, there is no option to export it in the format that Skyrim nifs use. So instead you export it with Fallout 3 nif settings, which is what you have done (btw, this applies for version 2.49 version of Blender, which appears to be the one you have in the screenshots, and I have as well (2.49b specifically) - I'm not sure if other versions of Blender are like this or not) However, Fallout 3 format nifs will not work in Skyrim, so you have to convert them to Skyrim format. This is what you need to do
So, there are two ways to do this. Either manually, or using NifUtilsSuite. I will explain how to do it both ways for you
In your nif, the main branch is currently an 'NiNode' - it needs to be converted to a BSFadeNode. To do this, right click on it, go to 'Block' and click on 'Convert'. Then go to 'Bethesda' and choose 'BSFadeNode'.
Now you have to delete some branches from every NiTriShape. Expand each NiTriShape one at a time, and then delete the branches 'BSShaderPPLightingProperty', 'NiSpecularProperty' and 'NiMaterialProperty', so you only have 'NiTriShapeData' left. You can delete branches by clicking on them and doing 'ctrl + delete'. (Just as a note here, you may want to make a backup of the nif before doing this, so you know which textures each NiTriShape was using, as you won't know anymore once these branches are deleted, unless you can remember them.. )
Next, you need to add branches that will hold the textures onto the NiTriShape nodes (the ones you deleted were in Fallout 3 format so wouldn't work). The easiest way to do this is to find a vanilla Skyrim nif, similar to the one you are converting. Open it up, and find where it has a 'BSLightingShaderProperty' branch (it should also have a child node called 'BSShaderTextureSet'). Right click on it, and choose 'copy branch'. Then go back to your nif, right click on the NiTriShape (NOT the NiTriShapeData), and choose 'paste branch'. Now you can change the texture paths back to what they should be. Do this for every NiTriShape
You will also want to copy over a BSXFlags node from a vanilla nif that is similar to yours. Paste it onto the 'BSFadeNode' of your nif, and make sure string data says 'BSX'. If it doesn't, you can change it by clicking on the BSXFlags node, and right clicking on the row that starts with 'Name'. Choose 'edit string index' and then just type in BSX in the box. Done!
Now, the last thing you need to do is very important. In NifSkope, click on 'view' and go to where it says 'Block List' and then click on 'Show Blocks in List'. Now the very top block you should see in the list is 'NiHeader'. Click on that, and where it says 'User Version', make sure the value listed is 12, NOT 11. And again where it says 'User Version 2', the value there should be 83, NOT 34. (11 and 34 are the values for Fallout 3 nifs, 12 and 83 are for Skyrim nifs )
And... That should be it to make them show up in the CK Of course, they will also need to be given collision, which I will go over in the next part.
2) Using NifUtilsSuite:
Now you have exported your mesh as a nif, we need to use a feature of NifUtilsSuite called 'NifConvert' to make the nif Skyrim-compatible. (The rest of this section assumes you have read Part 2 on Setting up NifUtilsSuite)
Before we start however, you are now going to need to add a file to the template folder which should have been created in Part 2.
A template nif is, well... pretty self-explanatory actually. NifConvert defines it as a "NIF file used as template for converting". Although we will also use this template when creating collision in ChunkMerge, where it is defined as a "NIF file used as template for creating collision data". So yeah - it's a template, enough said
Anyway... So what nif should we use as a template? Well, it will need to be a vanilla Skyrim nif (obviously!), and one that has a 'bhkCompressedMeshShapeData' node in its collision data. I personally use 'Barrel02.nif' which works well. You can extract this from the Skyrim - Meshes.bsa using a program like BSAopt. Then just put a copy of it in the 'templates' folder. Voila! Now we can start using NifConvert
Open NifUtilsSuite and navigate to the NifConvert tab (it should be the first tab which is displayed as default when you first open the program). Find your nif that you exported and point to it in the 'In-File' box. In the 'Out-File' box, choose the folder where you want to save the newly converted nif, name it what you want it to be called, and hit 'save'. Now you have to choose your template nif. If you followed the previous steps correctly, it should show up in the drop-down menu for 'Template'. Select it. And now in the 'Texture Path' bit, you should have just a "\" selected from the drop-down menu. (If this doesn't show up, go back to Part 2 and make sure you have defined the texture path for your skyrim install as the picture shows.)
Now, make sure the rest of the settings look like this:
Note: it might also be okay to tick 'Generate default color' instead of 'Remove flag' in the second section, but I also choose the former option, so it's probably best to stick with that, as it has never caused me any problems.
The finally, click on 'Convert NIF'. And you're done! Well... almost - there is one more step you need to do in NifSkope first
You can now close NifUtilsSuite, find your converted nif and open it. You may notice it has no BSLightingShaderProperty branches. These will still have to be added in manually. I already explained how to do this above, but for ease of reading, I will just copy what was already written for you here:
"The easiest way to do this is to find a vanilla Skyrim nif, similar to the one you are converting. Open it up, and find where it has a 'BSLightingShaderProperty' branch (it should also have a child node called 'BSShaderTextureSet'). Right click on it, and choose 'copy branch'. Then go back to your nif, right click on the NiTriShape (NOT the NiTriShapeData), and choose 'paste branch'. Now you can change the texture paths back to what they should be. Do this for every NiTriShape "
And NOW you are done!
PART 4: Using ChunkMerge to add collision to your mesh
Okay - now on to the fun part! (Or maybe not, depending on your definition of 'fun' )
There are two ways you can make collision for your mesh using ChunkMerge. The first way I will explain is the quick and easy method - using the nif's mesh data to make the collision mesh from. However, generally this is NOT the method I would recommend for making collision - it's usually always better to model a new collision mesh, as it'll have much fewer polys and be less performance intensive - I will explain how to do it this way second. For now though, the first method is an easy way for a beginner to make collision.
Before you start, you must make sure you nif doesn't already have any 'bhkCollisionObject' branches. If it does, just remove them.
Then open up NifUtilsSuite and switch to the 'ChunkMerge' tab. Under 'Target-File', select your nif that you want the collision added to. Then under 'Collision-File', for this method you are just going to select the same nif as you did for the target file. Then under 'Template', again choose the nif you put in the templates folder. Now, make sure 'Mesh data' is selected for the collision source. And for the collision material, since we aren't using a separate collision mesh, you have to select 'single'. This means your nif can only sound like it's made from one material. Even if it's several different materials, like wood and stone, you can only make it one. However, when you make your own collision mesh as in Method 2, you can sort all this out But for now, in the dropdown list, choose the material that most of your object is made from. For example - 'Stone'. Then, for collision handling, make sure 'create global collision' is selected. Then just press 'Add Collision', and voila! You're done! (well, provided it worked with no errors of course )
Also if you wish, you can now choose to view how your nif looks with the collision added. Just click on the little magnifying glass that's next to the 'Target-File'. The collision should show up as a red wireframe around your mesh.
Okay, now I will explain how to add custom collision to your nif Note that I WON'T be telling you how to actually model the new collision mesh in a program like Blender or 3ds Max, as I assume if you're reading this you should already know how to model something, but everything else I will cover
Alright so, first thing you will need to do is import your nif into whatever modelling program you're going to make the collision mesh in. Or, if the nif is of something you modelled yourself, just open up your workfile for it in the program you made it in - no need to import it if you already have it. Unless of course you made any changes to the mesh WITHIN NifSkope - in that case you would need to import the nif. (I will cover how to prepare a nif file for importing into a program like Blender in Part 5)
Now model a collision mesh over it. You should do it like this, as you have to make sure the collision is the same size and in the same place as model itself (otherwise when you use ChunkMerge the collision will be offset). Make sure any parts of the mesh that are made of different materials you model as separate objects so that you can specify different materials for them. When you are finished, select all the objects making up the collision mesh (DON'T include the mesh of the actual model - leave that unselected or just delete it), and export as a nif.
Now, depending on your model, you may or may not need to do the next step. If your collision mesh is just a single object (NiTriShape), i.e. it's only going to be made of a single material, the next step can be skipped. Otherwise, you will need to do the following:
Open up the nif of the collision mesh you just exported. You are going to need to rename the string indexes of the NiTriShapes to the name of the material you want them to be. The names you will put for the different materials are as follows:
Once you have named all the NiTriShapes appropriately, save the nif, and then open ChunkMerge in NifUtilsSuite.
Once again, set the 'Target-File' as the nif to which you want to add the collision to. And for the 'Collision-File', this time you are going to choose the nif we just made of the collision. For 'Template' you'll use the same one again, and for the 'Collision Source' we will once again select 'Mesh data'. Now for collision material - if you DIDN'T do the previous step, because your collision is just going to be one material and the nif only had one NiTriShape - choose 'Single' and select the material you want. OR, if you you did do the last step (naming the NiTriShape string indexes the collision material names) because your mesh will have multiple materials - choose 'Name of NiTriShape'. Lastly, making sure 'Create global collision is also ticked (it should be by default), press the 'Add Collision' button. And that's it! You have now given your nif static collision (Note: this collision is STATIC!! I will go over making the collision havok-enabled in a later Part)
Also once again, if you wish, you can then choose to view how your nif looks with the collision added. Just click on the little magnifying glass that's next to the 'Target-File'. The collision should show up as a red wireframe around your mesh.
PART 5: Preparing your Nif for importing into Blender
In order to import a nif file into Blender (v2.49b) so you can edit it (for example if there is a vanilla nif that you want to modify), you have to first convert it. This is because Blender does not accept importing of Skyrim-format nifs. There are two ways you can convert a nif so it's suitable for importing into Blender - manually, or using the 'BlenderPrepare' feature of NifUtilSuite. I will explain both ways
Open up the nif you want to convert in NifSkope. First - delete ALL the BSLightingShaderNodes (so including the BSLightingShaderTextureSet child nodes). Your model with lose all its textures - don't worry, this is supposed to happen. Next, delete any collision branches the nif has. Don't worry if you want to use the same collision mesh on the nif after you've modified it - you can add it back later. Then, delete any nodes with these names: BSXFlags, (will fill the rest in later) so the only nodes you should have left in your nif are the BSFadeNode, NiTriShapes, NiTriShapeData, and any NiNodes you may have. Now, the final step is to edit the user version numbers to values that Blender will accept. Click on 'view' and go to where it says 'Block List' and then click on 'Show Blocks in List'. Now the very top block you should see in the list is 'NiHeader'. Click on that, and where it says 'User Version', change the value from 12 to 11. And again where it says 'User Version 2', the change this value from 83 to 34. Now save this nif as a NEW nif (you don't want to override the original), and you'll now be able to import this nif into Blender
2) Using 'BlenderPrepare':
...will finish this later...
PART 6: Using 'ChunkExtract'
PART 7: Making havok-enabled collision
PART 8: Miscellaneous tips and tricks
I will update this post in a little while to finish Parts 5 to 8 Also, as you can probably tell, these are written like PMs because that's what they were - I will edit them later so they sound more professional
- 4 replies
- 5326 views