• 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.

MSFS20 glTF support for ModelConverterX

Status
Not open for further replies.
MCX wrote it. I looked at the xml file, but I couldn't see the error. Here is the file for the VORDME Object:
XML:
<?xml version="1.0" encoding="utf-8"?>
<ModelInfo guid="{047814f7-e832-45fc-b5a0-4f047f8234b0}" version="1.1">
  <LODS>
    <LOD minSize="7.8125"/>
    <LOD minSize="3.90625"/>
    <LOD minSize="0.78125"/>
  </LODS>
</ModelInfo>

I imported the FSX airportobjects.bgl in MCX, then I changed the VORDME object's textures to PNG. Lastly, I exported the VORDME object as glTF and tried to compile the project with the package tool. There's a syntax error somewhere in the package structure, but I don't know where else to look.
 
I'll ty to reproduce that workflow tonight, maybe it's something in the glTF file then.
 
Hi Arno
Thank you very much for this work for the community. Excellent !

Just a thing I noticed : The effects orientation seem to work wrong. from blender to MCX, but also from MCX to MSFS2020.
For example, I set the orientation of spots in blender, and export the object. When I import it in MCX, the orientation is not the same.
If I correct it in MCX, even it seem to be correct, it is not in MSFS2020.

May be it's a known problem which will be corrected in a next version, maybe it's me. But I wanted to tell you :)

Thank you, Arno
 
Hi,

You mean the orientation of spot lights? I tested them by setting them in MCX and then exporting to MSFS, that resulted in the right orientation for me. I haven't tried with Blender yet.
 
Yes, it's the spot lights.
Strange, I made the same test (Replace those of blender by new ones) but with wrong result !

If it work for you, I'll try again
 
If you have a small sample of a Blender model I can check what is going on. Maybe just a simple box with a spot light on it.
 
I create a little file for test and it work in MSFS.
I think I've another problem on my existing object ... I'll look better.
Thank for your help :)
 
XML:
<?xml version="1.0" encoding="utf-8"?>
<ModelInfo guid="{047814f7-e832-45fc-b5a0-4f047f8234b0}" version="1.1">
  <LODS>
    <LOD minSize="7.8125"/>
    <LOD minSize="3.90625"/>
    <LOD minSize="0.78125"/>
  </LODS>
</ModelInfo>

Try

<?xml version="1.0" encoding="utf-8"?>
<ModelInfo version="1.1" guid="{047814f7-e832-45fc-b5a0-4f047f8234b0}">
<LODS>
<LOD minSize="7.8125" ModelFile="filename.gltf"></LOD>
<LOD minSize="3.90625" ModelFile="filename.gltf"></LOD>
<LOD minSize="0.78125" ModelFile="filename.gltf"></LOD>
</LODS>
</ModelInfo>

Also, I think you'll need to rotate the object 180 degrees (heading).
 
Try

<?xml version="1.0" encoding="utf-8"?>
<ModelInfo version="1.1" guid="{047814f7-e832-45fc-b5a0-4f047f8234b0}">
<LODS>
<LOD minSize="7.8125" ModelFile="filename.gltf"></LOD>
<LOD minSize="3.90625" ModelFile="filename.gltf"></LOD>
<LOD minSize="0.78125" ModelFile="filename.gltf"></LOD>
</LODS>
</ModelInfo>

Also, I think you'll need to rotate the object 180 degrees (heading).
Thanks. That was my thought also that because the filenames are stored in the glTF files, that somehow there's a mismatch. I'll try to start from scratch in MCX and report back.
 
That worked.:) It also occurred to me that I should probably change the GUID in MCX, just in case that Asobo reused the FSX stock models for backwards compatibility, even though they aren't visible to the casual observer.
 
In that case MCX probably writes the lod information wrong. Although I thought I did a best where it worked without the glTF names specified, just as the light sample does.
 
Hi,

If you look at the light_sample object in the SimpleScenery example from the SDK there is no reference to a glTF filename in the XML. In that case it seems the package tool just takes the glTF files it finds in the same folder (in alphabetic order I guess). I used this as basis for the XML code MCX makes. But maybe it's safer to add the glTF names anyway, if that's allowed.

Code:
<?xml version="1.0" encoding="utf-8"?>
<ModelInfo guid="{8396d176-1549-4772-a6e0-a54e5a0ee216}" version="1.1">
   <LODS>
      <LOD minSize="50.0"/>
      <LOD minSize="5.0"/>
      <LOD minSize="1.0"/>
   </LODS>
</ModelInfo>
 
Yes, SketchUp uses those relative paths indeed. When you go to FSX mdl they are typically removed. As the textures are normally stored in the texture folder of the scenery.

So maybe the glTF exporter should also strip them. That would be more consistent.

I have modified the glTF exporter now. Just like the X file exporter is uses the OnlyWriteTextureName setting now to determine if only the name or the (relative) path is written. The default value of that setting is to write only the texture name.
 
I converted the FSX stock VORDME model to glTF as a test. Everything converted fine, but when I tried to add the object to the SDK sample scenery project, the fspackagebulder compile failed. The sample MSFS SDK project works okay and the converted glTF LOD models display okay in MCX when imported.

Code:
project XML: H:\temp\MSFS Projects\VORDME\vor.xml
temp dir:    H:\temp\MSFS Projects\VORDME
output dir:  H:\temp\MSFS Projects\VORDME
PackageBuilder | Reading H:\temp\MSFS Projects\VORDME\vor.xml...
PackageBuilder | Preparing asset groups...
PackageBuilder | Done, 4 asset groups registered.
PackageBuilder | Generating commands for package mycompany-scene...
PackageBuilder | Preparing commands for asset group ContentInfo...
PackageBuilder | Preparing commands for asset group myscene...
PackageBuilder | Preparing commands for asset group mymodellib...
PackageBuilder | Ready, 22 commands added.
PackageBuilder | Starting the build...
PackageBuilder | Build package mycompany-scene ...
PackageBuilder | Building assets for the package mycompany-scene...
Copying files from source folder H:\temp\MSFS Projects\VORDME\PackageDefinitions\mycompany-scene\ContentInfo\...
Compiling texture file TEXTURE\AIRPORT_LIGHTS_ALBEDO.PNG...
[CONVERTING BITMAP] 5368464766973096227
[BITMAP CONVERTED] 2D BM_BC1_UNORM 1024x1024 5368464766973096227
Compiling texture file TEXTURE\TILE_METAL_GALVA_NORMAL.PNG...
[CONVERTING BITMAP] 11375669364535109371
[BITMAP CONVERTED] 2D BM_BC5_SNORM 256x256 11375669364535109371
Compiling texture file TEXTURE\AIRPORT_LIGHTS_EMISSIVE.PNG...
[CONVERTING BITMAP] 6545490487753505127
[BITMAP CONVERTED] 2D BM_BC1_UNORM 1024x1024 6545490487753505127
Compiling texture file TEXTURE\TILE_METAL_GALVA_COMP.PNG...
[CONVERTING BITMAP] 10200974590482960772
[BITMAP CONVERTED] 2D BM_BC7_UNORM(RGB) 256x256 10200974590482960772
Compiling texture file TEXTURE\TILE_METAL_GALVA_ALBEDO.PNG...
[CONVERTING BITMAP] 3643935697884563336
[BITMAP CONVERTED] 2D BM_BC3_UNORM 256x256 3643935697884563336
Compiling texture file TEXTURE\AIRPORT_LIGHTS_COMP.PNG...
[CONVERTING BITMAP] 14188722817935453021
[BITMAP CONVERTED] 2D BM_BC7_UNORM(RGB) 1024x1024 14188722817935453021
Compiling texture file TEXTURE\AIRPORT_LIGHTS_NORMAL.PNG...
[CONVERTING BITMAP] 16559521918912254032
[BITMAP CONVERTED] 2D BM_BC5_SNORM 1024x1024 16559521918912254032
Compiling GLTF data file Light_Sample_LOD0.gltf...
Compiling GLTF data file Light_Sample_LOD1.gltf...
Compiling GLTF data file Light_Sample_LOD2.gltf...
Compiling texture file TEXTURE\TEST_CHECKER.PNG...
[CONVERTING BITMAP] 5740014942494066078
[BITMAP CONVERTED] 2D BM_BC1_UNORM 16x16 5740014942494066078
Compiling GLTF data file SampleMyBox.gltf...
Compiling texture file TEXTURE\VOR01_LM.PNG...
[CONVERTING BITMAP] 10128950812938616435
[BITMAP CONVERTED] 2D BM_BC3_UNORM 512x512 10128950812938616435
Compiling texture file TEXTURE\VOR01.PNG...
[CONVERTING BITMAP] 5476800467439223448
[BITMAP CONVERTED] 2D BM_BC3_UNORM 512x512 5476800467439223448
Compiling GLTF data file sco_gen_vorsmalldme_LOD000.gltf...
Compiling GLTF data file sco_gen_vorsmalldme_LOD001.gltf...
Compiling GLTF data file sco_gen_vorsmalldme_LOD002.gltf...
Copying files from source folder H:\temp\MSFS Projects\VORDME\PackageSources\modelLib\...
Compiling BGL file from in-memory data to output file modelLib.BGL...
INTERNAL COMPILER ERROR:  #C2006: Parse failed  (0x80004005)
INTERNAL COMPILER ERROR:  #C2340: Failed to finalize MODEL_DATA!
INTERNAL COMPILER ERROR:  #C2032: XML Parse Error!  Element tree follows:
ERROR: <FSData
ERROR:  version = 9.0
ERROR: >
ERROR:  <GLTFData
ERROR:          sourceFile = H:\temp\MSFS Projects\VORDME\_PackageInt\_tempFiles\mycompany-scene\mymodellib\VORsample\sco_gen_vorsmalldme.xml
ERROR:  >
ERROR:
INTERNAL COMPILER ERROR:  #C2024: Failed to process closing element tag <GLTFData> near line 4!
INTERNAL COMPILER ERROR:  #C2607: Compilation errors detected, compilation failed!
INTERNAL COMPILER ERROR:  #C2006: Parse failed  (0x       0)
PackageBuilder | Output path does not exist: H:\temp\MSFS Projects\VORDME\Packages\mycompany-scene\scenery\global\scenery\modelLib.BGL
Compiling BGL from file objects.xml...
PackageBuilder | Skip mirroring due to command failures.
PackageBuilder | Skip generation of package information due to command failures.
PackageBuilder | Finished, 1 skipped, 20 done and 1 failed, took 1s531ms.
Press any key to continue . . .
I have the same line where it says:
PackageBuilder | Output path does not exist: C:\Users\RD&T-Home\Documents\MyFSProjects\YBCG\Packages\testing\scenery\modelLib.BGL
When i check the directory the file doesn't exist, how do i add it?
 
Hi,

Did some more testing here, apparantly it depends on how you name your models if they are picked up by the packager or not. The light sample uses LOD0, LOD1, LOD2 and that works. I used LOD000, LOD001, etc and that doesn't work.

To be safe I'll just let MCX add the glTF filename explicitly in the model XML file. It will be in the next development release.
 
I have found DX10 and BC5S now. But I'll see if I can find a library to help me read, instead of coding them all manually.

Edit: might have found a suitable library already, this looks much better (although the normal map has slightly different colours from the image posted before).

View attachment 61749View attachment 61752

I have finished this integration as well, so from the next development release the MSFS textures should be read OK as well. As this library I use now was made for a newer .NET framework version I had to build MCX against that version as well. So from the next development release you need .NET 4.7.2 for MCX.
 
I imported the FSX airportobjects.bgl in MCX, then I changed the VORDME object's textures to PNG. Lastly, I exported the VORDME object as glTF and tried to compile the project with the package tool. There's a syntax error somewhere in the package structure, but I don't know where else to look.

You can also just use FSX mdl files in MSFS, and avoid converting anything to glTF:
https://www.fsdeveloper.com/forum/threads/fsx-objects-in-msfs.448976/
 
Previously, if there was an update, MCX link to the download page for developtmenr releases, now it goes to the main page of the site. Is that how the new version is intended?
 
No, that's some kind of issue with https redirect on the site I can't fully understand or fix.
 
My latest version crashes with an Net Framework system out of memory error. I check on ORBX LOWI modelLib.BGL. There are three scenes. The first one loads without errors, the second (simple) with errors, the third (terminal) already loses textures and displays a bunch of errors about the failed to load textures. This was not the case in the previous release.
 
Status
Not open for further replies.
Back
Top