Setting Up DTS Shapes in Blender

This section describes how to set up objects and layers within Blender for export to the DTS file format.  The Overview of the DTS File Format section describes the unique features of the DTS file format; this section describes how those features are mapped to Blender scenes using the exporter.

Defining detail levels

Detail levels are defined through the use of Blender's scene layers.

Visible detail levels

The number at the end of the detail level name defines the size at which the detail level should be displayed.  Meshes in a "Detail32" detail level display on the screen in Torque only if the width of the object's bounding box exceeds 32 pixels. Under normal conditions, only one detail level is displayed in Torque for a DTS shape at any given time.  See: LOD - Levels of Detail for a more detailed description of how detail level selection is handled in Torque.

Image of the "Detail Levels" panel of the exporter user interface.

Collision and LOSCollision detail levels

Collision with DTS shapes in Torque is handled through the use of special collision meshes.  Collision meshes must be closed and convex or they may not work properly in Torque.  These meshes are stored in special non-rendering collision detail levels.  Any number of collision meshes may be placed in a single collision detail level, and multiple collision detail levels can be used.  In order to indicate that they will not render in the Torque game engine, collision detail levels have a negative size number.  Each convex collision mesh should be a separate Blender object, and collision mesh names should start with "col" (for example "ColMesh1", "collisionMesh", etc).  

LOSCollision detail levels are special collision detail levels that are used for ray casts (projectile collisions, etc).   Under normal circumstances, raycasts are handled by the ordinary collision detail levels, the same as any other type of collision test.  By adding a LOSCollision detail level, you are telling Torque to override the collision meshes in the corresponding collision detail level for raycast tests only.  This can be useful if you want to allow a player to pass through an object or area of an object, but not projectiles, or vice versa.

A note on Collision and LOSCollision detail level numbers

LOSCollision detail levels will override raycast tests for collision detail levels that have the same number as viewed in the exporter user interface.  For example, a "LOSCollision-1" detail level will override the collision meshes in a "Collision-1" detail level when raycasts are performed.  When multiple collision and LOSCollision detail levels are present, each LOSCollision detail level will override the Collision detail level with the same number, if it exists.  In Torque, the Collision and LOSCollision detail level matching is actually handled using a different convention.  For historical reasons, LOSCollision detail levels are expected to start with "9";  LOSCollision-9 is paired with Collision-1, LOSCollision-10 is paired with Collision-2, etc.  The exporter will therefore automatically add 8 to the LOSCollision detail level number(s) upon export to make sure that they actually do match up and override the same numbered collision detail level as displayed in the exporter user interface.  This is done as an attempt to hide the "offset by 9" convention of Collision and LOSCollision detail level matching from the end user.  This may be subject to change in future versions of the exporter if it ends up causing a great amount of confusion.

Defining DTS Objects across detail levels

DTS Objects group related meshes across detail levels.  A visibility animation that fades out a mesh, for example, will act on all of the meshes that are part of the DTS object, regardless of which detail level they belong to.  Multiple Blender mesh objects are grouped into DTS objects based on their names.  The exporter compares the names of each Blender mesh object in each detail level, discarding anything after the last "." in the Blender mesh object names.  Blender mesh objects that match each other up to the last "." in the mesh object names are stored within the same DTS Object in the exported DTS file.  If multiple Blender objects in the same detail level all reduce to the same DTS object name, you will receive a warning in the console, and the original (full) Blender object names will be used for each DTS object; It is therefore very important that each Blender object that exists in a given detail level has a name that is unique within that detail level, up to the last "." in the mesh object name.  Failure to heed this warning will result in an inefficient, loosely packed dts file containing extra nodes, dts objects, and animation tracks, as well as a warning in the export log file.

The table below demonstrates how Blender mesh objects with different names in each detail level are matched up and packed inside the exported DTS file.  Items in the table represent the names of Blender mesh objects in different layers that have been assigned to specific detail levels through the exporter user interface.

Detail Levels

\

DTS Objects

Detail600

Detail100

Detail60

Detail32

Collision-1

LOSCollision-1

HeadMesh HeadMesh HeadMesh.001 HeadMesh.002 HeadMesh.003 No Blender Object No Blender Object
BodyMesh BodyMesh.LOD1 BodyMesh.LOD2 BodyMesh.LOD3 BodyMesh.LOD4 No Blender Object No Blender Object
HatMesh.base HatMesh.base.1 HatMesh.base.2 HatMesh.base.3 HatMesh.base.4 No Blender Object No Blender Object
CollisionMesh1 No Blender Object No Blender Object No Blender Object No Blender Object CollisionMesh1 No Blender Object
LOSMesh1 No Blender Object No Blender Object No Blender Object No Blender Object No Blender Object LOSMesh1

Below are images of the DTS shape hierarchy corresponding to the above table after export, as viewed in Torque Showtool Pro

Image of Shape Properties Tree and TSDump windows in Torque Showtool Pro

Note: Torque Showtool pro is a valuable tool for troubleshooting problems with DTS files and for understanding the DTS file format.  I cannot recommend it enough, working without it is like working blind.  If you own a TGE 1.5.x indie or commercial license, you should already have a Showtool pro license included with your purchase.

The meshes contained within a given DTS Object must all be either skinned meshes or standard (rigid) meshes.  The two types cannot be mixed and matched within a single DTS Object.

Defining DTS Nodes

DTS Nodes are created automatically for each DTS Object that is detected in a Blender scene.  DTS Nodes are also generated for each armature bone in a scene (Blender armature objects act as containers for bones).  Only one set of nodes is needed regardless of the number of detail levels that are present in the DTS Shape; it is not necessary or desirable to explicitly create nodes for each detail level.  Nodes may be arranged in a hierarchy via object or bone parenting in Blender.  When exporting node animations (object or bone animations) from Blender, the exporter will use the animations from the highest detail level versions of each object; any keyframes or animations on the lower detail level versions of the Blender objects are ignored.

Nodes may be excluded from export by using the "Nodes" panel in the exporter's user interface.

Image of the Nodes panel in the exporter user interface

If a node in an object or bone hierarchy is excluded from export, its child nodes (if any) will be re-parented to the next available ancestor node that is not excluded from export.  The exporter tries to keep the overall animation looking the same, but in some cases animations may be negatively affected by excluding animated nodes.  It should be fairly safe to exclude any non-animated nodes from export.  For static dts shapes that are not animated, all nodes may be safely excluded from export.

Defining DTS materials

Blender materials are not used to define dts materials.  DTS Materials are defined using UV mapped image textures in Blender.  The exporter scans through all of the meshes in the export hierarchy and finds all images that are mapped to any faces.  The images that are found show up as DTS Materials in the Materials panel of the exporter GUI.  Options for DTS materials can be found in the Materials tab of the exporter GUI.

Image of the Materials panel in the exporter user interface

See: Blender Survival Guide - Mapping images to faces in a mesh.

Tutorials

Click the link below to see a list of tutorials demonstrating all aspects of setting models up for export with the Blender DTS Exporter:

Tutorial Index

Example Models

Click the link below to see a list of example models demonstrating all aspects of setting up models for export with the Blender DTS Exporter:

Examples Models Index