• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

P3D v4 XToMdl error - searching errors in the x-file

Vitus

Resource contributor
Messages
1,480
Country
newzealand
Hi guys,

I need some help debugging the Blender P3D/FSX toolkit. I am working on the exporter and try to get PBR working with the tool and finished the adjustment of the X-file. But When trying to export, I get a XToMdl.exe error:
Code:
(0): error :
(0): error : ----------------------------------------------------------------
(0): error :
(0): error : XToMdl.exe Unhandled Application Exception
(0): error :
(0): error : System.ArgumentOutOfRangeException
(0): error :
(0): error : Index was out of range. Must be non-negative and less than the size of the collection.
(0): error : Parameter name: index
(0): error :
(0): error : ----------------------------------------------------------------
(0): error :
(0): error : Stack Trace:
(0): error :
(0): error :    at System.Collections.ArrayList.get_Item(Int32 index)
(0): error :    at Microsoft.FlightSimulator.XToXmlLib.LODBuckets.GetHighestGranularityBucket()
(0): error :    at Microsoft.FlightSimulator.XToXmlLib.ModelProcessingContext.BuildCrashTree()
(0): error :    at Microsoft.FlightSimulator.XToXmlLib.ModelProcessingContext.Optimize()
(0): error :    at Microsoft.FlightSimulator.XToXmlLib.XToXmlLib.<GetFileProcessor>d__25.MoveNext()
(0): error :    at Microsoft.FlightSimulator.XToXmlLib.FileExporter.OutputModels(IEnumerable ProcessedModels)
(0): error :    at Microsoft.FlightSimulator.XToXmlLib.XToXmlLib.OutputModels(IEnumerable`1 processedModels)
(0): error :    at Microsoft.FlightSimulator.XToXmlLib.XToXmlLib.Process(ModelFile[] InputFiles, Hashtable[] AnimationLinkage, String[] AnimationFileRef, XPartDict PartDictionary)
(0): error :    at Microsoft.FlightSimulator.XToMDL.XToMDL.ProcessInputs()
(0): error :    at Microsoft.FlightSimulator.XToMDL.XToMDL.RealMain(String[] args)
(0): error :    at Microsoft.FlightSimulator.XToMDL.XToMDL.Main(String[] args)

The object I am trying to export is a simple cube with PBR material. Here's the X-file the exporter generated:
Code:
xof 0302txt 0032

// Direct3D .x file translation of context.scene
// Generated by Blender 2.82.7, Blender2P3D/FSX Version (0, 97, 0)
// 2020-03-25  12:49:39


template Header {
 <3D82AB43-62DA-11cf-AB39-0020AF71E433>
 WORD major;
 WORD minor;
 DWORD flags;
}

template GuidToName {
 <7419dfe5-b73a-4d66-98d8-c082591dc9e7>
 STRING Guid;
 STRING Name;
}

template Vector {
 <3D82AB5E-62DA-11cf-AB39-0020AF71E433>
 FLOAT x;
 FLOAT y;
 FLOAT z;
}

template ShadowMapReady {
 <2F4F86A9-FE94-4f75-AA1B-299BBD98907B>
 Boolean SMReady;
}

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 Coords2d {
 <F6F23F44-7686-11cf-8F52-0040333594A3>
 FLOAT u;
 FLOAT v;
}

template Matrix4x4 {
 <F6F23F45-7686-11cf-8F52-0040333594A3>
 array FLOAT matrix[16];
}

template ColorRGBA {
 <35FF44E0-6C7C-11cf-8F52-0040333594A3>
 FLOAT red;
 FLOAT green;
 FLOAT blue;
 FLOAT alpha;
}

template ColorRGB {
 <D3E16E81-7835-11cf-8F52-0040333594A3>
 FLOAT red;
 FLOAT green;
 FLOAT blue;
}

template TextureFilename {
 <A42790E1-7810-11cf-8F52-0040333594A3>
 STRING filename;
}

template Material {
 <3D82AB4D-62DA-11cf-AB39-0020AF71E433>
 ColorRGBA faceColor;
 FLOAT power;
 ColorRGB specularColor;
 ColorRGB emissiveColor;
 [...]
}

template MeshFace {
 <3D82AB5F-62DA-11cf-AB39-0020AF71E433>
 DWORD nFaceVertexIndices;
 array DWORD faceVertexIndices[nFaceVertexIndices];
}

template MeshTextureCoords {
 <F6F23F40-7686-11cf-8F52-0040333594A3>
 DWORD nTextureCoords;
 array Coords2d textureCoords[nTextureCoords];
}
template MeshSkinWeights {
 <C7E2131A-30F3-4eb9-AACC-E0AE11D8FE62>
 DWORD nVertices;
 array SkinWeightGroup skinWeights[nVertices];
}

template MeshMaterialList {
 <F6F23F42-7686-11cf-8F52-0040333594A3>
 DWORD nMaterials;
 DWORD nFaceIndexes;
 array DWORD faceIndexes[nFaceIndexes];
 [Material]
}

template MeshNormals {
 <F6F23F43-7686-11cf-8F52-0040333594A3>
 DWORD nNormals;
 array Vector normals[nNormals];
 DWORD nFaceNormals;
 array MeshFace faceNormals[nFaceNormals];
}

template Mesh {
 <3D82AB44-62DA-11cf-AB39-0020AF71E433>
 DWORD nVertices;
 array Vector vertices[nVertices];
 DWORD nFaces;
 array MeshFace faces[nFaces];
 [...]
}

template BoneInfo {
 <1FF0AE59-4B0B-4dfe-88F2-91D58E395767>
 STRING boneName;
}

template AnimLinkName {
 <0057EC91-F96B-4f5e-9CFB-0E305F39DA1A>
 STRING linkName;
}

template IKChain {
 <2684B333-AAB2-45d9-87D8-6E2BB22616AD>
 STRING chainName;
 STRING startNode;
 STRING endNode;
}

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

// Note that the exported rotation order is YZX
template JointConstraint {
 <BE433CF1-BCC0-43f8-9FE5-DB0556414426>
 array ConstraintInfo Rotation[3];
 array ConstraintInfo Translation[3];
}

template FrameTransformMatrix {
 <F6F23F41-7686-11cf-8F52-0040333594A3>
 Matrix4x4 frameMatrix;
}

template Frame {
 <3D82AB46-62DA-11cf-AB39-0020AF71E433>
 [...]
}
template FloatKeys {
 <10DD46A9-775B-11cf-8F52-0040333594A3>
 DWORD nValues;
 array FLOAT values[nValues];
}

template TimedFloatKeys {
 <F406B180-7B3B-11cf-8F52-0040333594A3>
 DWORD time;
 FloatKeys tfkeys;
}

template AnimationKey {
 <10DD46A8-775B-11cf-8F52-0040333594A3>
 DWORD keyType;
 DWORD nKeys;
 array TimedFloatKeys keys[nKeys];
}

template AnimationOptions {
 <E2BF56C0-840F-11cf-8F52-0040333594A3>
 DWORD openclosed;
 DWORD positionquality;
}

template Animation {
 <3D82AB4F-62DA-11cf-AB39-0020AF71E433>
 [...]
}

template AnimationSet {
 <3D82AB50-62DA-11cf-AB39-0020AF71E433>
 [Animation]
}

template DiffuseTextureFileName {
 <E00200E2-D4AB-481a-9B85-E20F9AE07401>
 STRING filename;
}

template DiffuseTextureUVChannel {
 <E0A8A960-BA3F-4E17-805C-D0B94831BAA4>
 DWORD uvChannel;
}

template SpecularTextureFileName {
 <DF64E0D7-4FFA-4634-9DA0-3EF2FAA081CE>
 STRING filename;
}

template SpecularTextureUVChannel {
 <0E95C17B-0AEF-4D07-BA90-E4B2CD5E01AE>
 DWORD uvChannel;
}

template AmbientTextureFileName {
 <E00200E2-D4AB-481a-9B85-E20F9AE07402>
 STRING filename;
}

template AmbientTextureUVChannel {
 <FAADED67-439E-446F-B96B-5381A0DC731F>
 DWORD uvChannel;
}

template EmissiveTextureFileName {
 <E00200E2-D4AB-481a-9B85-E20F9AE07403>
 STRING filename;
}

template EmissiveTextureUVChannel {
 <F8EF95D3-0307-41C7-9A42-CBE434A97BFA>
 DWORD uvChannel;
}

template ReflectionTextureFileName {
 <E00200E2-D4AB-481a-9B85-E20F9AE07404>
 STRING filename;
}

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

template ShininessTextureUVChannel {
 <98C9B8F8-4A0F-48C7-9886-38299FB8210B>
 DWORD uvChannel;
}

template BumpTextureFileName {
 <E00200E2-D4AB-481a-9B85-E20F9AE07406>
 STRING filename;
}

template BumpTextureUVChannel {
 <12B12581-A164-4D63-AB12-41B2F43F7793>
 DWORD uvChannel;
}

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

template DisplacementTextureUVChannel {
 <BB58EEEF-9200-42FA-BF5F-4297948CD2BA>
 DWORD uvChannel;
}

template DetailTextureFileName {
 <C223DC28-5C0E-41bc-9706-A30E023EF118>
 STRING filename;
}

template DetailTextureUVChannel {
 <6BCF39C7-4E24-4977-803A-521BABF54D34>
 DWORD uvChannel;
}

template FresnelTextureFileName {
 <C16742E5-974D-4576-870D-2047C79DF7A9>
 STRING filename;
}

template P3DMaterial {
 <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;
 [...]
}
            
template AllowBloom {
 <D66E37C9-9DFE-4092-8565-C6E4C3498235>
 Boolean     AllowBloom;
}

template BloomData {
 <58ED1E67-0D18-44EF-B676-40BB20C1EE88>
 Boolean BloomCopy;
 Boolean BloomModAlpha;
}

template SpecularBloomFloor {
 <21195174-A31D-47ed-BE5A-04ACAD4C3544>
 FLOAT     SpecularBloomFloor;
}

template AmbientLightScale {
 <4CC76AEB-E84F-4688-AB49-E1DC4B9273C7>
 FLOAT     AmbientLightScale;
}

template EmissiveData {
 <A02EF480-3ED3-433d-A71D-5CAC4775757A>
 STRING   EmissiveBlend;
}

template AlphaData {
 <10DB69F3-E0EE-4fb3-8055-63E539EF5885>
 Boolean  ZTestAlpha;
 FLOAT    AlphaTestValue;
 STRING   AlphaTestFunction;
 Boolean  FinalAlphaWrite;
 FLOAT    FinalAlphaWriteValue;
}

template MaskDiffuseBlendsByDetailBlendMask {
 <442265E0-6F93-43C8-8310-C3E1E6848833>
 Boolean  MaskDiffuseBlendsByDetailBlendMask;
}

template MaskFinalAlphaBlendByDetailBlendMask {
 <73671D1D-535E-4DC6-A543-5B226273C5DA>
 Boolean  MaskFinalAlphaBlendByDetailBlendMask;
}

template EnhancedParameters {
 <99CAD20D-DCC5-4ad4-ADAE-ED3CDE30CC02>
 Boolean  AssumeVerticalNormal;
 Boolean  ZWriteAlpha;
 Boolean  NoZWrite;
 Boolean  VolumeShadow;
 Boolean  NoShadow;
 Boolean  PrelitVertices;
}

template BaseMaterialSpecular {
 <E294ED4E-5C5A-4927-B19A-6A2D445FAF24>
 Boolean  AllowBaseMaterialSpecular;
}

template BaseMaterialSkin {
 <B640F860-9E28-4cab-AD46-CACCE2A418AC>
 Boolean  AllowSkinning;
}

template DoubleSidedMaterial {
 <B1C6C3B0-DD1A-417b-919A-B04BAD6AE06D>
 Boolean  DoubleSided;
}

template BlendConstantSetting {
 <48EA96C3-588E-451d-B4BB-0C746C8380D9>
 Boolean  BlendConstant;
}

template ForceTextureAddressWrapSetting {
 <046EE84C-7977-4a11-AA2B-C79FF5391EDD>
 Boolean  ForceTextureAddressWrap;
}

template ForceTextureAddressClampSetting {
 <DB108D57-A3A8-4b76-8CB0-8379CDDEC074>
 Boolean  ForceTextureAddressClamp;
}

template ZBiasValue {
<66F4E05E-94B9-4F07-AE1B-1FFE66810F4E>
FLOAT  ZBias;
}

template NoSpecularBloom {
 <BCE314D2-15DB-4ffd-9F6F-0763B2A4616F>
 Boolean AllowSpecularBloom;
}

template EmissiveBloom {
 <5FF8D7A2-30B5-41bc-A891-28A427D78246>
 Boolean  AllowEmissiveBloom;
}

template BlendDiffuseByBaseAlpha {
 <A623FA7C-37CB-4d17-B702-854E0DBDB467>
 Boolean  BlendDiffByBaseAlpha;
}

template BlendDiffuseByInverseSpecularMapAlpha {
 <DAA68529-1C27-4182-9D97-E631A4759EA7>
 Boolean  BlendDiffuseByInvSpecAlpha;
}

template NNumberTexture {
 <E49E744A-CDBE-40c1-9C89-4A46BEB44D33>
 Boolean  IsNNumberTexture;
}

template MaterialScript {
 <2EE1D70C-4903-4205-AB03-B4A21BF7F323>
 STRING  MaterialScriptFilename;
}

template UseEmissiveAlphaAsHeatMap {
 <F5A3E710-014D-450F-8597-78D00D4AC048>
 Boolean  UseEmissiveAlphaHeatMap;
}

template TemperatureScale {
 <8215033A-0F10-45F0-8493-5C60DC4DD5B5>
 FLOAT  TemperatureScalar;
}

template DetailColor {
 <68E59B99-A9A1-4E27-8660-6B83520657BB>
 ColorRGBA  DetailColor;
}

template DetailTextureParameters {
 <B1D63F06-FCFB-4DCA-B51A-8889A594EBAE>
 FLOAT    DetailOffsetU;
 FLOAT    DetailOffsetV;
 FLOAT    DetailRotation;
 FLOAT    DetailScaleV;
 STRING   DetailBlendMode;
 FLOAT    DetailBlendWeight;
 Boolean  UseDetailAlphaAsBlendMask;
}

template PBRMaterial {
 <91A9F118-F571-4440-B40C-E822088EEBB7>
 ColorRGBA Albedo;
 FLOAT     Metallic;
 FLOAT     Smoothness;
 STRING    RenderMode;
 FLOAT     MaskedThreshold;
 Boolean   AlphaToCoverage;
 Boolean   MetallicHasOcclusion;
 STRING    SmoothnessSource;
 STRING    EmissiveMode;
 Boolean   AssumeVerticalNormal;
 Boolean   Prelit;
 Boolean   DoubleSided;
 DWORD     DecalOrder;
 [...]
}

template AlbedoTextureFileName {
 <23F8BD09-7405-4492-88C9-0428E31DF902>
 STRING filename;
}

template AlbedoTextureUVChannel {
 <61C9E02F-9AB2-4A3E-8849-7FE0A9B56B89>
 DWORD uvChannel;
}

template MetallicTextureFileName {
 <287C8494-CBF8-4050-B2F4-2030D27246FD>
 STRING filename;
}

template MetallicTextureUVChannel {
 <FAF56F68-4C7C-475D-807C-4C1244AF83D7>
 DWORD uvChannel;
}

template NormalTextureFileName {
 <09176F1D-E9F6-4674-8BD2-D89C02CBE19E>
 STRING filename;
}

template NormalTextureUVChannel {
 <C1680BD6-CC82-4390-844A-95B2B80ADE4B>
 DWORD uvChannel;
}

template NormalTextureScale {
 <AAD9D138-F62B-49AF-B09A-DD628D0E2250>
 FLOAT u;
 FLOAT v;
}

template DetailTextureScale {
 <4762DCAD-6B53-4BDA-8464-E85E19B4D8F4>
 FLOAT u;
 FLOAT v;
}
            
template PartData {
 <79B183BA-7E70-44d1-914A-23B304CA91E5>
 DWORD nByteCount;
 array BYTE XMLData[ nByteCount ];
}

Header {
    1;
    0;
    1;
}       
        GuidToName {
    "{99d3266c-a531-45a1-1626-88f1d63282ba}";
    "test_cube";
}

ShadowMapReady {
    0;
}


//=====================
// FILE NODE HIERARCHY
//=====================
// Scene_Root
//   Cube

Frame frm-MasterScale {
FrameTransformMatrix {
   0.000977, 0.0, 0.0, 0.0,
   0.0, 0.000977, 0.0, 0.0,
   0.0, 0.0, 0.000977, 0.0,
   0.0, 0.0, 0.0, 1.0;;
}  // End frm-MasterScale FrameTransformMatrix
Frame frm-MasterUnitConversion {
FrameTransformMatrix {
   1024.000000, 0.0, 0.0, 0.0,
   0.0, 1024.000000, 0.0, 0.0,
   0.0, 0.0, 1024.000000, 0.0,
   0.0, 0.0, 0.0, 1.0;;
}  // End frm-MasterUnitConversion FrameTransformMatrix
Frame RotateAroundX {
FrameTransformMatrix {
   1.0, 0.0, 0.0, 0.0,
   0.0, 0.0, 1.0, 0.0,
   0.0, 1.0, 0.0, 0.0,
   0.0, 0.0, 0.0, 1.0;;
}  // End Frame RotateAroundX FrameTransformMatrix
  Frame frm-Cube {
    FrameTransformMatrix {
       1.000000, 0.000000, 0.000000, 0.000000,
       0.000000, 1.000000, 0.000000, 0.000000,
       0.000000, 0.000000, 1.000000, 0.000000,
       0.000000, 0.000000, 0.000000, 1.000000;;
    }
    Mesh { // Cube mesh
      36;
      -1.000000; 1.000000; 1.000000;,
       1.000000;-1.000000; 1.000000;,
       1.000000; 1.000000; 1.000000;,
       1.000000;-1.000000; 1.000000;,
      -1.000000;-1.000000;-1.000000;,
       1.000000;-1.000000;-1.000000;,
      -1.000000;-1.000000; 1.000000;,
      -1.000000; 1.000000;-1.000000;,
      -1.000000;-1.000000;-1.000000;,
       1.000000; 1.000000;-1.000000;,
      -1.000000;-1.000000;-1.000000;,
      -1.000000; 1.000000;-1.000000;,
       1.000000; 1.000000; 1.000000;,
       1.000000;-1.000000;-1.000000;,
       1.000000; 1.000000;-1.000000;,
      -1.000000; 1.000000; 1.000000;,
       1.000000; 1.000000;-1.000000;,
      -1.000000; 1.000000;-1.000000;,
      -1.000000; 1.000000; 1.000000;,
      -1.000000;-1.000000; 1.000000;,
       1.000000;-1.000000; 1.000000;,
       1.000000;-1.000000; 1.000000;,
      -1.000000;-1.000000; 1.000000;,
      -1.000000;-1.000000;-1.000000;,
      -1.000000;-1.000000; 1.000000;,
      -1.000000; 1.000000; 1.000000;,
      -1.000000; 1.000000;-1.000000;,
       1.000000; 1.000000;-1.000000;,
       1.000000;-1.000000;-1.000000;,
      -1.000000;-1.000000;-1.000000;,
       1.000000; 1.000000; 1.000000;,
       1.000000;-1.000000; 1.000000;,
       1.000000;-1.000000;-1.000000;,
      -1.000000; 1.000000; 1.000000;,
       1.000000; 1.000000; 1.000000;,
       1.000000; 1.000000;-1.000000;;
      12;
      3;2,1,0;,
      3;5,4,3;,
      3;8,7,6;,
      3;11,10,9;,
      3;14,13,12;,
      3;17,16,15;,
      3;20,19,18;,
      3;23,22,21;,
      3;26,25,24;,
      3;29,28,27;,
      3;32,31,30;,
      3;35,34,33;;
      MeshNormals { // Cube normals
        12;
         0.000000; 0.000000; 1.000000;,
         0.000000;-1.000000; 0.000000;,
        -1.000000; 0.000000; 0.000000;,
         0.000000; 0.000000;-1.000000;,
         1.000000; 0.000000;-0.000000;,
         0.000000; 1.000000;-0.000000;,
         0.000000;-0.000000; 1.000000;,
         0.000000;-1.000000; 0.000000;,
        -1.000000; 0.000000; 0.000000;,
         0.000000; 0.000000;-1.000000;,
         1.000000; 0.000000; 0.000000;,
         0.000000; 1.000000;-0.000000;;
        12;
        3;0,0,0;,
        3;1,1,1;,
        3;2,2,2;,
        3;3,3,3;,
        3;4,4,4;,
        3;5,5,5;,
        3;6,6,6;,
        3;7,7,7;,
        3;8,8,8;,
        3;9,9,9;,
        3;10,10,10;,
        3;11,11,11;;
      } // End of Cube normals
      MeshTextureCoords { // Cube UV coordinates
        36;
         0.875000; 0.500000;,
         0.625000; 0.250000;,
         0.625000; 0.500000;,
         0.625000; 0.250000;,
         0.375000; 0.000000;,
         0.375000; 0.250000;,
         0.625000; 1.000000;,
         0.375000; 0.750000;,
         0.375000; 1.000000;,
         0.375000; 0.500000;,
         0.125000; 0.250000;,
         0.125000; 0.500000;,
         0.625000; 0.500000;,
         0.375000; 0.250000;,
         0.375000; 0.500000;,
         0.625000; 0.750000;,
         0.375000; 0.500000;,
         0.375000; 0.750000;,
         0.875000; 0.500000;,
         0.875000; 0.250000;,
         0.625000; 0.250000;,
         0.625000; 0.250000;,
         0.625000; 0.000000;,
         0.375000; 0.000000;,
         0.625000; 1.000000;,
         0.625000; 0.750000;,
         0.375000; 0.750000;,
         0.375000; 0.500000;,
         0.375000; 0.250000;,
         0.125000; 0.250000;,
         0.625000; 0.500000;,
         0.625000; 0.250000;,
         0.375000; 0.250000;,
         0.625000; 0.750000;,
         0.625000; 0.500000;,
         0.375000; 0.500000;;
      } // End of Cube UV coordinates
      MeshMaterialList { // Cube material list
        1;
        12;
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0;
        PBRMaterial Material {
           0.800000; 0.800000; 0.800000; 1.000000;;
           0.000000;
           0.000000;
          "Opaque";
           0.000000;
          0;
          1;
          "MetallicAlpha";
          "AdditiveNightOnly";
          0;
          0;
          0;
          0;
          AlbedoTextureFileName {"l5_fuselage.dds";}
          MetallicTextureFileName {"l5_fuselage_s.dds";}
          NormalTextureFileName {"l5_fuselage_b.dds";}
          AlbedoTextureUVChannel { 1; }
          MetallicTextureUVChannel { 1; }
          NormalTextureUVChannel { 1; }
          EmissiveTextureUVChannel { 1; }
          DetailTextureUVChannel { 1; }
          NormalTextureScale {
             1.000000;
             1.000000;
          }
          DetailTextureScale {
             1.000000;
             1.000000;
          }
        } // End of PBRMaterial
      } // End of Cube material list
    } // End of Cube mesh
    AnimLinkName { "Cube"; }
  } // End of frm-Cube
} // End of frm-RotateAroundX
} // End of frm-MasterUnitConversion
} // End of frm-Masterscale

Any idea what I'm missing?
 

Pyscen

Resource contributor
Messages
2,993
Country
us-texas
Hello Vitus...

Are you giving the model a friendly name? I see the GUID, but not a name within the code (at least that I have found?)

Out of range error - empty field?
 

Vitus

Resource contributor
Messages
1,480
Country
newzealand
Hi Doug,

Code:
GuidToName {
    "{99d3266c-a531-45a1-1626-88f1d63282ba}";
    "test_cube";
}

"test_cube" is the friendly name. Should there be another entry somewhere with it?
 

Vitus

Resource contributor
Messages
1,480
Country
newzealand
Yes, the export with specular works. I think there's probably something wrong with how the material is setup, but I just can't find the culprit.
 

Pyscen

Resource contributor
Messages
2,993
Country
us-texas
Here is a thought...

Can you take the one didn't work... wondering if you take 1 pbr texture at a time. Are there more than 1 pbr texture used?

Maybe a specific one is causing the error?
 

Vitus

Resource contributor
Messages
1,480
Country
newzealand
The model is already as simple as it comes - just a cube, with one PBR material :)
 

Pyscen

Resource contributor
Messages
2,993
Country
us-texas
The only other thing I can think of is to have @arno look at it...

He knows more about the XtoXML errors than "all" of us I think ;)
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
32,883
Country
netherlands
I like a challenge like this, I'll have a look at the X file :)
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
32,883
Country
netherlands
Hi,

It was quite a tricky one, you MeshMaterialList template was out of date. Before it could only contain Material instances, but now also PBRMaterial. So the template needs to be as below:

Code:
template MeshMaterialList {
 <F6F23F42-7686-11cf-8F52-0040333594A3>
 DWORD nMaterials;
 DWORD nFaceIndexes;
 array DWORD faceIndexes[nFaceIndexes];
 [...]
}
 

Vitus

Resource contributor
Messages
1,480
Country
newzealand
Hi,

It was quite a tricky one, you MeshMaterialList template was out of date. Before it could only contain Material instances, but now also PBRMaterial. So the template needs to be as below:

Code:
template MeshMaterialList {
<F6F23F42-7686-11cf-8F52-0040333594A3>
DWORD nMaterials;
DWORD nFaceIndexes;
array DWORD faceIndexes[nFaceIndexes];
[...]
}

Oh wow Arno, you're a wizard! Thanks a lot for looking into this!

Is there any other oddities you know about in the templates that changed between FSX and P3D/v4?
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
32,883
Country
netherlands
Hi,

If I remember correctly this was the most tricky one. When I added PBR support to MCX I also hit this issue.

I did a diff with the templates that MCX uses and only noticed one of two missing templates in your file. But as long as you don't use these commands it does not matter. So I think you are good now.
 
Top