Static mesh workflow
Part 1: Static mesh workflow
Part 2: Skeletal mesh workflow
Introduction
This article will describe my Modo-to-Unreal workflow for static meshes. It should work in very early Unreal builds (RoboBlitz) as well as in later ones (2008 October Q&A build).
Modeling
This is the object we want to export, a sink of some sort.
We can leave the planar quads and n-gons. Only triple non-planar polys where the automatic triple might screw up edge alignment.
Texturing
The model has three UV sets: UV1, UV2 and UV3.
The first one is for the tiling base texture.
The second is for an ambient occlusion map, but it will be used as the UV set for the lightmap in unreal.
There is a lightmap guide texture, which helps setting up the UVs.
It’s a 128x128 image, so a square is one pixel, and the dark green would be one pixel on a 32x32 texture. The reason why its important, is that the UV islands need to be at least one pixel from each other and from the edges. That way each pixel has only one polygon over it, and the bilinear filtering won’t smudge over unwanted colors from the neighbors. Also since the lightmaps in Unreal are placed next to each other in 1K textures, so the one pixel distance from the edge will ensure the total separation from other objects.
In this case I plan to assign a 128x128 lightmap, so I used these black pixels as guides.
The third UV set is for detail patterns on the surface.
Smoothing groups
At this point the whole model is contiguous, so open edges won’t interfere with the UV unwrapping process. This has a side effect tho, which is very apparent when we switch to shaded view.
This is quite ugly. Modo tries to smooth all polygons, there are no hard edges. We quickly forget Modo’s solution to this, that outdated “smoothing angle” based method. Instead we will emulate 3D Max’s smoothing groups. It’s called “separated polygon technique” and the basic idea is to separate polygon groups from the rest of the polygons. This way these poly islands will be smoothed separately, and we will get hard edges between them.
First we have to make sure that no hard edges come from the smoothing angle based method, so we set that angle to 89.9 in all materials.
Then we just select the polys we want in one smoothing group, then cut and paste them.
Now we have hard edges, exactly where we want them. The shading is all right, so we can bake the ambient occlusion map.
Collision
We can create a child layer below the current one which will contain the collision hulls. Naming this layer properly is very important, because that indicates to the importer that this data is supposed to be a collision hull.
In U3 as far as I know there are only two possible names:
UCX: General convex geometries.
USP: Sphere primitive.
In UT2004 the names are as follows:
MCDCX: General convex collision hulls.
MCDBX: Box primitive.
MCDSP: Sphere primitive.
MCDCY: Cylinder primitive.
During the import Unreal will try to convert general convex geometries to simpler geometries. In other cases it uses the bounding shape of the suggested type. For example it’s enough to put a simple sphere on a layer with the USP name, the importer will make an ideal sphere around it.
Working with general convex hulls need a bit more attention.
These are simple, closed, convex volumes. Make sure that they don’t touch each other, because that confuses the importer and makes it generate many unnecessary collision primitives. For details on this topic visit the related page on UDN.
Export
Okay, everything is ready to export. Select the layer you want to export. It can have any number of child layers, properly named for collision purposes. Run the ASEExport4Unreal.lua script.
If you run the script without any parameters then it assumes that Modo’s unit system is set to GameUnits, so 1 unit in Modo becomes 1 unit in unreal. It will also show a file requester when saving the object.
You can specify the unit system by using one of the following parameters:
gameunits
meter
centimeter
millimeter
feet
inch
For example: @Scripts\ASEExport4Unreal.lua gameunits
you can also suppress the file requester dialog with the silentsave argument:
@Scripts\ASEExport4Unreal.lua gameunits silentsave
In this case the actual layer will be exported to the “LW content directory” (which can be set in the preferences window). The name of the exported file will be the name of the selected layer.
The exporter exports the following vertex maps (if they exist): Three UV sets, with the names of “UV1″, “UV2″ and “UV3″ and an RGB map called “Color".
Sometimes smoothing groups are not exported properly. A re-export after restarting Modo will fix it.
After a successful export, the ASE file is ready to be imported.
Import
Start UEd. In the general browser select the generic tab and click on file/import. Locate the exported ASE file, and open it. Name the package/group you want to store the object in, and rename the object if necessary.
Double click on the object to bring up the static mesh browser. Let’s take a look at the properties panel:
The LightMapCoordinateIndex is 1 because the UV sets are indexed from 0 in Unreal. Select a shader in the general browser and use the green arrow in the Material input field to assign that shader to the object. (There will be as many elements in the list as many materials are used in the mesh.)
You can check the collision geometries by clicking on the 4th icon on the toolbar.
I made a shader which uses all three UV sets, so the finished object looks like this:
Part 1: Static mesh workflow
Part 2: Skeletal mesh workflow