|
|
|
|
|
Please take note! For mod developers working with Unreal Tournament 2003, this documentation is meant to be a starting point for your own explorations into UT2003, not a definitive guide. There will be differences between the documentation here and the product in your hands, and you may have to figure out quite a bit for yourself. Check out the Unreal Tournament 2003 page in the Unreal Powered area for links to community sites if you're having problems. UDN is a licensee support site, and cannot provide technical support or game-specific assistance to end users.
|
|
|
|
UnrealVertexAnimation |
|
|
|
|
|
Licensees can log in.
Interested in the Unreal engine? Check out the licensing page.
Questions about UDN itself? Contact the UDN Staff.
|
|
|
|
|
|
|
|
|
Originally created By Al Reed (Main.DemiurgeStudios).
The vertex animation pipeline requires a bit of simple programming to get meshes into the engine. The animation do not show up in the animation browser, as with skeletal animations. For this reason, this tutorial will be targeted at programmers, not artists.
Vertex meshes are significantly different than static meshes and skeletal meshes. To recap, we'll quickly go over the three.
- Static Meshes: The most simple of the three, both in creation and implementation. These meshes can not deform in any way.
- Skeletal Meshes: These meshes are hooked up to an underlying, invisible support structure of bones. As the bones move, the weighted vertices are moved as well.
- Vertex Meshes: The most flexible of the three types, this allows for heavy mesh deformation or subtle control, by manipulating the position of individual vertices over time.
Unfortunately, vertex animation on a skeletal mesh isn't possible, so a choice should be made in the design process as to which type of mesh a model will be. Keep in mind that vertex animation can be very time consuming, so this should be factored into your decision making processes as well. Characters should always be skeletal meshes, most environments will be made up of static meshes. Vertex meshes should be used for fluid or clothlike surfaces, such as flags flapping in the wind, that demand fine control over the mesh which would be expensive when using skeletal animation. They could also be used for models that require heavy deformation - imagine organic, pulsing walls.
To export a vertex animation and mesh, open up ActorX in your favorite modeling program. Set the following options according to your needs. The remainder of the options do not do anything for vertex animation.
For output folder, you will want to specify a subdirectory of the code-package you want the model to reside in called “Models” or something like that. For example, if you wanted to use this model in a “Guns” package, you might store it in …/< YourGame >/Guns/Models.
Fill in this field with the name of the animation. This will also end up being the name of the mesh file name, though you can change that later.
In this field put the range of frames you would like to export. For example “0-10” would export frames 0 through 10. Note that the similar field that is not in the Vertex Animation section of ActorX, “animation range” is ignored and should not be used for vertex animations.
If you want to export multiple animations for a single model, first export one animation, then for each additional animation, leave this box checked. The animation data will be appended to the end of the previous animation. When we setup the script file, we’ll separate the full animation file into separate animations
Once you have the options set, click the “Export” button in the Vertex Animation section of ActorX. Clicking this button will create two files in the folder specified by the “Output Folder” field called <AnimationName>_a.3d and <AnimationName>_d.3d. The _d file is actually the mesh, and the _a file contains animation information.
</noautolink>
To import vertex-animation meshes you will need to put a series of “#exec” commands in a script file. This will cause the animation data to become imported into the .u file when the package containing the script is compiled.
MESH IMPORT
Create a script file and use the following #exec command to import your model
#exec MESH IMPORT MESH=<SomeNameForYourMesh> ANIVFILE=..\<PackageName>\Models\<_A.3d Model File> DATAFILE=..\<PackageName>\Models\<_D.3d Model File> X=<OffsetX> Y=<OffsetY> Z=<OffsetZ>
MESH ORIGIN
Next, you will want to specify a default origin and rotation for your mesh using this #exec command:
#exec MESH ORIGIN MESH=<SomeMeshName> X=<OriginX> Y=<OriginY> Z=<OriginZ> ROLL=<RollOffset> PITCH=<PitchOffset> YAW=<YawOffset>
The ROLL, PITCH and YAW parameters are specified in the range of -256 - 256. -64, for example will rotate counter-clockwise 90 degrees. X,Y, and Z are in Unreal units.
MESH SEQUENCE
For each animation you import you will need to specify which frames in the animation file correspond to animations you will later be able to play. It is possible to have multiple animations that use the same frame, if desired. Generally, it is useful to define one animation to be every frame in the file. Here is how you would create that animation:
#exec MESH SEQUENCE MESH=<SomeNameForYourMesh> SEQ=All STARTFRAME=0 NUMFRAMES=XXX
Make sure the value in the MESH parameter is the same as the one in the importing exec above. SEQ is the name for the animation. For each animation you will want to create one of these lines. If you’re not sure of the number of frames, or the start frame for an animation, just import them all, fire up UnrealEd and look at the “All” animation. More on how to view meshes in the next section.
TEXTURE IMPORT
Next you will need to import the textures into the .u file so they can be assigned to the mesh. The following exec command handles that part for you:
#exec TEXTURE IMPORT NAME=<TextureName> FILE==..\<PackageName>\Models\<TextureFileName> GROUP=<SomeGroup>
This command will put the texture into the .u file where it can be viewed and used from the texture browser in UnrealEd or in other #exec commands, or in script itself. You will need to call this multiple times if your mesh has multiple textures assigned to it.
MESHMAP SETTEXTURE
Finally, you will need to assign each texture to the mesh. This exce command accomplishes that:
#exec MESHMAP SETTEXTURE MESHMAP=<SomeNameForYourMesh> NUM=<MaterialID> TEXTURE=<TextureName>
You will need one of these lines for each material id used by the mesh.
DefaultProperties
In the default properties of the script file, you will want to assign the mesh you’ve imported to the actor described by the script file. Do so, by putting the following line in the defaultproperties section of script file.
<verbatim>
Mesh=Mesh'ThisPacakge.MeshName'
</verbatim>
Save your script file and compile the package as you normally would. You will see the compiler importing the mesh.
To view the imported mesh in UnrealEd open the Mesh browser by clicking on the Mesh Browser button: .
|
|