DMX model: Difference between revisions
Jump to navigation
Jump to search
TomEdwards (talk | contribs) mNo edit summary |
TomEdwards (talk | contribs) (updated from some ASCII DMX examples) |
||
Line 4: | Line 4: | ||
* {{todo|Are names case sensitive?}} | * {{todo|Are names case sensitive?}} | ||
<source lang=cpp> | <source lang=cpp> | ||
class | class DmeModelRoot | ||
{ | { | ||
// model and skeleton point to the same object | |||
DmeModel* model; | |||
// model and skeleton | DmeModel* skeleton; | ||
DmeCombinationOperator* combinationOperator; // flex animations only | |||
}; | }; | ||
class | class DmeCombinationOperator | ||
{ | { | ||
CUtlString | DmeCombinationInputControl controls[]; | ||
Vector controlValues[]; // rest position...but why a 3D vector? | |||
Vector controlValuesLagged[]; | |||
bool usesLaggedValues; | |||
bool | DmeMesh* dominators[]; | ||
DmeMesh* targets[]; // mesh with shapes on | |||
}; | |||
class DmeCombinationInputControl // flex controller | |||
{ | |||
CUtlString rawControlNames[]; | |||
bool stereo; | |||
bool eyelid; | |||
float wrinkleScales[]; | |||
}; | |||
class DmeModel | |||
{ | |||
DmeTransform* transform; // global model transform? | |||
DmeAttachment* shape; // defines | |||
bool visible; | |||
DmeModel children[]; // also seen with "DmeDag" elements, which seem identical to DmeModels...? | |||
DmeJoint jointList[]; | |||
DmeVertexData BaseStates[]; | |||
CUtlString upAxis; // uppercase character | |||
}; | |||
class DmeDag // purpose unclear: seen defining both bones and meshes | |||
{ | |||
DmeTransform* transform; | |||
DmeAttachment* shape; | |||
bool visible; | |||
DmeDag children[]; | |||
}; | }; | ||
class | class DmeJoint // a bone | ||
{ | |||
DmeTransform* transform; | |||
void* shape; // only seen empty | |||
bool visible; | |||
DmeJoint children[]; | |||
bool lockInfluenceWeights; | |||
class DmeTransform // name is of a defined model if there are children, otherwise blank | |||
{ | { | ||
Vector position; | Vector position; | ||
Quaternion orientation; | Quaternion orientation; | ||
}; | }; | ||
// Collection of states...suspected that there will only be more than one in a vertex animation DMX. | class DmeAttachment | ||
{ | |||
bool visible; | |||
bool IsRigid; | |||
bool isWorldAligned; | |||
}; | |||
class DmeMesh // Collection of states...suspected that there will only be more than one in a vertex animation DMX. | |||
{ | { | ||
bool visible; | bool visible; | ||
DmeVertexData bindState; // needs confirmation - only seen empty | |||
DmeVertexData* currentState; // pointer to default baseState | |||
DmeVertexData baseStates[]; | |||
DmeVertexData deltaStates[]; | |||
DmeFaceSet faceSets[]; | |||
Vector2D deltaStateWeights[]; | Vector2D deltaStateWeights[]; | ||
Line 51: | Line 88: | ||
// Actual model/skeleton data | // Actual model/skeleton data | ||
class | class DmeVertexData | ||
{ | { | ||
CUtlString vertexFormat[]; | CUtlString vertexFormat[]; | ||
int jointCount; | int jointCount; | ||
Line 69: | Line 105: | ||
// Defines a group of faces, and associates them with a material | // Defines a group of faces, and associates them with a material | ||
class | class DmeFaceSet | ||
{ | { | ||
DmeMaterial material; | |||
int faces[]; | |||
int | |||
}; | }; | ||
// A material reference | // A material reference | ||
class | class DmeMaterial | ||
{ | { | ||
CUtlString | CUtlString mtlName; // relative to /materials, no extension | ||
}; | }; | ||
</source> | </source> |
Revision as of 13:35, 4 January 2011
For sanity's sake, the data structure is expressed in pseudo-C++.
- Todo: Are names case sensitive?
class DmeModelRoot
{
// model and skeleton point to the same object
DmeModel* model;
DmeModel* skeleton;
DmeCombinationOperator* combinationOperator; // flex animations only
};
class DmeCombinationOperator
{
DmeCombinationInputControl controls[];
Vector controlValues[]; // rest position...but why a 3D vector?
Vector controlValuesLagged[];
bool usesLaggedValues;
DmeMesh* dominators[];
DmeMesh* targets[]; // mesh with shapes on
};
class DmeCombinationInputControl // flex controller
{
CUtlString rawControlNames[];
bool stereo;
bool eyelid;
float wrinkleScales[];
};
class DmeModel
{
DmeTransform* transform; // global model transform?
DmeAttachment* shape; // defines
bool visible;
DmeModel children[]; // also seen with "DmeDag" elements, which seem identical to DmeModels...?
DmeJoint jointList[];
DmeVertexData BaseStates[];
CUtlString upAxis; // uppercase character
};
class DmeDag // purpose unclear: seen defining both bones and meshes
{
DmeTransform* transform;
DmeAttachment* shape;
bool visible;
DmeDag children[];
};
class DmeJoint // a bone
{
DmeTransform* transform;
void* shape; // only seen empty
bool visible;
DmeJoint children[];
bool lockInfluenceWeights;
class DmeTransform // name is of a defined model if there are children, otherwise blank
{
Vector position;
Quaternion orientation;
};
class DmeAttachment
{
bool visible;
bool IsRigid;
bool isWorldAligned;
};
class DmeMesh // Collection of states...suspected that there will only be more than one in a vertex animation DMX.
{
bool visible;
DmeVertexData bindState; // needs confirmation - only seen empty
DmeVertexData* currentState; // pointer to default baseState
DmeVertexData baseStates[];
DmeVertexData deltaStates[];
DmeFaceSet faceSets[];
Vector2D deltaStateWeights[];
Vector2D deltaStateWeightsLagged[];
};
// Actual model/skeleton data
class DmeVertexData
{
CUtlString vertexFormat[];
int jointCount;
bool flipVCoordinates;
Vector positions[];
int positionsIndicies[];
Vector normals[];
int normalsIndicies[];
Vector2D textureCoordinates[];
int textureCoordinatesIndicies[];
};
// Defines a group of faces, and associates them with a material
class DmeFaceSet
{
DmeMaterial material;
int faces[];
};
// A material reference
class DmeMaterial
{
CUtlString mtlName; // relative to /materials, no extension
};