LightWave to DTS Exporter Documentation
For Version 17-05-02

Written by David Wyand

 

Return to Table of Contents

 

Using the Plug-in's Interface
To add the plug-in to a Layout scene, go to the Scene->Master Plug-ins menu. This will open a window with the Add Layout or Scene Master drop-down list. Select the TorqueDTSExporter from the list, and double-click on the added plug-in to open its interface.

Object Settings
The plug-in's interface is divided into two sections. The top section is dedicated to setting up the individual objects (this example picture is from the LWRamp.lws file that is included with these docs):

The top half is a list of all of the objects within the scene. If there is a dash in the Ex column, then the object will not be exported. To have an object exported, select it in the list, and choose Mesh or Node from the Export As: list. A letter 'M' will appear next to the object in the list. If you wish to give the object a different name within Torque (for accessing with scripts) than what is used in LightWave, enter it in the DTS Name field and press enter. If you do not type in a DTS name for the object, then the LightWave name will be used.

To set up an object as a billboard, select it from the list and choose the appropriate option from the Rotate As: list. The current choices are: Normal, Billboard, and BillboardZ.

To have an object export as a collision mesh, select the object and choose Collision Mesh from the Export As: list. Please keep in mind the limitations stated in the introduction page.

Global Tab
The second half of the plug-in's interface allows access to options that will affect the entire scene:

The Global tab defines a number of options that affect the entire DTS file. The most important is the Save As: edit box. This is where you enter the location and name of the exported DTS file. If you wish to select a location and name using a browser, click on the arrow beside the edit box.

The Export material information checkbox may be unchecked if you don't wish to export any material information with the DTS file. This causes the Torque Engine to render the object in a light gray.

The Global Scale Factor edit box is where you may enter an overall scale for the object. If the object appears to be too small within Torque, enter a larger number here. In general you don't need to be concerned with this value as the scale in LightWave and the scale in the Torque Engine match up (1m in LightWave = 1m in Torque).

If you wish to have a collision mesh for your DTS object to prevent players from running through it, then select the appropriate option from the Collision Mesh list. If you choose Use Mesh from the list, make sure that you've selected an object to be exported as a collision mesh (see above). If you want the collision mesh to be rendered with the DTS object, then check Create a visible collision mesh. This will cause the collision mesh to render as an illuminous white object in the Torque Engine.

Animation Tab
The Animation tab is where you define the animation sequences that will be saved with the DTS file..

To begin with, if you wish to save any animation sequences with your DTS file, then check Export animation sequences. If this is unchecked, then the animation portion of the DTS file will not be written, even if you have animation sequences defined.

To create a new animation sequence, click the New Seq button. This creates a new sequence with a name of 'new'. To delete a sequence, select it and then click the Delete Seq button. This will remove the sequence from the list. If you'd like to change the order in which the sequences are displayed (which is also the order in which they are exported), click on the sequence and press the Up and Down buttons.

An animation sequence has a number of parameters that may be modified. To change a sequence's values, be sure to first select it. The first parameter is the sequence's name, and is what the Torque Engine keys off of to play an animation. The next two parameters are the sequence start and end frames on the LightWave timeline. In order to allow for multiple animations for a single DTS object, you'll need to create each animation at a different position in the LightWave timeline. In the example above, frames 2 through 14 have the character looking around while standing still. Frames 25 through 45 have the character running on the spot. These are the start and end frames that you would use for each sequence. Please see the Tin Man and SpiderBot scenes for examples on how to set up the animation.

The next parameter is FPS, or frames per second. This controls how fast the animation will play within the Torque Engine. The higher the number, the faster the animation will play. Typically, when you create an animation in LightWave, it would be at the default 30 frames per second. However, if you wish to change the timing, you may do it with this parameter rather than stretching the LW timeline itself.

The final parameter is the Sequence will automatically cycle checkbox. With this checked, the selected animation sequence will always start over when it reaches the end. This is useful for walk and run cycles. You'd probably leave it unchecked for an animation of the character waving or dieing.

There is one more button under the Animation tab: Setup for IK. If you are animating using inverse kinematics, then you'll want to click on this button when you're ready to export. What it does is go through the list of all objects and bones, and any of them that use IK on any of their channels will have a special motion plug-in (TorqueDTS_IKChannelCreator) added to them. This motion plug-in is used to generate keyframe information when it comes time to export an animation sequence based on the IK derived motion. Unfortunately, this step is required as the LW API only allows access to the IK data at certain times.

The best time to use the Setup for IK button is after you've setup your objects for IK animation, or anytime that you modify an object's or bone's controllers for inverse kinematics (from the Motion Options panel in LW). If you've animated you object in LW using IK, and the exported DTS file does not perform your animations, it's likely because you've forgotten to click on this button prior to exporting. Please note that you do not need to click this button prior to every export, only when the scene structure or object/bone's motion controllers have changed. In a future release, this step may be automated.

Advanced Tab
You will not likely need to use the options in the Advanced tab, but are listed here for completeness:

The Point and Poly Type drop down list lets you choose how the vertices are exported. The Normal option will export the vertices as they were created in Modeler. Selecting the Transformed option will cause the vertices to be exported after all of the transformations in the scene have taken place. These transformations are anything that alters the positions of the vertices, such as bones or deformation plug-ins. I've not thoroughly tested this option, but would love to hear of anyone's results using it.

The Initial transforms based on time (sec) edit box is used to enter at what time in the timeline the exporter will take the object's and vertices positions from. Usually this is set to a time of zero seconds, but may be set to a different time for some effects. Again, I've not thoroughly tested this option.

The Export meshes as nodes check box tells the exporter to create a node at the object's pivot point from which all vertices and children nodes will be relative to. If this is not checked, then a generic Root Node will be automatically created, and everything will be relative to that. The only reason you may wish to not have this set is if you are trying to maintain some type of backward compatibility with the MilkShape DTS exporter.

The Mesh extension for nodes edit box is where you may change the extension that is automatically added to all nodes created from an object's pivot point. The reason the extension is added is to differentiate the node's name from the mesh's name, which comes from with the LW name, or the user created DTS name. Changing this extension will not affect how the object is exported, and is perhaps only useful if you are accessing the DTS object from code and need a node's name to be something specific.

For more information on nodes, please see Creating and Using Nodes.

Exporting the DTS File

When you have finished setting up the scene to be exported, click on the Export DTS File button at the bottom left of the interface. An informational window will open to let you know how the export is progressing, and you will be notified when it is complete.

If you are exporting animations with the DTS file, then you'll notice that the LW timeline will automatically advance. This step forces the creation of keyframe data when animating with IK and using the TorqueDTS_IKChannelCreator plug-in (which is automatically added with the Setup for IK button. See above).

Don't forget to save the LightWave scene to save all of the exporter's settings.

 

Return to Table of Contents