Site hosted by Angelfire.com: Build your free website today!
 


19. Convert LightWave Object to 3D Studio Max Mesh
 
Previous   Table of Contents   Home   Next




THE TOWER OF BABEL

In a perfect world, you would export a LWO LightWave Object as a 3DS 3D Studio Max mesh, and no matter what that LightWave object might be the 3DS mesh in 3D Studio Max would render exactly as the LWO did when it was back in LightWave.

Ha, ha, ha, ha, ha, ha, heh... heh... (clears throat)

Uh, excuse me. I had to laugh there.


WHY DO I NEED TO CONVERT LWO INTO 3DS, ANYWAY?

Well, because LightWave has a better modeler interface, for one. Second, it is easier to do many things in LightWave than it is to do the same thing in 3D Studio Max.

However, 3D Studio Max has lots of plug-ins available. Sometimes plug-ins that are impossible to find with LightWave 3D.

And, third, 3D Studio Max is oftentimes the program you work at when at work, and LightWave when you return home (because LightWave is the FUN one to use whereas 3D Studio Max caught on in the game industry, and then spread like a grease fire to other places.

In this PARTICULAR case, I would like to extend the last tutorial to having the capability to put my little figurine up on the internet, hopefully with surface maps of the textures, and then let the viewer rotate it.

That sounds like a worthy project, so lets begin.


PREPARING LIGHTWAVE OBJECT FOR 3DS EXPORT

LightWave has an export module which exports LightWave Objects from Modeler and saves them as 3DS (a 3D Studio Max Mesh format).

That implies a few things, already. First, a mesh is tesselated, which means it is composed of three-sided polygons, also called triangles.

LightWave Nurbs Subsurfacing isn't a mesh at all. It is Nurbs, which really has no correlary. Nurbs are unique. Luckily, Nurbs (Subsurfaces) can be converted into polygons in LightWave.

But, lets say you didn't know that 3D Studio Max meshes were triangle polygons... The first step with anything you do with an computer is 'Try it, and see if it works'. Then, depending on what error messages you get once you do it, that may give you a clue as to what to do.

So, lets do that. Load the latest version of the figure.lwo that you have into LightWave Modeler.


REMOVING SKELEGONS

You won't need skelegons, so go into polygon mode by pressing CTRL-h. Magnify until you can make out the skelegon shapes (making sure you're in WireFrame View mode), make sure no polygons are selected, drag the mouse across the edge of a skelegon until it is highlit.



Try pressing the ']' key to 'Select Connected' skelegons, then hit 'Delete'. If that doesn't delete all skelegons, then do it again with the ones which are left. After they're all gone, do a 'File->Save Object As...' or press SHIFT-S and save it as 'figure, no skelegons.lwo'.




CONVERTING A SUBSURFACE INTO POLYGONS

You convert subsurfaces into polygons by selecting 'Freeze' from the 'Construct' tab, 'Convert' section. However, it can be astounding how many polygons are created when you Freeze an object.



When I select all of those polygons, there are 13,752 of them. Also, when it created polygons, it created FOUR-SIDED polygons, NOT TRIANGLES. And, you would think that it wouldn't increase the number of polygons that much going from 4 sided polygons to 3 sided, but there are TWO TRIANGLES IN EVERY RECTANGLE. That means that if you convert four-sided polygons to three-sided ones, you DOUBLE THE NUMBER OF POLYGONS. That would mean there would be 27504 polygons in our figure. There has to be a way to remove some of those polygons.


REDUCING NUMBER OF POLYGONS, CONVERTING TO TRIANGLES

There is a handy tool with an awful name. It is called 'qemLOSS2' and can be found under the 'Construct' tab in the 'Reduce' section.

Make sure all polygons are de-selected (implying 'All Polygons') and click on the 'qemLOSS2' button. Under 'Goal (# of polys or .5 for 50%) put 0.05, and under 'Preserve Mesh Quality' click on 'Yes'. (Meaning that there will only be 5% of the original number of polygons left after it has finished doing the qemLOSS2 function. Not only that, but it creates TRIANGLES so this will be perfect for exporting to 3D Studio Max.



Since the surface texture maps are what give the figurine its quality, the loss of polygons should do nothing to damage the end illusion. It now says there are 1302 total polygons, down from what would have been over 27,000 polygons; and, they're TRIANGLES to boot.




REPAIRING SURFACE NAME DEFINITIONS

Next, with such massive reconstruction of our polygon structure, we can't ensure anything about what happened to our 'FrontPolygons' and 'BackPolygons' definitions. After all, LightWave isn't psychic. It can try and do what it thinks is 'the same' when it did the reconversions to less polygons, but it's almost ensured that it didn't do all of them right.

By now you should know how to select all of the polygons which have been defined as a 'Surface Name', but to review... First, make sure all polygons are de-selected. Press the 'w' key while in the Polygon mode to bring up the 'Polygon Statistics' panel. Click where it says 'Surf' and choose 'BackPolygons'. Click on the plus sign to the left of where it says 'Surf' to select those polygons.

Go to the 'Perspective' viewport and select either 'Wireframe Shade' or 'Sketch' as the view type (whichever works better for you). This will allow you to see both the edges of the polygons, and the surfaces. Rotate the body so you can see the back of the head and ensure that all polygons which should be the back of the top of the head are part of the 'BackPolygons' Surface Name definition.



If any are not selected, select them by holding the SHIFT key down and dragging mouse across the edges of the polygons you wish to highlight. Make sure that no polygons that you don't wish to be selected are included, as LightWave does not give you a way of subtracting a polygon from a Surface Name (that I know of).



To add those polygons to the 'BackPolygons' Surface Name definition, press 'w' to bring up the 'Polygon Statistics' panel, and select 'BackPolygons' from the drop-down menu. Click 'OK' to make the panel go away.



Save the changes to the object by pressing the 's' key (with the Caps Lock OFF). You'll see the hourglass cursor until it is done saving the changes.


MODELER, EXPORTING LWO AS 3DS MESH

Now it is time to see if the LWO file will convert properly the way it is. Try 'File->Export->Export 3DS'. Type 'figure' in the 'File Name' box.



After clicking 'OK', it gives a warning about a texture map file having a 12 character limit, however, the name of the map is 'Back Map2.bmp' which is 12 characters if you count the space and the period so I guess it counts periods as well.



That means that 'Back Bump.bmp', 'Front Map 2.bmp', and 'Front Bump.bmp' are all too long, so we'll have to change them.

So, I find them, then change the names to BackBump.bmp, BackMap.bmp, FrntMap.bmp and FrntBump.bmp, then I change the old file definitions to the new ones by going to the 'Image Editor'. Click on the 'Name' you wish to change by picking that name from the list at the left, then click 'Replace' and choose the new image filename.



After you've replaced all four images, the Image Editor Name list should look like this.



Now, lets try exporting it again. I do a 'File->Export->Export 3DS...' and choose 'Figure.3ds' again, agreeing to overwrite it. Next I get a '3DS Export Options' window. Since the default is 'Apply Rotation', I should just try that to see what it does. It may be automatically fixing the improper Z/Y axis thing all by itself.



Tah Dah. I have now saved out a .3DS file. I switch to 3D Studio Max. I do a 'File->Import...' and choose '3D Studio Mesh (*.3DS, *.PRJ)' from the 'Files of Type' drop-down menu.



Choose the default, which is to merge the object with the current scene.



Well, a big success in that it actually imported in the figurine, but that's definitely not the right rotation.



Well, lets try it again, only this time I'll try turning off the 'Rotate' checkmark.



From 3D Studio Max I do a 'File->New' and it says, 'The Scene has been Modified, Do you want to save the changes'. I say 'NO'. Then I do a 'New All'. 3D Studio Max wipes the slate.

Again I do an import into 3D Studio Max. Yep, it's a different orientation all right, but not the right one.



Well, there's one more choice, and that's 'Custom'.



There are some values already in the custom section, so let me try 90 degrees for heading, and 180 degrees for pitch and see if that tells us anything. When I do that, it turns out that its first rotation that I did when I had the checkmark on the 'Rotation'. So, possibly, whenever you use the custom setting, that is the one that's used the next time you click on the Rotation checkmark (which seems to be the default). Lets see if I can figure out which was rotated 180, and which 90. That may tell what I should put in for the values to get it standing upright.



So, the one on the top is what they're calling 'no rotation', and the one on the bottom is what they're calling a heading rotation of 90 degrees and a pitch rotation of 180 degrees.

When you just put in a 90 degree bank, it turns 3D Studio Max's 'Top' view 90 degrees counterclockwise. When you put in a 90 degree pitch, it turns the 'Left' viewport 90 degrees clockwise. When you put in a 90 degree heading, it turns the 'Front' viewport 90 degrees clockwise.

Therefore, when you put in 90 degees pitch, and 0 degrees heading and bank then the back of the object is facing towards you.



Which, because I always turn around my LightWave objects so the back and front are swapped, means it will be looking at you. I press 'F9' in 3D Studio Max and the scene trys to render, but I get a warning...



This just means that there are two objects, one called FrontPolyg and another called 'BackPolygo' that currently have no 'Map Coordinates' to associate them with the two planar map images called 'Front Map' and 'Back Map'. I'll do that later. At the moment I just click 'Cancel' and it renders gray, without any planar maps.



No, it doesn't remember what values you put in last time, and the 'Apply Rotation' checkmark stays checked when you do the other 'Custom Rotation'. The surface is not smooth, so lets start with that then.


In a moment we will see that LightWave's 3DS export has actually created two objects, not one. It LOOKS like one object because it is all white at the moment.


SCHEMATIC VIEW

Go to the 'Graph Editors' menu, 'Schematic View->Open Schematic View'.



You will see three names there. 'Default' is nothing, if you'll remember. LightWave always puts default there. So, the real ones have had their names chopped to 10 characters. They are 'FrontPolyg' and 'BackPolygo'. Beware if, back in LightWave, you have named Surface Names such as 'Mexican Figurine Body', 'Mexican Figurine Head', etc. or you would be in trouble now.

Since 'Schematic View' is listing the objects in your scene, that means that LightWave has created two objects named 'FrontPolyg' and 'BackPolygo' from the two LightWave 'Surface Names'. This is important, as it means that they are not two named parts of one object, but are two objects, separate from each other.

Since 'Default' was not really a 'Surface Name' at all, you can double-click the 'Default' icon in the 'Schematic View' window and then press the 'Delete' key to get rid of it. (You could also have selected the 'Default' by clicking on it, it would turn yellow, then you could have clicked the 'Delete Objects' icon which has an X on it).

If you single-click the 'FrontPolyg' object, then right-click and choose 'Properties...', you will see that under 'Material Name:' it says 'FrontPolygons' (full name).

If you single-click the 'BackPolygo' object, then right-click and choose 'Properties...', you will see that under 'Material Name:' it says 'BackPolygons' (full name).

Double-click the 'BackPolygo' icon. The icon will turn yellow, and the back polygons will become selected.



Double-click the 'FrontPolygo' icon and the front polygons will become selected. This is sort of equivalent to pressing 'w' in LightWave, choosing a Surface Name, and clicking the plus sign.



IMPORTANT - You can't select an object in a viewport if it is in wireframe mode.

You must be in some other mode where the surfaces are visible such as 'Smooth + Highlights' or 'Facets' in order to select an object by clicking on it. If you right-click where it has the word 'Top' in the 'Top viewport and select 'Smooth + Highlights' as the view mode, then click with your left mouse button towards the back of the object, you will see the back polygons become selected in the 'Left' viewport. If you then click the front part of the figure in the 'Top' viewport, the front polygons become selected in the 'Left' viewport.

If you have the 'Schematic View' window open when you do that, you will see the object selection switch from 'FrontPolyg' to 'BackPolygo' as you select those objects.

You can set the 'Top' viewport back to 'Wireframe'.


Lets look at what else the Schematic View can show us.

Lets modify things a bit by clicking the 'Filters' icon in the far upper-left of the 'Schematic View' window

Turn on the checkmark on 'Show: Maps', and the checkmark on 'Hide by Category:', 'Geometry' and 'Shapes'.



Click 'OK' and everything disappears in the window. Again click on the 'Filters' icon and turn off the checkmarks on 'Hide by Category:', 'Geometry' and 'Shapes'. Click 'OK'. Now you should have two object names with red arrows beneath each of them



Single-click with your left mouse button on each of the red arrows to unfold the tree structure one-by-one.



From this you will see that LightWave has created two separate objects called 'FrontPolyg' and 'BackPolygo'.

Click on the magnifier

... if you can't read the whole name in a box. After selecting the magnifier, click in the window while dragging the mouse to zoom in or out.



The object called 'FrontPolyg' is parent to a Material called 'FrontPolygon', which is the parent to the two maps, 'Diffuse Color: Map #5 (FrntMap.bmp)' and 'Bump Map #6 (BackMap.bmp)' for the 'FrontPolygons'.

From this I notice that either I made a mistake and chose the BackMap.bmp file (Which is supposed to be the Diffuse Map for the Back) as the image for the Bump Map, or LightWave has chosen the wrong image as the Bump Map for the Front (which is much less likely).

Green has to do with Maps. There is a similar tree for the 'BackPolygo' object.


THE MODIFIER STACK

You will be adding modifiers to each of the two sets of polygons which comprise these two objects.

Lets start with the front polygons. Select the 'FrontPolyg' object by double-clicking on the name in the 'Schematic View'.

Go to the 'Command Panel' and click on the 'Modify' Panel icon


In 3D Studio Max, you generally make modifications to your objects through the 'Modifier Stack'. In this case, we now have what is called an 'Editable Mesh', but I'd now wish for that mesh to be smooth.

In 3D Studio Max, modifications are done to sets of polygons. Just below where it says 'Modify List' it will now say 'Editable Mesh'.

From the 'Modify List' drop-down menu, under 'Mesh Editing' select 'Smooth'. 'Smooth' will appear in the area just above 'Editable Mesh'. The modifier is added above the currently highlit modifier (which in this case was 'Editable Mesh').



This is what they call the 'Modifier Stack'.



Press 'F9' to render the scene. Again it warns me about the missing map coordinates.



I click 'Continue'. I find that the image hasn't changed.



To make the front surface become smooth, I need to do one more thing. I look at the bottom of the 'Modify Panel' under the 'Parameters' Roll-out and check the checkbox which says 'Auto Smooth'.



This time when I press 'F9', it renders smooth.



And, we're up around 30 pictures, so this will need to be continued in the next tutorial, which will be on 3D Studio Max Texture Mapping.

Do a 'File->Save As...' and save the scene as 'figure.max'.

Previous   Table of Contents   Home   Next