UDK - Importing Models From Maya as Static Meshes
http://udn.epicgames.com/Three/ContentHome.html
http://udn.epicgames.com/Three/StaticMeshHome.html
http://udn.epicgames.com/Three/ExportingMeshesTutorial.html
http://udn.epicgames.com/Three/ImportingMeshesTutorial.html
About the FBX pipeline for Maya 2012:
http://udn.epicgames.com/Three/FBXStaticMeshPipeline.html
Most models used in UDK are based on "static meshes". Static meshes are models, usually imported from other software. They are called static meshes because they don't contain any animation or rigging data. Even when static meshes are used for moving objects in the game engine, such as an "InterpActor", the static mesh itself doesn't have any animation data.
Static meshes are stored in packages. This means that if you want to work with models created in other 3D applications, you will need to import the content into UDK and save it inside a package. Furthermore, in order to work efficiently and not loose track of what is going on, good organization and naming conventions are important.
There are a lot of different ways to organize assets, and different naming conventions. The ideas presented here are not the only ways to be organized. However, the following organizational strategy and naming conventions will ensure that your content works correctly in game, and is easy to import and save.
UDK stores assets in "packages", and packages should always be placed somewhere inside the content folder, or in a subfolder of the content folder. Packages themselves are like zip files. They can contain many assets and compression is used frequently in order to store the content on disk efficiently.
The default content location for udk is:
C:\UDK\UDK-your-version\UDKGame\Content\
Inside the udk content folder, for each project you create, you should have your own folder:
yourname__project_name__udk
For example, if your name is Joe, and your project is called "house", the folder could be:
joe__house__udk
Here's a breakdown of the folder structure you should end up with
Set project to your maya project
btw: I recommend ending all maya projects with "__maya" so that they can be easily identified as maya projects rather than arbitrary folders.
ex:
yourprojectname__maya
scenes
images
sourceimages
-combine your model or models
(all combined stuff will be one object in udk)
-move the prop so it is at or standing at the origin
-put the prop/character at the origin
-snap his pivot point to the origin
(move pivot mode, hold x to snap to grid)
-delete history
Make sure your model has good lightmap uvs
to make lightmap uv set
select your geometry
push the down arrow on the keyboard to select the shape node
open UV window
select all uvs
polygons > copy uvs to uv set > copy into new uv set
then, layout the new uvs so they are non overlapping, non-flipped, and all within zero to one range.
(you can select uvs and use Polygons > Layout to automatically make them non-overlapping)
name your model or models
get a material on the model
(phong e is best)
(a lambert is ok)
if you want organized materials name them right:
call the materials:skin00_mat, skin01_mat
call the shading group: skin00, skin01, skin02
the reason for this is because they will show up in UDK in this order
(udk understands this naming convention, and will order material appropriately.)
make collision objects
-very low poly
-all convex
-named:
UCX_yourmodelname_01
UCX_yourmodelname_02
UCX_yourmodelname_03
etc.
note: the underscores in the above names are *crucial*
Window > Settings Preferences > Plugin manager
enable the plugin called "fbxmaya"
(check loaded and autoload)
To Export:
Select the object you want to export (select the transform node, which Maya does by default when you click on an object)
Edit > Select Heirarchy (selects all children)
File > Export Selection
For file type choose FBX export
In the options on the right
open geometry section
enable smoothing groups
go to the path of your package, and to its src_udk folder:
C:\UDK\UDK-2011-08\UDKGame\Content\yourname_yourprojectname_udk\src_udk
save it with a good name. Make sure it ends in "__mesh"
eg. your_model_name__mesh
(Note that that two underscore separate the descriptive name from the type name. This is a useful technique.)
-end name with "__tex"
-if they are for a specific asset/prop, name them starting with that asset name
ex: pillar__diff__tex pillar__emis__tex pillar__norm__tex pillar__spec__tex
textures should be powers of two:
1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192
Textures should usually be square, but don't have to be. Sometimes rectangular textures are very useful. They are more challanging to use properly.
regular textures can be targa's or pngs
pngs are better for anything without transparency
targas are better if you need an alpha channel
To import the content into UDK:
Open content browser
click new
name your package just like your folder:
ex: your)name__your_package_name__udk
name your new material just like your asset, but with _mat on the end
yourname_imrod_mat
set factory to material and click ok
the material editor will appear
hit the checkbox (top toolbar, farthest left) and then close the material window
Right click on your material in the content browser
choose: save
goto your packages folder (ex: yourname_imrod_udk )
*don't* change the package name (it should already be yourname_imrod_udk)
click save
Import the mesh by clicking import in the content browser and then choosing your exported fbx file.
A box will appear with import options. Ensure that the correct package name is entered and that the mesh name is correct. If the file you imported was named correctly, then the name should be correct automatically.
All of the default options should be correct for importing static meshes, so click "ok" to complete the process of importing your static mesh.
After importing the asset, double click it to open in the static mesh editor
Enter in a better size for the light map resolution. (It defaults to a very low number such as 32. Reasonable numbers for most objects are anywhere from 64 to 512.) Note that if the resolutions is not high enough, you will have ugly lighting because the texture used for UDK's baked lighting will not be accurate enough. Also note that the higher the resoution you use, the slower the lighting of the object will be when building the lighting for your levels.
512 can be used for very very important objects, but it really slows down the build
256 for large important objects
128 for typical objects
64 for unimportant objects.
To connect materials to your static mesh:
Open the static mesh
back in the content browser, select the material you want to connect to it
go to the static mesh window again
find LOD info in the right column
open up LOD info, open all the sub headings until you can't open any more
you will see "material" slots, with green arrows beside them, click the green arrows to connect the material
You can use the following process to bring a UDK level into Maya. Similar processes will work for most other 3D applications.
Export your UDK scene so you can open it in Maya
Use File Export All to export from UDK
When working on modeling for UDK, start with a gridwith settings all at one.(Length, Gridlines, Subdivisions)If you want to see a larger grid, make thelength/width larger.To match a particular grid spacing in UDKchange the "Grid lines every" setting.
You should import to maya from UDK,and then clean up the imported model.
Import model to Maya from UDKFile Import > find your obj that UDK exportedGo to 4 views if you are in only one viewChange the grid size to work well with udk: Display > Gid > Options Length and Width: 16 Grid lines every: 16 Subdivisions every: 1View > Select CameraChange in attribute editor near clip: 1 far clip: 99999Repeat for other camerasApply a new lambert to your udk geometryNormals > Unlock (obj normals are bad) (Always do this when importing objs to maya)Delete polygons you don't need (double click is useful)
Edit Mesh > Merge > Options
Threshhold = 0.01 Turn off always merge two vertices
Again, delete polygons you don't need (double click is useful)
Select the entire objectNormals > Set Normal Angle Options > Angle=2
Select all the soft edges and delete them.
Select your object
Select all it's edges
Ctrl-F10 (selects all edges from selected object but doesn't go to edge mode)
RMB drag > Edge (mode)
If you have MmmmTools:
MmmmTools > Modeler > Modeler Select Hard Edges
Select Invert
Delete edges
If you don't have MmmmTools:
Select > Select Using Constraints
Choose Smoothing > "smooth"
Choose "All and next"
Delete the edges
Push "Close and Reset" (otherwise you won't be able to select things)
Turn on your viewport culling In View menu use Shading > Backface CullingIf needed > Normals Reverse
Put your udk reference object on a layer, set the layer to "R" mode
Now make static mesh objects (and collision objects) and export to UDK. Things will match up in size if you match them to the reference objects.
If you export something away from the origin, and want to put it in exactly the sameplace in UDK, simply edit the properties in UDK, open the movement section, and set the XYZ values to zero.
If you want to be able to recycle objects in UDK, the best method is to export it from Maya at the maya origin. The maya origin will be the object's pivot point in UDK. You could then move it to the correct location in UDK.