From 3dsmax to Oblivion CS

From the Oblivion ConstructionSet Wiki
Jump to navigation Jump to search

This tutorial aim to be very practical guide to get static models from 3dsmax 7-9 to Oblivion Construction Set (CS). It is assumed that reader is new to NIF file format, NifSkope, and Oblivion CS. However, this tutorial does not cover 3dsmax modeling techniques, just steps needed to export the model.

Some later sections of this tutorial may be useful not only for 3dsmax users.

Before you begin[edit | edit source]

1. You will need NifSkope and NifTools plugin (for your 3dsmax version).

NifSkope. When you install it, go to Render->Settings and click "Oblivion" button. That will make it autodetect Oblivion data folder, so you will see textures on your models. Also, you can adjust background color here.

NifTools plugin. Run 3dsmax at least once before installing it. Then, extract NifPlugins.dlu to Max/plugins and MaxNifTools.ini to Max/plugcfg folders. If you are using 3dsmax9, copy MaxNifTools.ini to "<drive>:\Documents and Settings\<user>\Local Settings\Application Data\Autodesk\3dsmax\9 - 32bit\enu\plugcfg".

2. Download Oblivion Mod Manager. Install it. Create new folder, something like "OblivionUnpacked". Go to Oblivion/data folder, and extract "Oblivion - *.bsa" files to "OblivionUnpacked". You do that by opening bsa file and clicking "extract all" button. You may skip "Voice" files, because for everything you would need 5,43GB disk space. Now when you are done (that will take a while), you can add "OblivionUnpacked" path to your NifScope paths list (Render->Settings->Add Folder...).

Making your model[edit | edit source]

When making a model for the first time for a game, you need to know what scale that game uses, so you get the size right. The best way would be to import some Oblivion model for side-by-side comparison.

First of all, in 3dsmax, click menu Customize->Configure User Paths..., and in "External files" tab add folder, where you unpacked oblivion data files. Then, click file->import, select "nif" file type, and browse "OblivionUnpacked\Meshes" for some mesh. You can choose some house, for example, "Meshes\Architecture\Anvil\anvilhousemc02.nif". If you did everything right, you should see that model in 3dsmax, completely textured!

You can also use such imported models to find out how they are made. For example, every mesh in them has only one texture assigned, and there is usually only one mesh with same texture.

Select all (Ctrl+A), and group it, so you can easily delete it later.

Now, make a model. There are lots of modeling tutorials everywhere, so that part will not be covered here. Use any technique you like. However, you will need "editable mesh" at the end, so optimize your model as needed for minimum polygon count, but good detail. Practice does wonders here ;). For this tutorial, I have made this simple hut:

File:Max9ToCSSmallHutPreview01.jpg

And adjusted size to look good near other oblivion models. My model has 3 meshes: walls, roof, and roof edges:

File:Max9ToCSSmallHutPreviewDivided.jpg

Every mesh has Standard material assigned, and edge mesh, additionally, has opacity map (opacity map just for seeing it in max, it is optional when exporting):

File:Max9ToCSMaterials.jpg

Exporting[edit | edit source]

Preparing meshes[edit | edit source]

So, now that the model is textured, everything is ready for export, right? No. This is good point to make a backup, in case you want to fix some mapping coordinates or use this mesh as a base for new one, so save a copy.

Now delete any unnecessary models and objects from the scene.

Now we will do the following for every mesh:

1. If your mesh is not an editable mesh, you can either assign an "editable mesh" modifier, or select one of your meshes, go to the utilities menu, select Collapse->Collapse Selected.

File:Max9ToCSCollapse.jpg

This is to make your mesh an "editable mesh". You also can use collapse to group different meshes with same texture into one, so there will be smaller node tree in NifSkope later. I already did that for my model's walls.

2. Assign Reset XForm modifier. You can also find it in the Utilities panel.

File:Max9ToCSResetXForm.jpg

Always do this after any modifications to mesh. It resets pending transformations you have done to mesh. So you would not wonder looking to your model in NifSkope later "why my roof is upside down".

3. Collapse again. Now we have a clean editable mesh.

Repeat for every mesh.

When you are done, and if you don't need collision, you can select all of your meshes and go directly to "Finally, exporting" part of this tutorial.

Otherwise, read on, brave one :)

Preparing collision[edit | edit source]

For collision, make a mesh as simple as possible around your model. I am going to use 4 cubes for that and rotate them as needed. Here is my result:

File:Max9ToCSCollision.jpg

Now, if you have not done so, configure your Utilities panel to contain two additional things: NifProps and UVWRemove:

File:Max9ToCSConfigureButtonSets.jpg

1. Now, collapse your collision mesh together. If you have the new NifSkope plugin version, you may use more than one collision mesh, and make them surround different materials (so you can hear the stone sound when walking on stone, or the dirt sound on dirt).

2. Click Reset XForm.

3. Next, click "UVWRemove", select the "Set Gray" checkbox, then click the "UVW" button first, and then "Materials".

File:Max9ToCSUVWRemove.jpg

4. And then Collapse again.

5. With the collision mesh still selected, click "NifProps". Select "Is Collision Mesh", and adjust the other properties as needed.

File:Max9ToCSNifProps.jpg

We are going to use "Export" and not "Export Selected" when exporting with collision, so make sure your scene is clean from anything unnecessary.

File:Max9ToCSClean.jpg

Finally, exporting[edit | edit source]

File->Export. Save as type: NIF:

File:Max9ToCSExport.jpg

Notice that I selected the "textures\architecture\farmhouse" path, because I know that two of my textures are from that folder.

Fixing the model in NifSkope[edit | edit source]

Fixing collision[edit | edit source]

New versions of the NifSkope plugin seem to export correct collision, so you can skip this section. However, I leave this text here in case there are still some problems.

Open your model with NifScope. If you see your collision in red wireframe where it should be, you did everything right.

Now, we will need to modify some nodes to make the collision work (and not crash CS).

Right click the root node -> Node -> Attach Extra Data -> NiStringExtraData:

File:Max9ToCSAttachExtraData.jpg

Select it, change the name to UPB. Open another NifSkope, and open some other oblivion model, like a door. For example, Architecture\Anvil\anvildoormc01.nif. Find the NiStringExtraData node in it, copy contents from the StringData parameter, and paste it into your model. It seems that no matter what it contains in that parameter, it works if that model has collision:

File:Max9ToCSCopyStringData.jpg

Now, adjust the node order to be like this: root node = 0, BSXFlags = 1, NiStringExtraData = 2

(I usually select "NiStringExtraData", and use Ctrl+Up until it moves to just after the root node, then select the root node and click Ctrl+Up few times until it becomes 0)

File:Max9ToCSOrder.jpg

Now expand the bhkCollisionObject, and browse until you find bhkNiTriStripsShape. Select it, find the NumDataLayers property and change it to 1.

File:Max9ToCSbhkTriStripsShape.jpg

Now right click on DataLayers -> Array -> Update

File:Max9ToCSDataLayersUpdate.jpg

Expand the array and find it's first property. Change it to "Static":

File:Max9ToCSChangeToStatic.jpg

Thats all. Now it should not cause a crash and the collision should work. Some credit goes to Razorwind and his 3dsmax9 collision tutorial. You can check it out also, if you find any of my explanations are not clear enough.

Fixing Texture Paths[edit | edit source]

Browse for every NiTexturingProperty and check that the paths in NiSourceTexture are correct, and if not, change them.

Adding transparency[edit | edit source]

File:Max9ToCSAddingTransparency.jpg

Right click your mesh part which should be transparent, then Node -> AttachProperty -> NiAlphaProperty.

Additional info about transparency[edit | edit source]

Right click NiAlphaProperty->Flags. There are basically three ways in which transparency could be done. It depends on the mesh as to which way is better.

Alpha blending without testing[edit | edit source]

When transparent mesh parts in your model usually are not behind one another, this mode is best, because it produces smooth and nice edges. However, if you have some heavily transparent object (like a plant), you may see sky through some of leaves instead of other leaves. That happens because it seems that this version of the engine does not sort triangles before drawing them.

File:Max9ToCSAlphaBlendingWithoutTesting.jpg

Alpha blending with testing[edit | edit source]

To overcome this sorting problem, you can enable alpha testing. Setup it like shown below, and adjust the Threshold value until you find an optimal result. Threshold is the minimum required value for the alpha channel to be clipped. So you get some artifacts around edges, but generally the meshes are drawn correctly.

File:Max9ToCSAlphaBlendingWithTesting.jpg

Testing only[edit | edit source]

And then, if you don't like artifacts around edges, you can choose the same method in which oblivion trees are drawn: Testing Only

File:Max9ToCSTestingOnly.jpg

Getting it to Oblivion[edit | edit source]

Now, when everything is ready, save the nif file, and open CS.

Open the "File" menu, and choose "Data". Any group of modifications to a game is called a plugin and saved to an esp file. If you want just to test your mesh, you can create a temporary mod by selecting Oblivion.esm in this list and clicking OK. However, if you have an existing mod, you don't need any help from me :)

In the Cell View select the "Tamriel" World Space, then ICWaterfront03 (you will recognize this location).

I assume your mesh already is in some Data\Meshes\Test folder (this is just an example). In the Object Window, expand "World Objects" -> Static, and then select it. Then right click on any object, choose "New", click "Add NIF File", and browse for your file. When you are done, you can also change the ID property in the editor. Click OK, and your mesh should appear under Static\Test. Then drag it to the render window. Move it with left mouse button, rotate with the right mouse button, move up/down with Z button pressed, rotate view with the shift button pressed. More information on this is in A beginner's guide - The Construction Set Primer.

Good luck!

File:Max9ToCSsmallhut.jpg