Working with models

 

Basic model creation

 

All of the models in TRON 2.0 were modeled, textured and animated in Maya 4.0.á We currently have working exporters for Maya3.0/4.0, and 3dStudioMax3.0/4.0.á All of the basics of model creation mentioned here are specific to Maya, but the concepts apply to Max-created models.á

 

Models and Polycounts

Models should be created using polygons.á There are limits on the number of polygons of a particular model depending on the function and necessary detail level of that model.áá In TRON 2.0, the character models ranged from 1700 to 2700 triangles.á This is a good range for most characters, but the limit could go as high as 4-5000 triangles in isolated situations.á In addition to the main models, TRON 2.0 used hand-built level-of-detail (LOD) models for most of the gameplay characters (and all of the multiplayer models).á The rule of thumb used was to create two duplicate models and reduce on to 60% and the other to 25% of the original modelÆs polycount.á LODs are not necessary, but are an optimization that will improve rendering speed when many models are onscreen simu.ltaneously.á More will be mentioned later about setting up LODs for a model.á

 

Textures and RenderStyles

 

Textures can be created using any digital painting tool and should have dimensions that are a power of 2 pixels in length (à64,128,256, 512à).á Model textures are generally kept square, but rectangular shaped textures are ok as long as the dimensions fill this requirement.á A Photoshop plugin is included to allow creation of LithtechÆs DTX texture format.á In addition, plugins for Maya and Max are included to allow the use of DTX textures (Maya: IMFLithDTX.dll, MAX: MaxDTXLoader40.bmi).á A model can theoretically have up to 16 textures, but each part of the model using a different texture needs to be separated into a unique piece.á A model can be made up of as many as 64 separate pieces, but keeping as few as possible is desirable to avoid slowing model rendering down.á Most TRON 2.0 characters have only two pieces, a head and a body, for this reason.á In addition to simple textures, each piece can have a unique ôrender styleö.á There are a lot of these that were created for very specific purposes, but the ones most commonly used for models are: envmap.ltb, glass.ltb (for creating gray-scale alpha masked transparency) and transparent.ltb (for creating things like windows with alpha masks).á There isnÆt currently a way to duplicate the effects of these in Maya, but theyÆre not too bad to set up by just checking them in the game.á One model piece can have only one render style, and usually pieces are combined based on the way modelÆs render styles are distributed.á

 

Skeletons

 

After creating the model and textures, the model geometry is bound to a skeleton.á In Maya, this consists of a hierarchy of one or more joints.á All Maya models should be attached to skeletons using æsmooth bindÆ in the Skin menu.á By default, the exporter will only export joints that are bound to geometry, or the parents of such joints.á In some cases it is necessary have other joints in the hierarchy exported.á This is done by creating a Boolean attribute called æForcedNodeÆ on the joint and setting its value to 1.á Every exported model must have at least one joint.á Inanimate models, such as lamps, chairs, etc. will need only one joint.á Most TRON 2.0 characters have 35.á Again itÆs possible to use a lot of joints, but keeping the number as low as possible will improve performance.á Model LODs can be made even more efficient by removing unneeded joints from the lower detail models.á This can be done in Maya by using the æEdit Smooth Skin > Remove InfluenceÆ function.

 

 

Exporting models

ááááááááááá

To use the exporter plugin in Maya, place the file æMayaModelExport40.mllÆ in the Maya bin\plugins\ folder and the file æLithTechModelExportOptions.melÆ in the Maya scripts\others\ folder.á Make sure the plugin is loaded in MayaÆs Plugin Manager window.á

 

The exporter plugin exports a text version of the Lithtech file format, æ.ltaÆ.á It will also export a compressed version, æ.ltcÆ, to save disk space.á The format should be specified in the filename supplied to the plugin.áá The exporter uses the command line format:

 

lithtechModelExport ûall [-usePlaybackRange <bool> -append <bool> -ignoreBindPose <bool> -exportWorldNode <bool> -scale <float>] <animation name> <file name>

 

The optional flags are defined as follows:

ááááááááááá á

  • -usePlaybackRange û setting this to æ1Æ will export only the visible range of an animation. æ0Æ will export all keyframes in the scene.
  • -append û setting this to æ1Æ will append the animation to an existing file, allowing models to contain many animations.á Setting it to æ0Æ (the default) will overwrite the file if it exists.
  • -ignoreBindPose û This option determines whether the bind pose of a model or the first frame of an animation is used as a base for deformation.á This was set to æ1Æ for nearly all TRON 2.0 models because of the child model workflow described below.
  • -exportWorldNode û This allows multiple skeletons in a scene to be exported as one model if set to æ1Æ.á It adds a æworld nodeÆ as a parent to all exported skeletons.á It was generally set to æ0Æ for TRON 2.0 models.áá
  • -scale û this will scale a model by the specified float value.á This can be helpful since it can be tricky to scale animations in Maya.
  • animation name û the name of an animation.á When appending animations, if there is an existing animation of the same name, it will need to be deleted in ModelEdit before it can be used.

         file name û this should contain the entire path to the desired file.á The format should be either æ.ltaÆ, or æ.ltcö.á

 

The exporter will use these options to decide which skeleton(s) should be exported, and will include all visible geometry bound to it.

 

The concept of æchild modelsÆ was used for most characters in TRON 2.0.á The child model is a model that is used solely to store animations (and animation specific data).á When a child model is applied to another model, that model will share all the animation data from the child model.á This allows continual edits to be made on models without needing to worry about re-exporting large numbers of animations.á It also allows many different models to use the same animation set.á The base character should be exported unanimated at its bind pose with the animation called æbaseÆ.á A child model is created by using the æappendÆ option in the exporter.á Be very careful, since accidentally not setting the append flag will simply overwrite the file without warning.á Also, when joint names are case-specific when appending and must match exactly the names of the model.á

 

A Maya script that eases the export/model setup workflow described here is included.á It creates an interface to save many of the settings described here and in the next section in a Maya scene.á It was used for nearly all the models that were exported throughout production and is presented here as isà it worked for me - I hope it works for others.á If nothing else it provides a starting point for others to understand how the .lta format can be used.á It is described mode fully in another section.

 

Model setup using ModelEdit

 

After exporting a character model, a few things need to be done to get it to appear in the game.á These things are done in ModelEdit.á This tool has been around for a few years and hasnÆt changed a lot, in spite of our workflow changing a lot.á What that means is that there are a lot of options that probably havenÆt been used in a while and may be obsolete.áá

 

The new Lithtech file format exists in two forms.á The exporter creates a user-friendly data file (.lta or ltc), but this needs to be compiled as an ltb file for use in the engine.á An .lta file is a text file containing all the model and animation data.á An ltc file is a compressed version of this, and is what was used for most TRON 2.0 models.á ModelEdit only reads .lta or ltc files, not ltb files.áá ModelEdit can be used to convert between ltc and .lta files.á In addition to this, a command line tool, LTC.exe, can be used to convert between .lta and ltc files.á For help using this tool, execute the command æLTCÆ.á ModelPacker.exe is used by ModelEdit to create ltb files.á

 

There are several things that need to be set up in ModelEdit to get models working.á As an example, a fully setup character, Game\Chars\Models\Character_Sample..lta, has been provided that is the exported version of the Maya scene Character_Sample.mb.á

 

User Dims

 

The most basic thing that needs to be set on models is the User Dims.á This is basically a bounding box for each model.á To see this box in ModelEdit, select æOptions > Show User DimensionsÆ.á By default the dims are a long box.á This needs to be changed to more closely match the size of the model.á This can be done either by adjusting the æ+Æ and æ-æ buttons in the æAnimation EditÆ section of ModelEdit or by selecting æAnimation > DimensionsàÆ and entering appropriate values.á One thing to know about user dims is that the X value must always equal the Z value.á If not the engine will pick one and apply it to both, producing strange results.á Another thing to notice is that user dims can be set per animation.á To avoid possible timing issues with changing dims, they are usually set the same for all animations on a character.á The only exception in TRON 2.0 is the crouching animations for player characters.á All human characters in TRON 2.0 have X=24, Y=53, Z=24.á

 

Weight Sets

 

In order to render in the engine, character models need to have several æweight setsÆ created.á Weight Sets are used by the programmers to tell a character to play more than one animation at a time, such as the recoil animations or the upper/lower body blending in multiplayer.á Select æModel > Edit Weighted Animation BlendingÆ in ModelEdit.á Weight Sets are created one at a time by clicking the æAdd SetÆ button and entering the name.á The following sets need to be added to every character model:á Null, Upper, Lower, blink, twitch.á To set the Weight Sets, select one or more nodes in the æNodesÆ window and set the appropriate value in the æCurrent Node WeightÆ window.á (When setting this number, donÆt press enter, as it will exit the dialogue and frustrate you).á

 

  • Twitch - select all the nodes in the node window and set the Weight to æ2Æ.á Setting the weight to æ2Æ tells the engine to additively blend animations and in this case allows the twitch on dead bodies and recoil on shot enemies.á
  • Blink û select the Eyelid node (if one exists) and set its value to 2.á This will cause the engine to play an animation called æblinkÆ if it exists constantly as long as the character is alive and blend it over whatever the character is doing.á This could be used creativelyà
  • Upper û select all the nodes in the upper body of the character and set the weight to æ1Æ.á This tells the engine to replace the animation on these nodes with the desired upper body animation.
  • Lower û select all the nodes in the lower body of the character and set the weight to æ1Æ.á Note that if there is a node controlling the translation of the model, it should be in the lower body.á
  • Null û leave all nodes set to zero.

 

Note that other than the Upper and Lower sets in multiplayer characters, all of these can be left at zero and the models will work fine.á The sets just need to exist for the engine to be able to set up each character.á Non-character models do not need weight sets.

 

Sockets

 

Sockets are created to define locations where other models or FX can be attached to characters.á The most noticeable place where sockets are used is in the gun hands of character models.á This is the only socket I can think of that is necessary for a character to function properly.á This socket must be named æRightHandÆ, but can be attached to any node in the model (for example, the laser shooting super soldier has a RightHand socket attached to his Head node.)á To create this socket in ModelEdit, select the desired node (usually the right hand) in the Nodes window.á Then select æSockets > Add SocketàÆ,á and enter the name æRightHandÆ.á The socket will be created at the location and orientation of itÆs parent node.á Usually this will need to be edited.á This is most easily done by showing attachment models in ModelEdit.á (Unfortunately, new sockets donÆt show attachments until the model is saved and re-opened.)á Select æOptions > Show SocketsÆ and æOptions > Show AttachmentsÆ.á Now double click the socket name (RightHand) in the æSocketsÆ window.á In the æAttachmentÆ field of this properties window, enter or browse to the location of an attachment model .lta file (gun, flashlightà).á Also in this window are entry boxes for orientation, translation, and scale values.á These are very helpful when you know exactly what they need to be, but can be a little counterintuitive when starting from scratch since they are based on the orientation of the parent node.á ItÆs easier to use the æTransform EditÆ controls.á The Red, Green, and Blue boxes correspond to the colored axes of the socket in the ModelEdit viewport.á Translation and Rotation are usually all that is needed to position the attachment into place.á Scale is usually only used if an attachment that is shared among several characters needs to be adjusted to fit onto larger (or smaller) body part.á All the sockets that you create are listed in the æSocketsÆ window in ModelEdit.á Other important sockets that every character should have are LeftFoot and RightFoot.á These are needed to create footprints and accurately located footstep sounds.á Other than this the main uses for sockets are hats, glasses, holstered weapons.á To see how these and other sockets are set up, examine the sample character.á Most characters have about a dozen sockets even though many of them arenÆt used by all the characters.á This is for consistency, so no one needs to remember which character gets which sockets.á A socket name will not be valid unless it is appears on a list determined by game code.á The full available list can be seen by opening DEdit, selecting an AI and opening the attachments property.á One other thingà the exporter plug-in allows sockets to be created and exported from Maya.á To do this create an object (usually a locator) and add a Boolean attribute called æsocketsÆ and set it to æ1Æ.á This object can be used to orient objects within Maya and may be easier to work with than ModelEditÆs controls.

 

Importing Sockets and Weight Sets

 

Sockets and Weight Sets are two things that are commonly imported from similar existing models.á This can be done by selecting æFile > ImportàÆ.á To import only Sockets and Weight Sets, check the boxes next to those options, and uncheck Animations.á Then browse to a previously set up model with a matching skeleton and click æOpenÆ.á This can save a lot of tedious work, but some sockets may still need to be adjusted depending on the situation.á Among the other options, Animations can also be imported from one model to another (instead of using a child model).á When importing Animations, you should always import User Dims and Translations simu.ltaneously to avoid needing to reset this information.á The æUV CoordsÆ is no longer used.áá

 

Child Models

 

Child models are added in ModelEdit by selecting æChild Model > Add ChildModelàÆ and browsing to the desired .lta or ltc file.á The only requirement for a model to be a valid child model is that the hierarchy must match exactly that of the parent model.á A model can have as many as 32 child models, some of which can be added in game code as needed.á Generally, only 1-3 child models are needed, depending on the character, and they will be listed in the æChild modelsÆ window in ModelEdit.á If a child model has drastically different proportions than a character, you may notice the character distorting to match those proportions.á This can be corrected by checking the box next to the distorted nodes in ModelEditÆs Nodes window.á This tells the engine to ignore the translation information from the child model for this node and use only the rotation.á In most TRON 2.0 characters, all the nodes are checked except translation, movement, and most Face nodes.á These nodes contain mostly translation animation, so ignoring translation will kill the animation.á The Face nodes that should be checked are the eye nodes and the eyelid node, since they only contain rotation animation.á Note that this only works if a character shares the exact face setup as the child model.á If this is not the case, all the face nodes should be checked.áá

 

Texture Setup

 

Setting up textures and render styles in ModelEdit is done in the Piece Info window.á This is accessed by highlighting a model piece in the æPiecesÆ window and selecing æPiece > Piece InfoàÆ.á This can be the most confusing part of setting up a model.á The main things to understand here are the Texture Indices and Render Style Index.á All of the textures and render styles associated with a model are listed in an attribute file.á Characters are in modelbutes.txt and props are in proptypes.txt.á Here is an example of a Super SoldierÆs texture list:

 

Skin0áááááááá = "chars\skins\SSLtBody.dtx"

Skin1áááááááá = "chars\skins\SSLtHead.dtx"

Skin2áááááááá = "chars\skins\SSLtPack.dtx"

Skin3áááááááá = "chars\skins\shinyspot.dtx"

RenderStyle0á = "RS\default.ltb"

RenderStyle1á = "RS\envmap.ltb"

RenderStyle2á = "RS\glass.ltb"

RenderStyle3á = "RS\Glow.ltb"

 

The Texture Index refers to the Skin number in this list.á The Render Style Index refers to the Render Style number in this list.á For example the æbodyÆ piece of the model will use Skin0 and RenderStyle0, so the indices will stay at the default values of zero.á Some render styles use multiple textures.á The only commonly used render style like this is envmap.ltb.á An example of its use would be the Super SoldierÆs backpack.á This uses RenderStyle1, Skin2 as the main texture map, and Skin3 as the environment map.á To set this up, the æNumber of TexturesÆ option needs to be set to æ2Æ.á Then Texture Index 0 should be set to æ2Æ (for Skin2) and Texture Index 1 should be set to æ3Æ (for Skin3Æ).á The Render Style Index should be set to æ1Æ (for RenderStyle1).á There is also an option for æRender PriorityÆ.á This is used to insure proper sorting of transparent models.á All non-transparent models should have this set to æ0Æ.á Most models using alpha transparency render styles should have this set to æ1Æ to insure that that piece will always be rendered properly when it is in front of an opaque piece.á Complex model setups, like ArmstrongÆs beard, can have a wide range of render priorities to sort the pieces properly.

 

Saving and Compiling

 

The last thing that needs to happen in ModelEdit is to save and compile the model.á To Save and Compile, select æFile > Save and CompileàÆ.á There are several options here, but only a couple that are ever actually used.á One is the compression type.á The default compression type is (RLE 16) which in the case of some animations, is too much compression.á I generally compress unanimated models at æ(RLE 16)Æ and compress any thing with subtle animations using æ(RLE16)PlayerViewÆ.á This difference is that with (RLE16)PlayerView, everything is compressed to 16bit except translation which stays at 32bits.á This basically results in smoother animations.á The other commonly used option is æExclude Model GeometryÆ.á This can be used for any model that is exclusively a child model and allows for really good data compression since the geometry is simply thrown out.á The good news about the compile window is that all the settings are saved per model, so the only need to be set when first exported, if at all.

ááá

 

Other ModelEdit functions

 

Here are the other most commonly used ModelEdit functions.

 

Animation Editing

 

ModelEdit has a number of functions to allow simple editing of animation data.á An animation cannot be edited if it is being shared from a child model.á In the æAnimationsÆ window, the animations are listed with a check mark in the box next to the name if they can be edited.á Right clicking on the name of an animation will bring up a menu with options to rename, duplicate, or delete the animation.á The animation time slider displays the keyframes of an animation as red (or green) ticks.á For editing purposes, ModelEdit allows you to ætagÆ a group of keyframes.á Keyframes can be tagged individually by double clicking the red ticks in the time slider.á This actually toggles the tagged state, so double clicking again will untag the keyframe.á Tagged keyframes will appear as blue ticks.á Groups of keyframes can be tagged by holding down the æShiftÆ key and click-dragging the mouse across the group of red ticks.á The tagged state of keyframes is not saved with the file.á Right clicking the time slider opens a menu.á Here are the useful options in this menu:

 

  • Delete Keyframe û This will delete the current keyframe from the animation.á It will not work on the first or last frame of the animation.
  • Delete Tagged Keyframes û This allows multiple keyframes to be tagged and deleted simu.ltaneously.á Deleting unnecessary keyframes is a useful file size optimization.
  • Clip After Keyframe û This will delete all the keyframes after the current keyframe.
  • Clip Before Keyframe û This will delete all the keyframes before the current keyframe.
  • Insert Time Delay û This will allow a time delay between two keyframes to be specified, and is used a lot in tweaking the timing of animations in cut-scenes.áá

 

More useful functions can be found in the æAnimationÆ menu:

 

  • Set Animation Rate û This changes the keyframe rate of an animation.á Most TRON 2.0 animations come from motion capture data, which has 30 frames per second.á This function is used to reduce that rate.á Most TRON 2.0 AI animations are reduced to 7.5 frames per second, while cut-scene animations are 10 frames per second.á Tagged frames are protected from this function, so if there are rapid motions in the animation, tagging those frames will allow them to retain the full rate.á
  • Set Animation Length û This will scale the speed of an animation.á During TRON 2.0 production, it was the easiest way to accurately set the timing of animations.
  • Set Animation Interpolation û Interpolation is what the engine does to blend from one animation to another.á This function allows the time of this blend to be set.á The default is 200 ms, and that is good for most purposes.á Looping animations and cut-scene animations usually have 0 interpolation.á
  • Make Continuous á- This will duplicate the first frame of an animation and place it at the end to create a rough looping effect.á This isnÆt perfect in most cases, but is a quick way to get a looping animation for testing purposes.
  • Reverse û This will reverse the frames of an animation so that it plays backwards.
  • Create Single Frame û This creates a one frame animation from the current frame of an existing animation.á
  • Translation û This is used to add a positional offset to an animation.
  • Rotate û This is used to add a rotational offset to an animation.

 

Frame Strings

 

It is also possible to add commands to animations so that they are executed at a desired keyframe.á This is done in ModelEdit by setting the animation to the desired keyframe and entering the command in the æFrame StringÆ text field (at the bottom of the ModelEdit interface).á A keyframe that has a Frame String will appear as a green tick in the animation timeslider, as opposed to the default red tick.á Multiple commands can be added to the same keyframe by separating the commands with a semicolon.á There are many possible commands that can be used here û pretty much any command that can be sent to a character through triggers in the game will also work here.á The most common ones are:

 

  • FOOTSTEP_KEY 1 û Right Footstep.á This will play the appropriate sound effect when the right foot hits the ground and should be placed that point in the animation.á It will also leave a footprint at the correct place in the snow.á
  • FOOTSTEP_KEY 2 û Left Footstep.á This should be placed when the left foot hits the ground.
  • DOOR û Activate a door object.á This should be placed at the keyframe where the door should start opening.
  • OPEN û This command is used with smart objects to activate an object associated with the smart object.á An example of this is the æDeskÆ smart object where the OPEN command activates a chair to move when the animation pulls it from under the desk.á For more information on smart objects see the AI docs.
  • FX <fx name> - This will play an FX object at the desired keyframe.á An example of this in action is the dissolve body FX (FX AIBodyRemove).
  • Attach <socket name> <attachment name> û This will cause an attachment to be spawned at the specified socket and keyframe.á An example is the cigarette appearing in an AIÆs hand at the appropriate time (Attach LeftHand cigarette).
  • Detach <socket name> û This will remove an attachment from a character at the desired keyframe.á

 

Importing LODs

 

Model LODs are another confusing part of model setup.á Since they are not necessary, they may not be worth the trouble when experimenting.á Nevertheless, here is how they can be imported using ModelEdit.á LOD models should first be exported as a separate .lta file, and the pieces should be named exactly as the pieces in the main file.á LODs are imported on a piece-by-piece basis from this file.á In ModelEdit, highlight the desired piece in the æPiecesÆ window and select æFile > Import Custom LODsàÆ.á Browse to the file containing the LOD pieces and click æOpenÆ.á A window will open containing a list of all the pieces in that file.á Select the appropriate piece and click æOKÆ.á Now open the æ+Æ sign next to the piece name in the Pieces window.á It should open to two æ0.00Æ children.á HereÆs the tricky part that will be frustrating.á One of these is the original and the other is the LOD, but it can be difficult to guess which one.áá Usually the top 0.00 piece is the LOD, so highlight it and select æPiece > Piece InfoàÆ.á The Texture and Render Style information should match the original Piece.á In the LOD Properties section, set the Distance to a value other than 0.á This will be the distance where the original model piece will swap with the new LOD.á This process will need to be repeated for each piece of each LOD.á Most of the characters in TRON 2.0 have two full LODs, one at 250 units, and on at 550.

 

Command String

 

The modelÆs Command String is used to store various commands and settings used by the engine when setting up a model.á In previous versions of Lithtech, there were many commonly used commands that were placed here, but many of those are now obsolete.á The only thing the Command String is currently being used for is enabling shadows on a model.á To access the Command String in ModelEdit, select æModel > Command StringàÆ.á To turn in shadow casting simply enter ôShadowEnableö in the text field.á

ááááááááááá

Piece Merging

 

A piece-merging feature was added to help optimize the number of geometry pieces in a model.á It will merge all pieces that share a render style and texture.á To use it highlight the desired pieces in the æPiecesÆ window and select æPiece > Merge SelectedÆ.á This allows modelers to keep models in separate pieces in the modeling software if desired and wait to combine them in the exported model for optimization.á

 

Null LODs

It is possible to have model pieces disappear when models are a certain distance from the player.á This is done in ModelEdit by highlighting the desired piece in the æPiecesÆ window and selecting æPiece > Create Null LODàÆ,á then enter the desired distance.á This was used as an optimization in ArmstrongÆs beard, which mostly disappears at about 600 units.á

á

 

Bute Files

 

All models in the game need to be defined in an attribute file.á Characters are defined in æmodelbutes.txtÆ, props are defined in æproptypes.txtÆ, and attachments are defined in æattachments.txtÆ.á There is a not a lot that needs to be understood about these files in order to add to them, but not following the format exactly can cause disastrous results.á For this reason, they should be modified at your own risk, and never without first backup them up.á Most new models are created by simply cutting and pasting new model listings from existing, similar models and changing the number, Name, the model filename, the Skin and RenderStyle lines.á It is very important that each model has a unique number and name, and that each attribute file contains no gaps in numbers (example: a file that contains [Model56] and [Model58], but not [Model57] will crash the game.á Also, a file that contains two [Model56] listings will crash the game).á This is pretty important, but itÆs really all that needs to be understood to add most new models.á Characters can be a little more complex for two reasons.á One is the Skeleton section, which is used to define hit detection per skeleton and can be enormously painful to deal with.á A lot can be done with it without any changes.á The other extra piece of information for characters is the æDeathmatchModelsÆ section.á To add new multiplayer models, in addition to the model listing already described, the model must be added to this list using the æNameÆ of the model listing (example æName36 = ôNewModelNameöÆ).á This covers all the needed basics for model setup in TRON 2.0, but again modify at your own risk and be sure to backup the originals.

 

 

LtExport.mel Script

 

As mentioned in the exporter section, as MEL script was created to help streamline our workflow and give the ability to store a lot of settings in the Maya scene that would otherwise need to be set in ModelEdit every time a model is re-exported.á It is intended to be an interface to the exporter plugin.á This is 100% artist created tool and most of it was created as a means to learn MEL scripting.á Because of this, it is unsupported and may not be the best way to do everythingà but it works for us, and nearly all TRON 2.0 (and TRON) models were exported using this script as an interface.á The script requires the file æLTC.exeÆ to support the compressed ltc version of the .lta file format.á To use this script, place it in a user script directory, or MayaÆs Scripts\Others\ folder.á Enter the command æltExportÆ to open the interface.á Included is a brief description of options, settings, and known limitations in the script.

 

Edit Options

á

The æEdit OptionsÆ section contains functions that attempt to mimic ModelEdit functionality:

 

  • UserDims û This button creates a bounding box that can be scaled normally to set the dims.á It correctly locks the X and Z values to avoid bad dims.á The scale values will be saved on the skeleton so that they can always be exported correctly.
  • Sockets û This opens a window that will give options to create and delete sockets and works very much like the ModelEdit dialogue.á
  • Piece Info û For texture setup, this works exactly like ModelEditÆs Piece info window.á Select a Piece and press this button and the window will open to allow settings to be made.á It also has a place to enter the correct game texture path so that textures will show up in ModelEdit automatically (This may not be usable except during production).
  • CommandString û This is exactly like the ModelEdit Command String window.á Anything entered here will be saved with the skeleton.
  • ChildModels û This allows child models to be specified.á A list of child models is saved with the skeleton.
  • NodeFlags û This mimics the æNodesÆ window of ModelEdit, allowing the node check box setting to be saved with the skeleton.

 

Other Setting Options

 

Here are the other available setting options:

 

  • Append Animation û When checked on, this will cause the exporter to always append animations without warning.á When off, a warning will come up to prevent accidentally overwriting files.á This sets the æ-appendÆ flag of the exporter flag of the exporter plugin.
  • Use TimeSlider range û This sets the æ-usePlaybackRangeÆ flag of the exporter plugin.
  • ExportWeightSets û This will create (but not correctly set) the default set of weight sets needed to for characters to work in the game.á
  • Export Child Models û This was added to allow a model to have child models in Maya, but export without them if needed.
  • CompileModel û This will automatically compile the model as an ltb file.áá When checked on, an option is exposed to æCompile with no geometryÆ.á This is used when exporting many animations to a child model.
  • Dims û This provides a numerical input for setting User Dims.
  • Scale û This sets the æ-scaleÆ flag of the exporter plugin.
  • Interpolation û This sets the interpolation time of an animation.á It is the same as using æSet Animation InterpolationÆ in ModelEdit.
  • ToolPath û This should provide the folder where the file æLTC.exeÆ exists
  • GamePath û This may not be usable, but shouldnÆt affect the working of the script.

 

In addition to these options, the script will export LODs for models by looking for a very specific naming convention in the Maya scene.á I canÆt think of a better way to describe this setup than to point to the sample Maya character setup scene (Character_Sample.mb).á It contains LOD pieces that have been hidden to prevent them from exporting.á Unhiding them and exporting this scene using the ltExport Script will result in fully set up LODs.

 

Limitations

 

There are lots of issues that were never addressed due to lack of time.á Here are a couple that youÆll probably notice:

  • There are a lot of æBrowseÆ buttons in the interface.á Most of them donÆt work at all and the main File Browser will only work if you select an existing .lta or ltc file.á I never did figure out how to get file browsing to work correctly.
  • The script will give an error if it is run when there are no skeletons in the scene.
  • The script recognizes the first skeletal hierarchy in the scene to be the export skeleton.á This is always the top joint listed in the outliner or the leftmost one in the hypergraph.á Occasionally a hidden skeleton could be listed before the desired one and cause a lot of confusion.
  • There is a weird bug that occurs when child models are specified and exported using this scriptà the normals are destroyed.á Fortunately this can be remedied in ModelEdit by selecting æModel > Generate Vertex NormalsÆ.á Because of this, unless there are several child models, I donÆt really use the child model part of the script much.á
  • The æNode FlagsÆ option will be made invalid if the skeleton is changed after setting the flags.á The exporter wonÆt notice this, and may cause an assortment of problems if invalid values are exported.