Difference between revisions of "From 3dsmax to Oblivion CS"
imported>Nercury |
imported>ShadowDancer m (→Getting it to Oblivion: typos/formatting) |
||
(23 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
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== | ==Before you begin== | ||
1. You will need | 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 | 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 | 2. Download [http://timeslip.chorrol.com/obmm_download.html 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== | ==Making your model== | ||
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. | 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 | 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: | ||
[[Image:Max9ToCSSmallHutPreview01.jpg]] | [[Image:Max9ToCSSmallHutPreview01.jpg]] | ||
Line 37: | Line 39: | ||
===Preparing meshes=== | ===Preparing meshes=== | ||
So, model is textured, everything is ready for export, right? No. This is good point to make backup, in case you | 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 scene. | Now delete any unnecessary models and objects from the scene. | ||
Now we will do following for every mesh: | Now we will do the following for every mesh: | ||
1. If your mesh is not editable mesh, you can either | 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. | ||
[[Image:Max9ToCSCollapse.jpg]] | [[Image:Max9ToCSCollapse.jpg]] | ||
This is to make your mesh "editable mesh". You also can use collapse to group different meshes with same texture into one, so there will be smaller node tree in | 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 Utilities panel. | 2. Assign Reset XForm modifier. You can also find it in the Utilities panel. | ||
[[Image:Max9ToCSResetXForm.jpg]] | [[Image: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 | 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 clean editable mesh. | 3. Collapse again. Now we have a clean editable mesh. | ||
Repeat for every mesh. | Repeat for every mesh. | ||
When you are done, and you don't need collision, you can select all | 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 :) | Otherwise, read on, brave one :) | ||
Line 73: | Line 75: | ||
[[Image:Max9ToCSConfigureButtonSets.jpg]] | [[Image:Max9ToCSConfigureButtonSets.jpg]] | ||
1. Now, collapse your collision mesh together. | 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. Reset XForm. | 2. Click Reset XForm. | ||
3. Next, click "UVWRemove", select | 3. Next, click "UVWRemove", select the "Set Gray" checkbox, then click the "UVW" button first, and then "Materials". | ||
[[Image:Max9ToCSUVWRemove.jpg]] | [[Image:Max9ToCSUVWRemove.jpg]] | ||
4. And Collapse again. | 4. And then Collapse again. | ||
5. With collision mesh still selected, click "NifProps". Select "Is Collision Mesh", and adjust other properties as needed. | 5. With the collision mesh still selected, click "NifProps". Select "Is Collision Mesh", and adjust the other properties as needed. | ||
[[Image:Max9ToCSNifProps.jpg]] | [[Image:Max9ToCSNifProps.jpg]] | ||
We are going to use "Export" and not "Export Selected" when exporting with collision, so make your scene clean from anything unnecessary. | We are going to use "Export" and not "Export Selected" when exporting with collision, so make sure your scene is clean from anything unnecessary. | ||
[[Image:Max9ToCSClean.jpg]] | [[Image:Max9ToCSClean.jpg]] | ||
Line 97: | Line 99: | ||
[[Image:Max9ToCSExport.jpg]] | [[Image:Max9ToCSExport.jpg]] | ||
Notice that | Notice that I selected the "textures\architecture\farmhouse" path, because I know that two of my textures are from that folder. | ||
==Fixing model in | ==Fixing the model in NifSkope== | ||
===Fixing collision=== | ===Fixing collision=== | ||
''skip this | ''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. | 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 collision work (and not crash CS). | Now, we will need to modify some nodes to make the collision work (and not crash CS). | ||
Right click root node -> Node -> Attach Extra Data -> NiStringExtraData: | Right click the root node -> Node -> Attach Extra Data -> NiStringExtraData: | ||
[[Image:Max9ToCSAttachExtraData.jpg]] | [[Image:Max9ToCSAttachExtraData.jpg]] | ||
Select it, change name to UPB. | Select it, change the name to UPB. | ||
Open another | 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: | ||
[[Image:Max9ToCSCopyStringData.jpg]] | [[Image:Max9ToCSCopyStringData.jpg]] | ||
Now, adjust the node order to be like this | Now, adjust the node order to be like this: root node = 0, BSXFlags = 1, NiStringExtraData = 2 | ||
(I usually select "NiStringExtraData", use Ctrl+Up until it moves just after root node, then select root node and click Ctrl+Up few times until it becomes 0) | (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) | ||
[[Image:Max9ToCSOrder.jpg]] | [[Image:Max9ToCSOrder.jpg]] | ||
Now expand bhkCollisionObject, and browse until you find bhkNiTriStripsShape. Select it, find NumDataLayers property and change it to 1. | Now expand the bhkCollisionObject, and browse until you find bhkNiTriStripsShape. Select it, find the NumDataLayers property and change it to 1. | ||
[[Image:Max9ToCSbhkTriStripsShape.jpg]] | [[Image:Max9ToCSbhkTriStripsShape.jpg]] | ||
Line 131: | Line 133: | ||
[[Image:Max9ToCSDataLayersUpdate.jpg]] | [[Image:Max9ToCSDataLayersUpdate.jpg]] | ||
Expand array and find it's first property. Change it to "Static": | Expand the array and find it's first property. Change it to "Static": | ||
[[Image:Max9ToCSChangeToStatic.jpg]] | [[Image:Max9ToCSChangeToStatic.jpg]] | ||
Thats all. Now it should not crash and collision should work. Some credit goes to Razorwind and his | Thats all. Now it should not cause a crash and the collision should work. Some credit goes to Razorwind and his [http://www.silgrad.com/wbb2/thread.php?threadid=6977 3dsmax9 collision tutorial]. You can check it out also, if you find any of my explanations are not clear enough. | ||
===Fixing Texture Paths=== | ===Fixing Texture Paths=== | ||
Browse for every NiTexturingProperty and check | Browse for every NiTexturingProperty and check that the paths in NiSourceTexture are correct, and if not, change them. | ||
===Adding transparency=== | ===Adding transparency=== | ||
Line 145: | Line 147: | ||
[[Image:Max9ToCSAddingTransparency.jpg]] | [[Image:Max9ToCSAddingTransparency.jpg]] | ||
Right click your mesh part which should be transparent, then Node -> AttachProperty -> NiAlphaProperty. | Right click your mesh part which should be transparent, then Node -> AttachProperty -> NiAlphaProperty. | ||
====Additional info about transparency==== | ====Additional info about transparency==== | ||
Right click NiAlphaProperty->Flags. There are basically three ways in which transparency could be done. It depends on mesh which way | 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===== | =====Alpha blending without testing===== | ||
When transparent mesh parts in your model | 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. | ||
[[Image:Max9ToCSAlphaBlendingWithoutTesting.jpg]] | [[Image:Max9ToCSAlphaBlendingWithoutTesting.jpg]] | ||
=====Alpha blending with testing===== | =====Alpha blending with testing===== | ||
To overcome sorting problem, you can enable alpha testing. Setup it like shown | 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. | ||
[[Image:Max9ToCSAlphaBlendingWithTesting.jpg]] | [[Image:Max9ToCSAlphaBlendingWithTesting.jpg]] | ||
=====Testing only===== | =====Testing only===== | ||
And then, if you don't like artifacts around edges, you can choose the same method oblivion trees are drawn | And then, if you don't like artifacts around edges, you can choose the same method in which oblivion trees are drawn: Testing Only | ||
[[Image:Max9ToCSTestingOnly.jpg]] | [[Image:Max9ToCSTestingOnly.jpg]] | ||
Line 173: | Line 169: | ||
==Getting it to Oblivion== | ==Getting it to Oblivion== | ||
Now, when everything is ready, save | Now, when everything is ready, save the nif file, and open CS. | ||
Open "File" menu, choose "Data". | Open the "File" menu, and choose "Data". | ||
Any group of modifications to game is called plugin and saved to esp file. If you want just test your mesh, you can create temporary mod by selecting Oblivion.esm in this list and clicking OK. However, if you have existing mod, you don't need any help from me :) | 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 Cell View select "Tamriel" World Space, then ICWaterfront03 (you will recognize this location). | 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 example). In Object Window, expand "World Objects" -> Static, and select it. Then right click on any object, choose "New" | 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%27s_guide%2C_lesson_1_-_The_Construction_Set_Primer|A beginner's guide - The Construction Set Primer]]. | ||
Good luck! | Good luck! |
Latest revision as of 00:32, 28 July 2008
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):
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.
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.
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:
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".
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.
We are going to use "Export" and not "Export Selected" when exporting with collision, so make sure your scene is clean from anything unnecessary.
Finally, exporting[edit | edit source]
File->Export. Save as type: NIF:
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)
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
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!