|
|
(20 intermediate revisions by 4 users not shown) |
Line 1: |
Line 1: |
− | {{Trail|3D Art}} | + | {{Trail|3D Art}}[[Category:Arcane University-3D Art-Mesh Export to NIF| ]] |
− | == Basics ==
| + | 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. |
− | * To review the specifics of the NIF data formate used for meshes, check [[Arcane_University:NIF_Data_Format|Nif Data Format]].
| |
− | * To review the specifics of the DDS data formate used for textures, check [[Arcane_University:DDS Data Format|DDS Data Format]].
| |
| | | |
− | == Export ==
| + | * Any 3D programs (see requirements) |
− | Meshes can be exported by the following applications:
| + | ** CK-CMD |
| + | ** Outfit Studio |
| + | * Blender |
| + | ** Blender Niftools Addon |
| + | ** PyNifly |
| + | * 3DS MAX |
| + | ** 3DS Max Nif Plugin |
| | | |
− | * Blender export plugin (Blender version 2.7x)
| + | 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. |
− | * 3DS MAX export plugin (Max versions xxx)
| |
− | * CK-CMD (any 3D program that can export to fbx)
| |
− | * Outfit Studio (any 3D program that can export to obj)
| |
| | | |
− | == General Workflow == | + | == 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. |
− | == Blender 2.7+ Export ==
| |
− | | |
− | 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.
| |
− | | |
− | === Getting Started ===
| |
− | | |
− | To export your models, you will require these tools:
| |
− | * [https://github.com/niftools/nifskope/releases NifSkope]
| |
− | * [https://github.com/niftools/blender_nif_plugin/releases Blender Nif Plugin]
| |
− | * [https://drive.google.com/file/d/0B9F4jSOO-JcpYTNsbUg3MkNILW8/view NifUtilSuite] (contains ChunkMerge for collision, click Download)
| |
− | * [https://www.blender.org/download/previous-versions/ Blender 2.7x] (as 3d Program to work with)
| |
− | * 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 modeling 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 modeling 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 the 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 has had all of its transformations applied, I will start going into detail about the Nif related requirements.
| |
− | | |
− | In the most recent version of the plugin, you will need to go to the Properties editor (by default on the right side of Blender) and select the Scene tab [[File:BlenderExp2.jpg|BlenderSceneTab]]. Down the bottom you should see some NifTools settings where you can change the Nif Version and both User Versions. You will need to make sure that User Version 1 is set to 12, and User Version 2 is set to 83 for a Skyrim export. (For the time being, ‘Nif Version’ is no longer used)
| |
− | | |
− | In the Properties editor select the Object tab [[File:BlenderExp3.jpg|BlenderObjectTab]]. 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:
| |
− | | |
− | [[File:BlenderExp4.jpg|BlenderNifObjectSettings]]
| |
− | | |
− | 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: (This image is from an earlier version of the plugin. The new version will look similar and will work the same as seen below)
| |
− | | |
− | [[File:BlenderExp5.jpg|BlendershaderType]]
| |
− | | |
− | If you do not use vertex paint, uncheck vertex_colors. You can also do that after the export in Nifskope, your mesh might appear black first.
| |
− | | |
− | That is all you need to do in the Object Properties tab. I usually move on to the Material Properties, it looks like a checkered sphere [[File:BlenderExp6.jpg|BlenderMaterialsProperties]]. 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 modeling 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
| + | == Outfit Studio == |
| + | 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. |
| | | |
− | Now I go to the Texture tab, which looks like a checkered square, by default it is on the right of the Materials tab [[File:BlenderExp7.jpg|BlenderTextureTab]].
| + | == 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. |
| | | |
− | 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.
| + | === Blender 2.7x === |
| + | The process for direct export from Blender 2.7x is documented on [[AU:Blender 2.7x Export|Blender 2.7x Export]]. |
| | | |
− | [[File:BlenderExp8.jpg|BlenderMapping]] | + | === 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]]. |
| | | |
− | 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.
| + | == 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). |
| | | |
− | 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.
| + | == 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. |
| | | |
− | === Collisions === | + | == See Also == |
− | 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 (e.g. metal, wood, etc.).
| + | * 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]]. |
| | | |
− | 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.
| + | [[Category:Arcane University-3D Art| ]] [[Category:Arcane University-Method| ]] |
− | | |
− | 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:
| |
− | | |
− | [[File:BlenderExp9.jpg|NifskopeCollisionNiTriShapeData]] | |
− | | |
− | | |
− | 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.
| |
− | | |
− | [[File:BlenderExp10.jpg|NifUtilSuiteChunkMerge]] | |
− | | |
− | 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:
| |
− | | |
− | [[File:BlenderExp11.jpg|NifskopeCollisionNode]]
| |
− | | |
− | | |
− | 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.
| |
− | | |
− | [[File:BlenderExp12.jpg|NifskopeAddBSXFlags]]
| |
− | | |
− | | |
− | 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.
| |
− | | |
− | [[File:BlenderExp13.jpg|NifskopeCollisionMaterial]]
| |
− | | |
− | | |
− | 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.
| |
− | | |
− | === Resolved 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.
| |
− | | |
− | * io_scene_nif.utility.nif_utils.NifError: 'Cube': version does not match selected export settings
| |
− | ** 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.
| |
− | [[File:BlenderExp14.jpg]]
| |
− | * io_scene_nif.utility.nif_utils.NifError: Export version expected shader. no shader applied to mesh
| |
− | ** You have not applied a shader to an object. Every object must have a shader selected. In most cases, BSLightingShaderProperty.
| |
− | [[File:BlenderExp15.jpg]]
| |
− | * Attributeerror: 'NoneType' object has no attribute 'offset'
| |
− | ** You have applied a material to an object but that material doesn’t have any textures.
| |
− | [[File:BlenderExp16.jpg]]
| |
− | * io_scene_nif.utility.nif_utils.NifError: ERROR%t|Texture is set to use UV but no UV Map is Selected for Mapping > Map
| |
− | ** You have not set the mapping to UVMap. Every individual texture in every material must be mapped to the UVMap.
| |
− | [[File:BlenderExp17.jpg]]
| |
− | * io_scene_nif.utility.nif_utils.NifError: ERROR%t|Create a UV map for every texture, and run the script again.
| |
− | ** You have not UV unwrapped an object but somehow assigned a texture to the UV Map.
| |
− | [[File:BlenderExp18.jpg]]
| |
− | * export_tri_shapes assert
| |
− | ** You have n-gons in one of your objects. The exporter only supports tris and quads.
| |
− | [[File:BlenderExp19.jpg]]
| |
− | * 'TextureHelper' object has no attribute 'warning'
| |
− | **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.
| |
− | [[File:BlenderExp20.jpg]]
| |
− | | |
− | === Yet Unresolved Errors ===
| |
− | | |
− | There are some errors that we currently are investigating.
| |
− | *'ValueError: deepcopy: classes BSFadeNode and Nitrishape unrelated'
| |
− | **This has only popped up in more recent versions of the plugin, as it was not yet present in the version downloaded on 2018-07-30. It can be resolved by setting the root node of the nif to NiNode, though that will have the obvious effect of the root node not being BSFadeNode. Alternatively, use the older version, for now, available [https://cdn.discordapp.com/attachments/696507961501286431/698804547560407090/blender_nif_plugin-2.6.0a0.dev4-2018-07-30.zip here] (Discord link, so may expire).
| |
− | [[File:BlenderExportOpenQuestion1.png]]
| |
− | | |
− | === 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.
| |
− | * BSXFlags: Used for collision, copy the value from a similar mesh.
| |
− | * 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.
| |
− | * 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: used to set a rotation for an inventory item. Use transformation from radiant (pie) to degree values. Follows the common "right-hand rule" axis definition as in science & engineering.
| |
− | | |
− | ====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.
| |
− | | |
− | == 3DS MAX export ==
| |
− | | |
− | == CK-CMD ==
| |
− | * https://github.com/aerisarn/ck-cmd
| |