共用方式為


Overview

Modeling File Formats

This document describes the .x and .xanim file formats. These files describe the model and the model animations and are output when exporting a 3ds Max model to be used in ESP. Refer to the sections Exporting a 3ds Max model and Importing a Model to ESP, in the Using Modeling Toolsdocument.

See Also

Table of Contents

  • Co-ordinate Systems
  • The .X File Format
  • The .Xanim File Format
  • Specific Material Editor Options

Co-ordinate Systems

Direct 3D (the underlying Microsoft technology supporting the simulation graphics) and 3ds Max; use different 3D co-ordinate systems. Transformation matrices are applied by the export tool to convert from one co-ordinate system to another.

To translate a model from 3ds Max (right-handed) to D3D (left-handed) the following two matrix transformations are applied:

To convert from right-hand to left-hand, use the transformation matrix:

[ 1 1 -1 1 ]
[ 1 1 -1 1 ]
[ -1 -1 1 1]
[ 1 1 -1 1 ]

This will result in the Z axis up, and the Y axis towards the camera, so rotate around the X axis to make Y up, and Z away from the camera, using the following transformation matrix:

[ 1 0 0 0 ]
[ 0 0 1 0 ]
[ 0 -1 0 0 ]
[ 0 0 0 1 ]

The .X File Format

The extensions to the .X file format for ESP consist of a number of template definitions that are used to handle specific information, particularly about materials, but also some elements of animations. This section describes only the templates that are extensions to the format. Refer to DirectX SDK documentation for descriptions of the standard templates. The additional templates are:

Material Templates

  • AllowBloom
  • AlphaData
  • AmbientLightScale
  • AmbientTextureFileName
  • BaseMaterialSkin
  • BaseMaterialSpecular
  • BlendConstantSetting
  • BlendDiffiuseByBaseAlpha
  • BlendDiffuseByInverseSpecularMapAlpha
  • BloomData
  • BumpTextureFileName
  • DetailTextureFileName
  • DiffuseTextureFileName
  • DisplacementTextureFileName
  • DoubleSidedMaterial
  • EmissiveBloom
  • EmissiveData
  • EmissiveTextureFileName
  • EnhancedParameters
  • ForceTextureAddressClampSetting
  • ForceTextureAddressWrapSetting
  • FresnelTextureFileName
  • FS10Material
  • NNumberTexture
  • NoSpecularBloom
  • ReflectionTextureFilename
  • ShininessTextureFilename
  • SpecularBloomFloor
  • SpecularTextureFileName

Animation Templates

  • AnimLinkName
  • BoneInfo
  • IKChain
  • JointConstraints
  • MeshSkinWeights
  • PartData
Notes
  1. Some of the descriptions of variables simply state the field is "Reserved" and any use of these fields will be unsupported in future versions.
  2. The GUIDs in the templates are used by the code to match the template definition with the template entries in the file, the template names are present to make the entries human-readable.

Material Templates

Refer to the oil rig sample file TestX.x for examples of the use of these templates.

Template AllowBloom

template AllowBloom {
<D66E37C9-9DFE-4092-8565-C6E4C3498235>
Boolean ;
}
Materials. Set by the check box Allow Bloom, see Material Editor screen 2. [ from OilRig ]
 
AllowBloom {
1;
}
AllowBloom Set to 1 if bloom effects are to be enabled for this material.

Template AlphaData

template AlphaData {
<10DB69F3-E0EE-4fb3-8055-63E539EF5885>
Boolean ZTestAlpha;
FLOAT AlphaTestValue;
STRING AlphaTestFunction;
Boolean FinalAlphaWrite;
FLOAT FinalAlphaWriteValue;
}
Materials. Corresponds to the Material Alpha Test group box, see Material Editor screen 3. [ from B737_800]
 
AlphaData {
1; // ZTest Alpha
134.130005; // Alpha test threshold
"Greater"; // Alpha test function
0; // Perform final alpha write
255.000000; // Final alpha value
}
ZTestAlpha Set to 1 to turn the feature on. The test alpha feature is used to provide see through effects for objects such as trees and fences. For example, if the AlphaTestValue is set at 0.5 and the AlphaTestFunction as Greater, then pixels with an alpha value greater than 0.5 will not have a value written to the Z-buffer, so that see-through will occur.
AlphaTestValue A value between 0.0 and 1.0 that is used in the test.
AlphaTestFunction One of:
Never
Less
Equal
LessEqual
Greater
NotEqual
GreaterEqual
Always
 
Never and Always are unlikely to be used, never writing a value to the Z-buffer, or always writing a value. They are included for consistency with the underlying DirectX system. By far the most used test function is "Greater".
FinalAlphaWrite Reserved for run-time use.
FinalAlphaWriteValue Reserved for run-time use.

Template AmbientLightScale

template AmbientLightScale {
<4CC76AEB-E84F-4688-AB49-E1DC4B9273C7>
FLOAT AmbientLightScale;
}
Materials. Set by the Ambient light scale slider in Material Editor screen 2. [ from OilRig]
 
AmbientLightScale {
1.000000;
}
AmbientLightScale A value between 0.0 and 1.0. If this is set to 1.0 then full ambient light effects are applied to this material. However for bright materials, such as white, this can lead to white-out effects, so setting this value to lower value that 1.0 has a dulling effect on the ambient light.

Template AmbientTextureFileName

template AmbientTextureFileName {
<E00200E2-D4AB-481a-9B85-E20F9AE07402>
STRING filename;
}
FS9 Materials  
filename The ambient texture file. This was used in FS9 Materials to hold the emissive map, and will be overwritten if an FS10 Material map includes an EmissiveTextureFileName.

Template BaseMaterialSkin

template BaseMaterialSkin {
<B640F860-9E28-4cab-AD46-CACCE2A418AC>
Boolean AllowSkinning;
}
Materials. Set by the Skinned Mesh check box in the Enhanced Parameters group box in Material Editor screen 4 . BaseMaterialSkin {
0; // Skinned
}
AllowSkinning This is set to 1 if the object is skinned.

Template BaseMaterialSpecular

template BaseMaterialSpecular {
<E294ED4E-5C5A-4927-B19A-6A2D445FAF24>
Boolean AllowBaseMaterialSpecular;
}
Materials. Reset by the No Base Material Specular check box in the Enhanced Parameters group box in Material Editor screen 4 . BaseMaterialSpecular {
1; // AllowBaseMaterialSpecular
}
AllowBaseMaterialSpecular Set to 1 (the default) if specular effects are to apply to the base material.

Template BlendConstantSetting

template BlendConstantSetting {
<48EA96C3-588E-451d-B4BB-0C746C8380D9>
Boolean BlendConstant;
}
Materials. Set by the Blend Constant check box in the Enhanced Parameters group box in Material Editor screen 3. BlendConstantSetting {
0; // Blend constant
}
BlendConstant Reserved for run-time use.

Template BlendDiffuseByBaseAlpha

template BlendDiffuseByBaseAlpha {
<A623FA7C-37CB-4d17-B702-854E0DBDB467>
Boolean BlendDiffByBaseAlpha;
}
Materials. Set by the Blend diffuse by diffuse alpha check box in the Special Functionality group box, see Material Editor screen 2. BlendDiffuseByBaseAlpha {
0;
}
BlendDiffByBaseAlpha If this is set to 1 the diffuse color is multiplied by the diffuse alpha value.

Template BlendDiffuseByInverseSpecularMapAlpha

template BlendDiffuseByInverseSpecularMapAlpha {
<DAA68529-1C27-4182-9D97-E631A4759EA7>
Boolean BlendDiffuseByInvSpecAlpha;
}
Materials. Set by the Blend diffuse by inverse specular map alpha check box in the Special Functionality group box, see Material Editor screen 2. BlendDiffuseByInverseSpecularMapAlpha {
0;
}
BlendDiffuseByInvSpecAlpha If this is set to 1 the diffuse color is multiplied by the inverse (1.0 - value) of the specular alpha.

Template BloomData

template BloomData {
<58ED1E67-0D18-44EF-B676-40BB20C1EE88>
Boolean BloomCopy;
Boolean BloomModAlpha;
}
Materials. Set by the Bloom material by copying and Bloom material modulating alpha check boxes in the Bloom group box, see Material Editor screen 2. [ from generic Aurora ]
 
BloomData {
0; 1;
}
BloomCopy These two values are mutually exclusive, only one of BloomCopy or BloomModAlpha should be set.
If this is set to 1, the bloom color is a copy of the material color.
BloomModAlpha If this is set to 1, the bloom color is the result of the material color multiplied by its alpha value.

Template BumpTextureFileName

template BumpTextureFileName {
<E00200E2-D4AB-481a-9B85-E20F9AE07406>
STRING filename;
}
Materials  
filename The bump map file. Bump maps provide some 3D information of the surface so that lighting effects can give a more textured appearance.

Template DetailTextureFileName

template DetailTextureFileName {
<C223DC28-5C0E-41bc-9706-A30E023EF118>
STRING filename;
}
Materials  
filename Detail texture file. Used occasionally for such features as concrete paneling on runways, for example.

Template DiffuseTextureFileName

template DiffuseTextureFileName {
<E00200E2-D4AB-481a-9B85-E20F9AE07401>
STRING filename;
}
Materials DiffuseTextureFileName {
"oil_rig_texture_2.dds";
}
filename The most common texture file, providing the basic color map for the material. The recommended format for all texture files is the standard .dds, though non-standard .bmp files can be used.
 
If any of the TextureFileName entries use the virtual texture sheets for Virtual Cockpits that begin with the $ sign, then the filename entry must not include an extension.

Template DisplacementTextureFileName

template DisplacementTextureFileName {
<E00200E2-D4AB-481a-9B85-E20F9AE07407>
STRING filename;
}
Not used.  
filename Reserved.

Template DoubleSidedMaterial

template DoubleSidedMaterial {
<B1C6C3B0-DD1A-417b-919A-B04BAD6AE06D>
Boolean DoubleSided;
}
Materials. Set by the Double sided check box in the Enhanced Parameters group box, see Material Editor screen 4 . DoubleSidedMaterial {
0; // Double sided
}
DoubleSided Set to 1 if the material is double-sided. This means that the texture is visible from both sides (such as a tree texture), not just the side that the normal extends from. However, as lighting effects depend on the normal, this setting should usually be used with the Assume Vertical Normal setting checked.

Template EmissiveBloom

template EmissiveBloom {
<5FF8D7A2-30B5-41bc-A891-28A427D78246>
Boolean AllowEmissiveBloom;
}
Materials. Set by the Allow Emissive Bloom check box- see Material Editor screen 2. EmissiveBloom {
0; // AllowEmissiveBloom
}
AllowEmissiveBloom Set to 1 to allow emissive bloom from the material. Typically this would be on a very bright object, such as a neon sign.

Template EmissiveData

template EmissiveData {
<A02EF480-3ED3-433d-A71D-5CAC4775757A>
STRING EmissiveBlend;
}
Materials. Set in the Emissive Mode drop-down list, see Material Editor screen 3. EmissiveData {
"Blended"; // Emissive mode
}
EmissiveBlend Emissive mode is one of:
 
Additive
AdditiveNightOnly
Blend
MultiplyBlend
AdditiveUserControlled
AdditiveNightOnlyUserControlled
BlendUserControlled
MultiplyBlendUserControlled
 
The additive modes add the emissive data to the diffuse date (Addtive applies all the time, AdditiveNightOnly only applies at night time). The Blend mode linear interpolates between the two sets of data, the MultiplyBlend mode is applied progressively as it gets darker, and is typically used to add colored tints to light colored gauge elements. The UserControlled modes indicate that the effect is only to be applied when the Panel lights switch of the aircraft is on.

Template EmissiveTextureFileName

template EmissiveTextureFileName {
<E00200E2-D4AB-481a-9B85-E20F9AE07403>
STRING filename;
}
Materials  
filename The emissive texture file. This entry will overwrite any value in the AmbientTextureFileName. Emissive textures provide information on the light given off by the material.

Template EnhancedParameters

template EnhancedParameters {
<99CAD20D-DCC5-4ad4-ADAE-ED3CDE30CC02>
Boolean AssumeVerticalNormal;
Boolean ZWriteAlpha;
Boolean NoZWrite;
Boolean VolumeShadow;
Boolean NoShadow;
Boolean PrelitVertices;
}
Materials. Set in the Enhanced Parameters group box, see Material Editor screen 4 . EnhancedParameters {
0; // Assume vertical normal
0; // Z-Write alpha
0; // No Z-Write
0; // Volume shadow
0; // No shadow
0; // Prelit vertices
}
AssumeVerticalNormal Set if lighting effects should be applied as if the normal was vertical. Applies particularly to Double Sided textures.
ZWriteAlpha Set to 1 if any setting in the alpha channel is set in the Z-buffer.
NoZWrite Set to 1 if none of the material sets any value in the Z-buffer.
VolumeShadow Set to 1 if the material should create a volume shadow.
NoShadow Set to 1 if the material should not create any shadow.
PrelitVertices Reserved for run-time use.

Template ForceTextureAddressClampSetting

template ForceTextureAddressClampSetting {
<DB108D57-A3A8-4b76-8CB0-8379CDDEC074>
Boolean ForceTextureAddressClamp;
}
Materials. Set by the Force Texture Address Clamp check box in the Enhanced Parameters group box, see Material Editor screen 4 . ForceTextureAddressClampSetting {
0; // Force texture address clamp
}
ForceTextureAddressClamp Set to 1 to force texture address clamping. In this case textures are not repeated across an object, but instead the last pixel is repeated across the rest of the object. Often this pixel is transparent, otherwise a smearing effect is the result. This is used particularly when triangular areas of a texture have been defined.
It is mutually exclusive to the ForceTextureAddressWrapSetting.

Template ForceTextureAddressWrapSetting

template ForceTextureAddressWrapSetting {
<046EE84C-7977-4a11-AA2B-C79FF5391EDD>
Boolean ForceTextureAddressWrap;
}
Materials. Set by the Force Texture Address Wrap check box in the Enhanced Parameters group box, see Material Editor screen 4 . ForceTextureAddressWrapSetting {
0; // Force texture address wrap
}
ForceTextureAddressWrap Set to 1 if the texture is to be repeated across the face of the object (the default).
Mutually exclusive to the ForceTextureAddressClampSetting.

Template FresnelTextureFileName

template FresnelTextureFileName {
<C16742E5-974D-4576-870D-2047C79DF7A9>
STRING filename;
}
Materials  
filename The Fresnel ramp file. Fresnel ramps store how color changes depending on the angle of the viewer.

Template FS10Material

template FS10Material {
<16B4B490-C327-42e3-8A71-0FA35C817EA2>
ColorRGBA FallbackDiffuse;
ColorRGB Specular;
FLOAT Power;
FLOAT DetailScale;
FLOAT BumpScale;
FLOAT EnvironmentLevelScale;
Boolean bUseGlobalEnv;
Boolean bModEnvInvDiffuseAlpha;
Boolean bModEnvSpecularMapAlpha;
Boolean bFresnelDiffuse;
Boolean bFresnelSpecular;
Boolean bFresnelEnvironment;
Boolean bUsePrecipitation;
Boolean bPrecipOffset;
FLOAT PrecipOffset;
FLOAT SpecMapPowerScale;
STRING SrcBlend;
STRING DstBlend;
[...]
}
Materials. FS10Material {
0.588235; 0.588235; 0.588235; 1.000000;; // Diffuse component

0.900000; 0.900000; 0.900000;; // Specular component

0.000000; // Specular power

1.000000; 1.000000; // Detail and bump scales

0.200000; // Scale environment level factor

0; // Do not use global environment
0; // Do not blend env by inv diffuse alpha
0; // Do not blend env by specular map alpha

0; 0; 0; // Fresnel - diffuse = NO, Specular = NO, Env = NO

0; 0; 0.000000; // Precipitation - Use = NO, Offset = NO

64.000000; // Specular Map Power Scale

"One"; "Zero"; // Src/Dest blend
FallbackDiffuse If no texture is supplied, this is the color that will be used for the material. Refer to the Framebuffer Blend group box of Material Editor screen 3.
Specular The default specular RGB color to use if there is no specular map.
Power The power of the specular effect of the material. The more reflective the material the higher the power should be.
DetailScale Multipliers that apply to the detail map, how often it is to be repeated for each repetition of the texture. See the Other Texture Info group box of Material Editor screen 1.
BumpScale Multipliers that apply to the bump map, how often it is to be repeated for each repetition of the texture.
EnvironmentLevelScale Scalar value, from 0.0 to 1.0, for how visible the environment map should be.
bUseGlobalEnv Set to 0 if there is a custom environment map or the global environment map is to be turned off. See the Special Functionality group box of Material Editor screen 1.
bModEnvInvDiffuseAlpha Set to 1 to blend the environment map with the inverse of the diffuse alpha.
bModEnvSpecularMapAlpha Set to 1 to blend the environment map with the specular map alpha.
bFresnelDiffuse
bFresnelSpecular
bFresnelEnvironment
Three boolean values, set to 1 if the fresnel ramp applies to the diffuse, specular and environment maps. See the Fresnel Ramp group box of Material Editor screen 1.
bUsePrecipitiation Refer to the Precipitation group box of Material Editor screen 1. Set this value to 1 if the precipitation values are to apply to this material. Typically this makes the material more reflective if it is raining.
bPrecipOffset Set to 1 if the precipitation offset value is to apply.
PrecipOffset A value between 0 and 255 specifying the additional specular power of the material when it is raining.
SpecMapPowerScale A value between 0 and 255 indicating how intense a bright spot is created when the sun is shining directly on the surface. A high value will result in a more intense bright spot. Typically the highest value assigned is around 120. See the Special Functionality group box of Material Editor screen 1.
SrcBlend
Source and destination blends are both one of:
Zero
One
SrcColor
InvSrcColor
SrcAlpha
InvSrcAlpha
DestAlpha
InvDestAlpha
DestColor
InvDestColor
The most common combinations of source and destination blend are
1. One, Zero
meaning the result is all of the source color and none of the destination color - the destination color is what is present behind the surface of the source.
2. SrcAlpha, InvSrcAlpha
meaning the transparency of the source material is applied along with the opaqueness of the destination.
Refer to the Framebuffer Blend group box of Material Editor screen 3.
DstBlend See SrcBlend.
[...] Indicates that a FS10Material can contain additional information.

Template NNumberTexture

template NNumberTexture {
<E49E744A-CDBE-40c1-9C89-4A46BEB44D33>
Boolean IsNNumberTexture;
}
Unused.  
IsNNumberTexture Reserved for future use.

Template NoSpecularBloom

template NoSpecularBloom {
<BCE314D2-15DB-4ffd-9F6F-0763B2A4616F>
Boolean AllowSpecularBloom;
}
Materials. Set by the No specular bloom check box of the Bloom group box, see Material Editor screen 2. NoSpecularBloom {
1; // AllowSpecularBloom
}
AllowSpecularBloom Set to 0 to prevent specular bloom (default is 1).

Template ReflectionTextureFileName

template ReflectionTextureFileName {
<E00200E2-D4AB-481a-9B85-E20F9AE07404>
STRING filename;
}
Materials  
filename The Environment map file. Environment maps provide details of the reflective qualities of the material.

Template ShininessTextureFileName

template ShininessTextureFileName {
<E00200E2-D4AB-481a-9B85-E20F9AE07405>
STRING filename;
}
Unused.  
filename Reserved.

Template SpecularBloomFloor

template SpecularBloomFloor {
<21195174-A31D-47ed-BE5A-04ACAD4C3544>
FLOAT SpecularBloomFloor;
}
Materials. Set by the Specular Bloom Floor slider in the Bloom group box, see Material Editor screen 2. SpecularBloomFloor {
0.900000;
}
SpecularBloomFloor A value between 0.0 and 1.0. The results of the specular light calculations must exceed this value for bloom effects to be applied.

Template SpecularTextureFileName

template SpecularTextureFileName {
<DF64E0D7-4FFA-4634-9DA0-3EF2FAA081CE>
STRING filename;
}
Materials  
filename The specular color map file. Specular color settings define how a material reacts to a light source, often the Sun.

Specific Material Editor Options

Animation Templates

Refer to the oil rig sample file TestX.x for examples of the use of these templates. Note that there is a limit of 128 bones per model, and a limit of 22 connected bones. Any one vertex of a model can be influenced by a maximum of four bones. Models will fail if they exceed these limits.

  • AnimLinkName
  • BoneInfo
  • IKChain
  • JointConstraints
  • MeshSkinWeights
  • PartData

Template AnimLinkName

template AnimLinkName {
<0057EC91-F96B-4f5e-9CFB-0E305F39DA1A>
STRING linkName;
}
Animation. AnimLinkName { //Bone04
"Bone04";
}
linkName The name links the animation to the bone. A bone is named in the BoneInfo template.

Template BoneInfo

template BoneInfo {
<1FF0AE59-4B0B-4dfe-88F2-91D58E395767>
STRING boneName;
}
Animation. BoneInfo { //Bone04
"Bone04";
}
boneName The name of the bone. The name is used in the AnimLinkName, IKChain and MeshSkinWeights templates.

Template IKChain

template IKChain {
<2684B333-AAB2-45d9-87D8-6E2BB22616AD>
STRING chainName;
STRING startNode;
STRING endNode;
}
Animation. Refer also to the Jetway document.
 
IKChain IK_WheelsGroundLock {
"IK_WheelsGroundLock";
"Bone07";
"Bone09";
}
 
IKChain IK_MainHandle {
"IK_MainHandle";
"Bone02";
"Bone05";
}
 
IKChain IK_SecondaryHandle {
"IK_SecondaryHandle";
"Bone05";
"Bone06";
}
chainName The name of the chain.
startNode The node (BoneInfo name) that starts the chain.
endNode The node (BoneInfo name) that ends the chain.

Template JointConstraint

template ConstraintInfo {
<8713D495-C538-44dc-AE54-1097E7C93D13>
Boolean bActive;
Boolean bLimited;
FLOAT fUpperLimit;
FLOAT fLowerLimit;
}
 

template JointConstraint {
<BE433CF1-BCC0-43f8-9FE5-DB0556414426>
array ConstraintInfo Rotation[3];
array ConstraintInfo Translation[3];
}
Animation. The examples come from the model of the Jetway.
 
JointConstraint { //Bone06
1, 0, 0.000000, 0.000000;
1, 0, 0.000000, 0.000000;
1, 0, 0.000000, 0.000000;
0, 0, 0.000000, 0.000000;
0, 0, 0.000000, 0.000000;
0, 0, 0.000000, 0.000000;
}
 
JointConstraint { //Bone07
0, 0, 0.000000, 0.000000;
1, 1, 1.818633, 0.841249;
0, 0, 0.000000, 0.000000;
0, 0, 0.000000, 0.000000;
0, 0, 0.000000, 0.000000;
0, 0, 0.000000, 0.000000;
}
 
JointConstraint { //Bone08
0, 0, 0.000000, 0.000000;
0, 0, 0.000000, 0.000000;
0, 0, 0.000000, 0.000000;
1, 1, 6.000000, 0.600000;
0, 0, 6.000000, 0.600000;
0, 0, 6.000000, 0.600000;
}
 
JointConstraint { //Bone09
0, 0, 0.000000, 0.000000;
0, 0, 0.000000, 0.000000;
0, 0, 0.000000, 0.000000;
0, 0, 0.000000, 0.000000;
0, 0, 0.000000, 0.000000;
0, 0, 0.000000, 0.000000;
}
bActive Set to 1 if the joint can move, or 0 if there is no movement.
bLimited Set to 1 if the movement of the joint is limited.
fUpperLimit If the movement is a rotation, this is the upper limit of movement in radians. If the movement is a translation, the upper limit in meters of movement along the axis.
fLowerLimit If the movement is a rotation, this is the lower limit of movement in radians. If the movement is a translation, the lower limit in meters of movement along the axis.
Rotation Note that the exported rotation order is YZX
Translation The export order is XYZ.

Template MeshSkinWeights

template SkinWeight {
<C3B5EDF9-7345-463d-96D7-6386E2EC4030>
STRING boneRef;
FLOAT weight;
}

template SkinWeightGroup {
<E7B502DB-0C05-4288-A025-80762E19E0AB>
DWORD nWeights;
array SkinWeight skinWeights[nWeights];
}
 
 
template MeshSkinWeights {
<C7E2131A-30F3-4eb9-AACC-E0AE11D8FE62>
DWORD nVertices;
array SkinWeightGroup skinWeights[nVertices];
}
Animation. MeshSkinWeights { // Mesh skin weights for flag_100
56;
2;
"Bone01", 0.400000;
"Bone02", 0.600000;
2;
"Bone01", 0.400000;
"Bone02", 0.600000;
3;
"Bone03", 0.000000;
"Bone02", 0.700000;
"Bone01", 0.300000;
2;
"Bone01", 0.400000;
"Bone02", 0.600000;
..........
2;
"Bone03", 0.000000;
"Bone04", 1.000000;
2;
"Bone03", 0.000000;
"Bone04", 1.000000;
1;
"Bone04", 1.000000;
2;
"Bone04", 0.900000;
"Bone01", 0.100000;
} // End mesh skin weights for flag_100
nVertices The total number of skinWeight entries, which should match the number of vertices of the object. All the vertices are skinned vertices if the object has any skinning.
nWeights The number of weights for the entry. There is a minimum of 1 and a maximum of 4 weight entries per vertex. The entries match the vertex order..
boneRef The name of the bone that the weight applies to.
weight The relative weight that the bone has in influencing the movement of the skinned vertex. All weight entries should add up to 1.0.

Template PartData

template PartData {
<79B183BA-7E70-44d1-914A-23B304CA91E5>
DWORD nByteCount;
array BYTE XMLData[ nByteCount ];
}
Encoding XML data for attach points, platforms, visibility entries, mouse rectangles, and no-crash entries, into the X file. See table of PartData examples below.
nByteCount The number of elements in the following list.
XMLData A null terminated list of ASCII codes that match the XML entry. These entries include attach points, attached objects, no-crash settings and platforms.

PartData Examples

Attachpoint <?xml version="1.0" encoding="ISO-8859-1" ?> <FSMakeMdlData version="9.0"> <Attachpoint name="attachpt_Steam_Med_1"> <AttachedObject> <Effect effectName="fx_Steam_Med" effectParams=""/> </AttachedObject> </Attachpoint> </FSMakeMdlData>
Frame frm-attachpt_Steam_Med_1 {
PartData {
236;
60, 63, 120, 109, 108, 32, 118, 101, 114, 115,
105, 111, 110, 61, 34, 49, 46, 48, 34, 32,
101, 110, 99, 111, 100, 105, 110, 103, 61, 34,
73, 83, 79, 45, 56, 56, 53, 57, 45, 49,
34, 32, 63, 62, 32, 60, 70, 83, 77, 97,
107, 101, 77, 100, 108, 68, 97, 116, 97, 32,
118, 101, 114, 115, 105, 111, 110, 61, 34, 57,
46, 48, 34, 62, 32, 60, 65, 116, 116, 97,
99, 104, 112, 111, 105, 110, 116, 32, 110, 97,
109, 101, 61, 34, 97, 116, 116, 97, 99, 104,
112, 116, 95, 83, 116, 101, 97, 109, 95, 77,
101, 100, 95, 49, 34, 62, 32, 60, 65, 116,
116, 97, 99, 104, 101, 100, 79, 98, 106, 101,
99, 116, 62, 32, 60, 69, 102, 102, 101, 99,
116, 32, 101, 102, 102, 101, 99, 116, 78, 97,
109, 101, 61, 34, 102, 120, 95, 83, 116, 101,
97, 109, 95, 77, 101, 100, 34, 32, 101, 102,
102, 101, 99, 116, 80, 97, 114, 97, 109, 115,
61, 34, 34, 47, 62, 32, 60, 47, 65, 116,
116, 97, 99, 104, 101, 100, 79, 98, 106, 101,
99, 116, 62, 32, 60, 47, 65, 116, 116, 97,
99, 104, 112, 111, 105, 110, 116, 62, 32, 60,
47, 70, 83, 77, 97, 107, 101, 77, 100, 108,
68, 97, 116, 97, 62, 0;
} // End PartData
The example shows an attach point with an attached effect. It is also possible to attach a library object to the attach point, with the statement:
 
<AttachedObject>
<LibraryObject name="GUID" scale="1.0" />
</AttachedObject>
 
Examples of attached library objects would be hazard lights, rotating radar dishes, and so on.
 
All of the geometry for the attach point is removed and only the root point is retained.
Platform <?xml version="1.0" encoding="ISO-8859-1" ?> <FSMakeMdlData version="9.0"> <Platform name="platform_CONCRETE_0" surfaceType="CONCRETE" >
</Platform> </FSMakeMdlData>

Frame frm-platform_CONCRETE_0 {
PartData {
166;
60, 63, 120, 109, 108, 32, 118, 101, 114, 115,
105, 111, 110, 61, 34, 49, 46, 48, 34, 32,
101, 110, 99, 111, 100, 105, 110, 103, 61, 34,
73, 83, 79, 45, 56, 56, 53, 57, 45, 49,
34, 32, 63, 62, 32, 60, 70, 83, 77, 97,
107, 101, 77, 100, 108, 68, 97, 116, 97, 32,
118, 101, 114, 115, 105, 111, 110, 61, 34, 57,
46, 48, 34, 62, 32, 60, 80, 108, 97, 116,
102, 111, 114, 109, 32, 110, 97, 109, 101, 61,
34, 112, 108, 97, 116, 102, 111, 114, 109, 95,
67, 79, 78, 67, 82, 69, 84, 69, 95, 48,
34, 32, 115, 117, 114, 102, 97, 99, 101, 84,
121, 112, 101, 61, 34, 67, 79, 78, 67, 82,
69, 84, 69, 34, 32, 62, 32, 60, 47, 80,
108, 97, 116, 102, 111, 114, 109, 62, 32, 60,
47, 70, 83, 77, 97, 107, 101, 77, 100, 108,
68, 97, 116, 97, 62, 0;
} // End PartData
When specifying that a part is a platform, it is implied that the part also has the </NoCrash> attribute set.
 
Platforms cannot have an animated part at any point in their parent hierarchy.
 
The surfaceType entry must be one of:
 
ASPHALT,
BITUMINOUS
BRICK
CONCRETE
CORAL
DIRT
FOREST
GRASS
GRASS_BUMPY
GRAVEL
HARD_TURF
ICE
LONG_GRASS
MACADAM
OIL_TREATED
PLANKS
SAND
SHALE
SHORT_GRASS
SNOW
STEEL_MATS
TARMAC
URBAN
WATER
WRIGHT_FLYER_TRACK
 
Note that this list does not exactly match the surface types used by the BGL compiler.
MouseRect <?xml version="1.0" encoding="ISO-8859-1" ?> <FSMakeMdlData version="9.0"> <MouseRect name="lever_pfd_mfd_select_4"> </MouseRect> </FSMakeMdlData> Frame frm-lever-pfd-mfd-select_4_1 {
PartData {
147;
60, 63, 120, 109, 108, 32, 118, 101, 114, 115,
105, 111, 110, 61, 34, 49, 46, 48, 34, 32,
101, 110, 99, 111, 100, 105, 110, 103, 61, 34,
73, 83, 79, 45, 56, 56, 53, 57, 45, 49,
34, 32, 63, 62, 32, 60, 70, 83, 77, 97,
107, 101, 77, 100, 108, 68, 97, 116, 97, 32,
118, 101, 114, 115, 105, 111, 110, 61, 34, 57,
46, 48, 34, 62, 32, 60, 77, 111, 117, 115,
101, 82, 101, 99, 116, 32, 110, 97, 109, 101,
61, 34, 108, 101, 118, 101, 114, 95, 112, 102,
100, 95, 109, 102, 100, 95, 115, 101, 108, 101,
99, 116, 95, 52, 34, 62, 32, 60, 47, 77,
111, 117, 115, 101, 82, 101, 99, 116, 62, 32,
60, 47, 70, 83, 77, 97, 107, 101, 77, 100,
108, 68, 97, 116, 97, 62, 0;
} // End PartData

 
Visibility <?xml version="1.0" encoding="ISO-8859-1" ?> <FSMakeMdlData version="9.0"> <Visibility name="prop1_blurred"> </Visibility> </FSMakeMdlData> Frame frm-N1_1_blurred_50 {
PartData {
140;
60, 63, 120, 109, 108, 32, 118, 101, 114, 115,
105, 111, 110, 61, 34, 49, 46, 48, 34, 32,
101, 110, 99, 111, 100, 105, 110, 103, 61, 34,
73, 83, 79, 45, 56, 56, 53, 57, 45, 49,
34, 32, 63, 62, 32, 60, 70, 83, 77, 97,
107, 101, 77, 100, 108, 68, 97, 116, 97, 32,
118, 101, 114, 115, 105, 111, 110, 61, 34, 57,
46, 48, 34, 62, 32, 60, 86, 105, 115, 105,
98, 105, 108, 105, 116, 121, 32, 110, 97, 109,
101, 61, 34, 112, 114, 111, 112, 49, 95, 98,
108, 117, 114, 114, 101, 100, 34, 62, 32, 60,
47, 86, 105, 115, 105, 98, 105, 108, 105, 116,
121, 62, 32, 60, 47, 70, 83, 77, 97, 107,
101, 77, 100, 108, 68, 97, 116, 97, 62, 0;
} // End PartData
 
NoCrash <?xml version="1.0" encoding="ISO-8859-1" ?> <FSMakeMdlData version="9.0"> </NoCrash> </FSMakeMdlData> No examples. If a NoCrash entry is made for a part, then a collision between an aircraft and the part will not result in a crash. Platforms automatically have NoCrash attributes set.

The .Xanim File Format

The .xanim file is output when exporting a model that contains animations from 3ds Max. Some of the information in it is copied across from Modeldef.xml, a file that is used by the 3ds Max tools, but not by the simulation. The entries in Modeldef.xml are described in the Creating a New Animation section of the Using Modeling Toolsdocument. Refer also to the TestX.xanim file supplied with the OilRig sample of the Modeling SDK.

<Anim Describes an animation. There will be one Anim entry for each named animation used by the model.
 
The properties information all comes from the Modeldef.xml file. The name ("Ambient" in the example) is the friendly name used for the animation, the guid is its unique identifier, the length the length of the animation in frames. The type can either be Standard or Sim. The typeParam can be empty or contain one or both of AutoPlay and Random.
 
If the type of the animation is Sim then the typeParam2 identifies the script code from Modeldef.xml that is to be run when the animation is triggered. As a naming convention, this script often has the same name as the animation itself.
<Anim name="Ambient" guid="A6F1C5D0-BEF6-449e-BAF8-FB777F27808F" length="60.000000"
type="Standard" typeParam="AutoPlay,Random" typeParam2="">

 
<Anim name="r_tire_still_key" guid="6114e2ca-5fb8-4d20-a880-56945094247f" length="100.000000"   type="Sim" typeParam="AutoPlay" typeParam2="r_tire_still_key">
<AnimStream Each animation consists of one or more AnimStream entries. The name can be one of: Rotation, Position or Event. No other names (animation types) are currently supported. The id numbers are simply 0, 2 and 3 for these three types of animation. The partName identifies the 3ds Max model part, and the length is in frames. <AnimStream name="Rotation" id="0" partName="Bone02" length="60.000000">
 
<AnimStream name="Position" id="2" partName="CraneSmallRig_Hook_100" length="400.000000">
 
<AnimStream name="Event" id="3" partName="WhaleMovement01" length="1136638.500000">
<Keyframe An animation stream consists of a large number, usually, of Keyframe entries. The content of each entry depends on whether the animation is a rotation, position or event.
 
For all types the time entry identifies the frame when the rotation, translation or event is to occur.
 
For rotations the type is always "Quaternion" and the four numbers identify the x,y,z vector relative to the position of the part at frame 0, and the rotation in radians. Quaternion math is described on a number of websites including:
 
http://en.wikipedia.org/wiki/Quaternion
 
For position (usually called translation) entries the type is always "Vector" and the w entry in the x,y,z,w list of numbers is ignored. The x,y,z represent relative offsets to the position of the part at frame 0. The units of the movement are the units of the model (usually meters).
 
For events, the type is always "Event" and the data contains a string in the format:
CCCC;parameters
where CCCC identifies the type of event. Currently only VFX0 is supported, which triggers a special effect. Following the semicolon are the special effects parameters: the name of the effect file and the name of the attach point.
 
[Rotation]
 
<Keyframe time="0.000000" type="Quaternion" data="0.000000;0.000000;0.000000;1.000000"/>
<Keyframe time="1.016667" type="Quaternion" data="0.000000;-0.029964;0.000000;0.999551"/>
<Keyframe time="2.033333" type="Quaternion" data="-0.000000;-0.060049;-0.000000;0.998195"/>
<Keyframe time="3.050000" type="Quaternion" data="0.000000;-0.089631;0.000000;0.995975"/>

 
[Position]
 
<Keyframe time="0.000000" type="Vector" data="0.000000;0.000000;-0.000000;0.0"/>
<Keyframe time="28.000000" type="Vector" data="0.024544;-0.000454;0.000061;0.0"/>
<Keyframe time="32.000000" type="Vector" data="0.039199;-0.001118;0.000172;0.0"/>
<Keyframe time="36.000000" type="Vector" data="0.065167;-0.000076;0.000401;0.0"/>

 
[Event]
<Keyframe time="302.000000" type="Event" data="VFX0;fx_blowHole,attachpt_blowHole"/>
<Keyframe time="1638.000000" type="Event" data="VFX0;fx_blowHole,attachpt_blowHole"/>