Skip to content

Dsq format {documentation artist guide formats}

Luis Anton Rebollo edited this page Dec 5, 2013 · 1 revision

Contents

Introduction


DSQ is the native, binary format used by the Torque engine to store animation data. This document serves as a basic specification for the DSQ file format. Very little context is given to the sequence data fields read from the DSQ file so it is recommended that this resource be read along with the Torque source code. The DSQ file format is shown below. Note that all values are stored as little-endian, so on non-Intel platforms you will have to handle perform endian conversion for 16 and 32-bit values.


Note: All values are stored as little-endian, so on non-Intel platforms you will have to perform endian conversion for 16 and 32-bit values.

DSQ Format

Name # bytes Data Type Description
DSQ version number 2 S16 DSQ version of this file. Note that the current DSQ version (for files saved by T3D) is 26. Most DTS exporters and the ShowToolPro tool only read/write version 24. There is actually no difference between v26 and v24, but files generated by T3D will always use the latest DTS version number.
Exporter version number 2 S16 For tracking version of the exporter that generated this file. Can usually be ignored.
numNodes 4 S32 Number of nodes in the shape
nodeNames numNodes * ? S32 and char[] Node names stored as a 4-byte length followed by N characters (terminating NULL not included in length or DSQ file)
dummy 4 S32 Dummy value
numObjects 4 S32 Number of objects in the shape
numNodeRotations 4 S32 Number of node rotation keyframes
nodeRotations numNodeRotations * 8 Quat16 { S16 x, S16 y, S16 z, S16 w } Array of quaternions for node rotation keyframes (all sequences)
numNodeTranslations 4 S32 Number of node translation keyframes
nodeTranslations numNodeTranslations * 12 Point3F { F32 x, F32 y, F32 z } Array of points for node translation keyframes (all sequences)
numNodeUniformScales 4 S32 Number of node uniform scale keyframes
nodeUniformScales numNodeUniformScales * 4 F32 Array of floats for node uniform scale keyframes (all sequences)
numNodeAlignedScales 4 S32 Number of node aligned scale keyframes
nodeAlignedScales numNodeAlignedScales * 12 Point3F { F32 x, F32 y, F32 z } Array of points for node aligned scale keyframes (all sequences)
numNodeArbScales 4 S32 Number of node arbitrary scale keyframes
nodeArbScaleRots numNodeArbScales * 8 Quat16 { S16 x, S16 y, S16 z, S16 w } Array of quaternions for node arbitrary scale rotation keyframes (all sequences)
nodeArbScaleFactors numNodeArbScales * 12 Point3F { F32 x, F32 y, F32 z } Array of points for node arbitrary scale factor keyframes (all sequences)
numGroundFrames 4 S32 Number of ground transform keyframes
groundTranslations 4 Point3F { F32 x, F32 y, F32 z } Array of points for ground transform keyframes (all sequences)
groundRotations 2 Quat16 { S16 x, S16 y, S16 z, S16 w } Array of quaternions for ground transform keyframes (all sequences)
dummy 4 S32 Dummy value
numSequences 4 S32 Number of sequences in the shape
sequences numSequences * ? Sequence Array of Sequences - size of each sequence depends on which nodes are affected etc.
numTriggers 4 S32 Number of triggers (all sequences)
triggers 4 Trigger { U32 state, F32 pos } Array of sequence triggers (all sequences)


Sequences are stored in the DSQ file as shown below. Note that this is almost identical to how sequences are stored in DTS files except for the name:

Name # bytes Data Type Description
name ? S32 and char[] The name of this sequence stored as a 4-byte length followed by N characters (terminating NULL not included in length or DSQ file)
flags 4 U32 Sequence flags
numKeyframes 4 S32 Number of keyframes in this sequence
duration 4 F32 Duration of the sequence (in seconds)
priority 4 S32 Sequence priority
firstGroundFrame 4 S32 First ground transform keyframe in this sequence (index into the groundTranslations and groundRotation arrays)
numGroundFrames 4 S32 Number of ground transform keyframes in this sequence
baseRotation 4 S32 First node rotation keyframe in this sequence (index into the nodeRotations array)
baseTranslation 4 S32 First node translation keyframe in this sequence (index into the nodeTranslations array)
baseScale 4 S32 First node scale keyframe in this sequence (index into the nodeXXXScales arrays)
baseObjectState 4 S32 First object state keyframe in this sequence (index into the objectStates array)
baseDecalState 4 S32 First decal state keyframe in this sequence (index into the decalStates array). Note that DTS decals are deprecated, and this value should be 0.
firstTrigger 4 S32 First trigger in this sequence (index into the triggers array)
numTriggers 4 S32 Number of triggers in this sequence
toolBegin 4 F32 Value representing the start of this sequence in the exporting tool's timeline (can usually by ignored)
rotationMatters ? BitSet BitSet indicating which node rotations are animated by this sequence.
translationMatters ? BitSet BitSet indicating which node translations are animated by this sequence.
scaleMatters ? BitSet BitSet indicating which node scales are animated by this sequence.
decalMatters ? BitSet BitSet indicating which decal states are animated by this sequence. Note that DTS decals are deprecated.
iflMatters ? BitSet BitSet indicating which IFL materials are animated by this sequence.
visMatters ? BitSet BitSet indicating which object's visibility is animated by this sequence.
frameMatters ? BitSet BitSet indicating which mesh's verts are animated by this sequence.
matFrameMatters ? BitSet BitSet indicating which mesh's UV coords are animated by this sequence.


BitSets are stored in the DSQ file as:

Name # bytes Data Type Description
dummy 4 S32 Dummy value
numWords 4 S32 Number of 32-bit values in the BitSet
bits 4 * numWords U32 Array of 32-bit values representing the bits in the BitSet
Clone this wiki locally