Adverti horiz upsell
Unreal Model Importing: The 3ds2unr Converter
Unreal Model Importing: The 3ds2unr Converter
sdb1987, added 2005-09-08 09:51:41 UTC 35,795 views  Rating:
(0 ratings)
Page 1 of 2

Developed by Legend Entertainment (Creators of Wheel of Time)
Programmed by David Townsend
townsend@patriot.net


Tools you need

To create animated models for Unreal mods, you will need the following tools:

1. A good 3D modelling/animation package, such as 3D Studio Max, Lightwave, SoftImage, or Alias PowerAnimator. Our converter currently only supports 3D Studio Max.
2. A model conversion tool which converts your models from their native format (for example, the converter available here unfortunately only supports 3D Studio Max) to Unreal's format (Aniv*.3d, Data*.3d).
3. UnrealEd. The beta version shipping with the game will do the job.

Notes:
Currently the only converter available is the 3ds2unr converter, this means that you'll have to get you maya files converted into the 3ds format.
Programs that'll allow you to do that is:
polytrans from www.okino.com
Interchange from www.viewpoint.com
3Dwin from https://www.stmuc.com/thbaier/products.html
or in a pinch Rhino3D can do it (from www.rhino3d.com)

Required Reading

To be able to take advantage of this tool, you need to become familiar with:

1. The contents of this document.
2. How UnrealScript works (for writing code to control the models). See the UnrealScript Reference.
3. How Unreal packages work, specifically how to rebuild scripts from .uc files using "Unreal.exe -make". See the Package Reference.
4. The UnrealScript #exec commands for importing meshes, scaling them, and assigning names to animation sequences. These haven't been documented anywhere, but there are hundreds of examples in the code. See the Skaarj, Brute, and AutoMag scripts for examples.

Next, be aware that importing animations into Unreal has proven to be the trickiest aspect of Unreal content creation, because of the multiple tools that need to be used (a 3D modelling program, 3ds2unr, and UnrealEd), and because of the large number of steps that need to be followed carefully in order to successfully import and use a model in Unreal.

Files you'll deal with

For the sake of clarity, here are the files you'll be dealing with:

* *.3ds: Your converted Maya file, which includes: Your model. Your animation frames. Your texture coordinates.
* Aniv*.3d, Data*.3d: Two intermediate files generated by 3ds2unr.exe. Suitable for importing into UnrealEd.
* *.uc: Your UnrealScript class definition, which contains #exec commands for importing your mesh. A text file, generated either by UnrealEd (when exporting a class) or by any text editor you might use to author it.
* *.u: Your Unreal class file. A binary file containing all the data: the class and script code, the mesh, any sound effects, etc. Generated by "Unreal.exe -make"

Downloading the utility

Here is the 3D Studio to Unreal converter, including the utility (3ds2unr.exe), quick documentation (ImportingModels.doc), and the source code. The source code compiles with Microsoft Visual C++ 5.0 using Service Pack 2. We haven't tested with other compilers, versions, or service packs. The source code is unsupported and is provided as-is. Enthusiasts have permission to modify and redistribute the code on a non-commercial, not-for-profit basis.

* Download it

Here is an example of some of the cool things people could do by modifying the source. :)

* Make converters for other file formats, such as Lightwave, SoftImage, and Alias PowerAnimator.

Modeling

Models must be made up of a single object, which lives within the 256x256x256 coordinate space centered on the origin. (Setting the grid extents to �128..128 and turning on the grid is helpful here.) The model itself should be centered on the origin (0,0,0) because of how Unreal specifies the collision cylinders used to determine when objects are touching.

Models will lose some precision when imported. Specifically, X and Y coordinates are truncated to the nearest 1/8th (0.125) unit, and Z coordinates are truncated to the nearest 1/4th (0.25) unit.

One 3DS coordinate equals 6" in Unreal X and Y coordinates, or 12" in Unreal Z coordinates. You generally don�t have to worry about this scaling, as the model can be rescaled when it�s imported into Unreal.

Object polygons shouldn�t intersect. The hardware supported by Unreal gets confused when polygons intersect, resulting in an unpleasant shimmering.

If your object is a character that will be carrying a weapon that will be separately modeled, place an extra polygon (the weapon triangle) in or on the part of the character where the weapon should be. This polygon will be invisible in the game; it�s just used to sync the weapon�s position with the character�s animation.

The conversion tool will only convert objects with sequence numbers in their names (Obj01, Obj02, ...). The object name itself is meaningless; it�s the sequence numbers that count. They must begin at 01 (even if that�s the only frame!) and you can�t have any "holes" in the sequence.

Objects that won�t be animated (e.g. 3rd person weapon views) should be in their own .3DS file (e.g. save the angreal of healing as AngrealHeal.3DS).

Animation

Make sure that all animation frames stay entirely within the 256x256x256 coordinate space.

The Unreal animators are typically designing their animations for 30-35 fps playback. Then, to save memory, they shave the animations down to 15-17 fps and let Unreal do the tweening.

Objects that are animated should have a separate .3DS file for each animation sequence (Run.3DS, Walk.3DS, Shoot.3DS, etc.). You probably want a separate directory for each animating character, so that each can have it�s own Run.3DS sequence.

Texture Mapping

There are several pre-defined material names that you can use to get special effects when the model is imported into Unreal. The special names are:
SKIN This texture will be assigned as the model�s Skin property in Unreal. Skin textures can be replaced easily at runtime (to show increasing damage, for example) and are the basis for Unreal�s corona effects.
TRANSLUCENT The polygons mapped with this texture will be marked as translucent, and can have their transparency set by the program. Wheel of Time uses this to get the transparent globe on the Shield angreal.
TWOSIDED The polygons mapped with this texture will be marked as two-sided, so the texture mapping will show up on both sides of the polygon. Wheel of Time uses this for the characters� cloaks.
WEAPON The polygon (there should be only one!) mapped with this texture will be marked as the weapon triangle. So it won�t be visible

Note that this naming convention applies to the material name itself; the filename of whatever TGA file you use as the bitmap is irrelevant.

Converting to Unreal Format: Preparation

You�ll need a copy of the 3ds2unr.exe conversion program, plus some way (Photoshop, Debabylizer, etc.) of converting TGA files to PCX format. A text editor (Notepad will do in a pinch) is also handy.

The conversion program expects an Unreal-like directory structure to exist before it will run. Specifically, you need:

1. a main Unreal directory (mine is c:\Unreal), below which is a
2. project-specific directory (for example, c:\Unreal\WOT), below which are
3. two directories, Models and Classes (e.g. c:\Unreal\WOT\Models and c:\Unreal\WOT\Classes)

This directory tree is what Unreal itself expects, so it may already be set up. If it isn�t, you�ll have to make it yourself before doing any conversions.

The converter is a Windows console application, meaning it runs by typing rather than pointing and clicking. Make sure that the 3ds2unr.exe program is somewhere in your DOS path before you begin.