*****Work in progress******
I'm working this up fo PHod, but thought I'd post it for anyone else who's interested. Its a short, step by step tutorial on how to import a .obj file intto Gmax and make a NWN ready model. Its setup for the submarine but the basics should let you import any obj model file into the game. From start to finish, with practice, it takes about 30 minutes.
It should also work with anyother imported 3d model you can bring into gmax as well.
Since I've only been working with NWmax/ gmax for a couple of months, I'm sure that not everything here is perfect. Corrections and comments from more experienced members are welcome, keeping in mind the basic purpose of the walkthru and the fact that it does work as intended.
1) You will need a)Gmax
b)NWNmax
c)The gmax obj import script that can be found many places including
here d) A donor mdl to start with.
e) A obj 3d model set which should have the obj file, a texture and a mtl file. Wavefront obj is a common 3d model format and many 3D editors can use it or convert to it.
2)Download and put the obj import script in the gmax scripts folder. Start nwnmax/gmax. On the NWNmax panel, expand the "MDL Loading" section, click the browse button, find the mdl you've decided to use and import it. I'm using a simple placeable NWN2 imported building from the Vault. It has no destruct, death, etc animations to it.
3) Click on the parts of the model and delete everything except the aurora base and ngon. Clicking on the "Select by Name" icon on the top bar will show you everything in the current project. If you want, you can save this now and reload it later as a good starting point for future projects. Rename the Aurora Base to fit your project. In this case, "e2_sub"
4) Now on the right bar, click on the hammer tab, then the "Maxscripts" button. On the utilities section, you should see the Wavefront OBJ import script listed. Click on it and start it.
5) Scroll down and you'll see an import button. Click and browse to your obj file and import it.
6) The obj is now in the project. In this case, you can't see it because it's very small compared to a NWN item. Left click on the bottom left view window to select it (grey box around it) and expand it to full screen with the min/max button on the bottom right corner.
7) Zooming in with the mouse wheel, you can now see the sub, standing upright.
Since the sub imported at the wrong angle, we need to rotate it. Left click on the sub to select it, then left click the "Select and Rotate" button to select that and finally right click the button to bring up a popup window. Change the X value to 90 to rotate the sub 90 degrees.
9) now the sub is the right angle but is still way to small. Left click the "Select and Uniform Scale" button on the top bar. By trial and error I've found that all E2 models need to be increased by an acerage of 13,000 time to be close to NWN size. Increase the X/ Y/ Z vlues to 13,000. Changing the values in non uniform numbers can stretch the model in different ways from the original. You'll notice the 2 black lines crossing the view. The horizontal line will be either your X or Y axis depending on your view. Usually you'll want your mesh to rest right on this as this will represent ground level in the game. Since the sub is preset to be partially underwater, half of the mesh is below the line.
If the mesh does appear too small in the game (as did happen with the sub) reopen the save you should have made right before export. On the NWNmax panel, expand the "General Utils" section and hit the "Scale Wizard" button. Increasing the size precentage here will increase the size off all items in the mesh at once. I had to increase the sub by another 600% to get it to about the right size.
10) Clicking the min/max button again will show you all 4 default view windows again. On the NWNmax panel, expand the "Mesh Tools" section and click on the "ResetXForm" button. This finalizes the changes you've made to the mesh. The scale will go from 13,000 of the old size to 100% of the new size.
11) Right click the sub in one of the views to bring up a popup window. On the bottom right of the popup, select "Convert to Editable Mesh.
12) On the right panel with the Modify(rainbow) tab selected, click on the vertex button to show all the verices of the mesh.
13) Click on the edit selection on the top bar and the select all choice from the rollout. All the vetices will turn red to show they're selected.
14) Scroll down on the right panel till you see the weld mesh section. Clicking on the "Selected" button will merge/delete duplicate vertices within the distance shown on the mesh. This will bring your poly count down and fix some possible mesh errors. Click the Reset XForms button on the NWNmax panel again. You should only do this when the mesh is the proper size for the game - a very small imported mesh could lose to many polys before the resize and be missing needed parts. Before melding might be a good time to save your work.
15) On the right panel, cllick on the "Create" tab and then the "Helpers" button under it.
16 ) Left click the "Dummy" button and then click and hold down the left mouse button on the middle of the sub in the top down view. Move the mouse to expand the box that forms until its a little bigger than the sub - size isn't that important. Release the left button and right click to set the dummy. This will be the 1st part of the sub's PWK. Click the Modify tab and rename the dummy "e2_sub_pwk. On the modifers rollout, select "AuroraPlaceable" from near the bottom of the list.
17) To form the 2nd part of the pwk, hit the Create tab on the right panel and then the Geometry button below. For the sub, we'll use the simple box shape. Click the box button. Below, leave the width segment at 1 but change the length and height segmanets to 3.
On the top down view, move the mouse pointer to a corner of the sub, hold down the left mouse button and move the mouse to form a rectangle around the sub. release the mouse button and move the mouse towards the top of the screen to raise the walls of the box. At a height about equal to the sub, right click and set the box.
18) As with step 11 above, select the box, convert to editable mesh and select vertices. Now though, click on a vertex and move it by holding down the left mouse button. Moving the vertixes one by one, we'll shape the box to closer fit the shape of the sub. Hit the ResetXForm button on the NWNMax panel to finalize the shape.
19) On the Edit button at the top , select the "Clone" option from the rollout to make a copy of the box. Name the copy "shadow".
20) The "shadow" box will be what actually casts the shadow of the object in the world. Very complex objects wth their own shadow can slow/ crash the game. Select the Modify tab on the right panel, add the "AuroraTrimesh" to the shadow and make sure "shadow" is on and "render" is off. For the sub itslef, reverse this - add the AuroraTrimesh modifier, turn on render and turn off shadow.
21) Repeat step 15 from above but make a small dummy next to the side of the sub. Rename it "sub_pwk_use01" . This will be the spot the character will move to when he tries to use the sub if its not static.
22) About the last thing to do is link all the items togeher and to the base. Click the "select and Link" button on the top panel. Usually the top view is best - expand it and left click and hold on an item and drag to an item you want to link it to. Link the box and the usenode to the pwk, link the pwk, the sub and the shadow to the base. Click the "Select Object" arrow on the top bar and then the "Select by Name" button to see all your items. With the subtrre option clicked on the bottom of the popup, you'll see what's linked together. You can undo a link and relink if you have anything incorrect.
23) Last, save your work and select the Aurora base and export the mdl. Set the classification to character and hit the export button. Since there's no animation present, it shouldn't mater which button you choose. You should now have the mdl and pwk for the sub in your output folder. Add the files to your hak and a new entry to your placeables.2da and you should have the sub in the game.