Everything in this demo is the work of Nate Aschenbach.
Skeleton was built for compatibility with Unreal Tournament 3.
Coda's Maya Scripts
ActorX is the tool from Epic Games for exporting models to UT3
Going into Coda, I knew the characters would be a lot of modeling work involving complicated normal map generation within Maya. Furthermore, I knew that these characters would need to be described in complicated initialization files for the Unreal engine. I had already amassed a collection of separate helper scripts for my modeling tasks, and decided to combine them into one evolving toolset narcissistically named "DenreiMaya".
The scripts are all written in Python rather than MEL now that Maya fully supports the language (and incorporating pyMel recently has been really great). The idea is that you can keep working on your original low and high resolution objects, and have the changes automatically migrated to the point of exporting into Unreal. You can rapidly make tweaks to the meshes at any stage of the development and see the results quickly without the vulnerability of human error.
It is not uncommon to create a model, prepare all the textures, set up the joints and skin weights, then finally export to the engine only to notice a few minor flaws which would require the artist to go back to step one in order to tweak some of the vertices and UVs on the low res mesh. Normally this would mean going through the process of rebaking maps, reweighting the mesh and tons of little tasks along the way... all of which are exhausting to deal with and open the door to more mistakes.
The workflow for these scripts was designed so that the artist could hit the "Export to Game" button at any time, and the scripts would be able to reevaluate every element of the character model upon export.
The script intelligently guides itself through the following steps before the exported file is created:
- Source low resolution meshes are triangulated and merged
- Low resolution meshes are matched up with their high resolution brothers
- Normal, diffuse, alpha and ambient maps are baked
- Meshes are mirrored about the look axis where appropriate (hands, feet, etc)
- Skin weights are copied from a weight source mesh to the new low res meshes
- Resulting bound meshes and skeleton are reoriented to an Unreal friendly space
- Unreal ini files are generated and placed in the proper spots to define the character and his different customizable parts
There would not be much point to using these scripts if the artist needed to be too verbose when trying to use them. To this end, convenient Maya layers are used to organize and distinguish the different groups of meshes. This turned out to be very useful in working with complex relationships between high and low resolution meshes, and is a process the artist is likely to go through anyway. The meshes can be quickly moved around as the artist makes creative changes, and each mesh remembers where it needs to be when the scripts want to bake out their texture maps.
The intelligent rebinding of the mesh to the skeleton is one of my favorite features, and was the most difficult to complete. The "skin weight source" mesh can be of arbitrary topology and include any number of separate influences, which are then all combined and copied onto the new mesh that has been automatically passed in from the earlier steps. Optimizations such as max influences per vertex and small weight pruning are introduced here as well.
Any number of animation sequences are defined by simply clicking a button and giving a name and frame range. The scripts take care of the rest on export . It can handle actions such as baking the animation from the rig when needed, or reorienting to line up with different animation sets. This has proven extremely useful as some scenes would end up having several complex sequences that I would go back to frequently edit and tweak. The DenreiMaya tools are all very friendly with Dennis Lindberg's UT3 community rig, but by no means require it.
In addition, the scripts provide a few animation tools which I use in my work. Animation can be intelligently mirrored across a rig on a per-frame basis or in batch. An extension of this functionality is used in the animation-cycling tool. Walk and run cycles can be quickly created by animating the first half of the motion which is then mirrored across the character and seamlessly cycled for playback and export.
The scripts are written in a very clean and modular fashion. Adapting them to use an exporter for some other game would be trivial. In the past, the most recent version of the scripts and tutorials have been kept on the CodaMod wiki. These are now out of date, please contact me for the latest version.
Lithium was a set of scripts I wrote in MEL for StolenNotebook's projects. The goal of the tool was to allow game specific information to be described on Maya nodes in a way that our engine would understand. The nodes would refer to general use scripts written in Python by the programmers on the project and behavior could be created completely within a Maya scene. The idea was to use a Maya scene file to describe our game worlds. The tool saw great use in the PubCrawl project.
The tool operates out of a main window. There are 3 sections, one for each node type (SceneNode, BoundingVolumeNode, ScriptNode). The game engine would have access to these basic elements. The character shown here is the bartender from PubCrawl.
The scene file would have a hierarchy of game objects that could reference other Maya files or have their own geometry and shaders. Most of the work involved went into creating a system which could reference objects from other Maya files cleanly, as this was not well supported by Maya at the time.
When you import an object through Lithium, it creates a Maya scene reference to the requested file (should it not already exist), and hides it away. Then, it creates an instance of the elements within the file you have asked for, and parent constrains them to the SceneNode that requested the import. The actual instanced geometry remains hidden away from the current scene’s hierarchy, and does nothing but display itself while the artist places it in the world.
When this file gets exported to the game engine, these nodes with references on them will grab objects that have been exported from other files. A level would be created with several different Maya scenes linked together. One scene for a table and some chairs which is referenced in by another scene with all the walls and architecture, which is referenced in by a scene with the whole city, which is referenced by...