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

MSFS glTF support for ModelConverterX

Status
Not open for further replies.

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
32,883
Country
netherlands
I am happy to announce that from today the development release of ModelConverterX supports the glTF format as used by the new MSFS. With this addition I have also changed the version number of the development release to 1.5.

You can now read glTF files and the MSFS BGL files that contain the object models into ModelConverterX. When reading the BGL files that have been generated by the package tool of MSFS ModelConverterX will show the texture mapping incorrectly, that’s because MSFS stores the texture coordinates in a non-standard way. I hope to figure that out later.

You can also export models in the glTF format, so that you can include them in your scenery package. At the moment the exporting is limited to static objects, so you can export the geometry, material settings, levels of details and lights. Other features like animations, mouse rectangles or visibility conditions are planned to be added later.

In the material editor you can select MSFS now as a filter as well. That will only show the material settings relevant for MSFS. I have mapped the material attributes on the already available ones where possible, to each conversion from older formats to MSFS. But this also means that the names are sometimes slightly different from what the MSFS SDK uses. I plan to update the help texts to clarify this more. For some of the more exotic material types in MSFS not all attributes are implemented. Those will be added later.

At the moment I am not sure if ModelConverterX should call the package tool for MSFS directly, as the package tool typically makes all BGL files of the package, while ModelConverterX is now designed to only make a single BGL file. So for the moment I think it is better to export a glTF file and then create the package from inside MSFS. But if there are suggestions on an easier workflow, let me know.

As can be seen from all the details above, the glTF support is not yet finished. And I’ll continue to add more features. So please let me know if you encounter any issues while using it.

Continue reading...
 

Lagaffe

Resource contributor
Messages
865
Country
france
Thanks very much Arno. I Iwill test this version this morning and I come back
 
Messages
244
Country
england
Thank you Arno. Your continued support and development is very much appreciated.
 

Lagaffe

Resource contributor
Messages
865
Country
france
I just did some quick tests and here's what I noticed:
- the LOD 01 of the C152 Aerobat: it's longer than usual and some textures have difficulties to be found by MCX.
- a BGL from Sedona: same remark. I think that the textures are no longer located at the same level as the scenery repertoire but below as asobo-airport-ksez-sedona\scenery\sedona\texture, MCX has trouble locating them.

But it seems that it is a problem that you have yet noticed :cool:
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
32,883
Country
netherlands
I'm aware of texture mapping being wrong, but I didn't notice textures that could not be found. I'll check with the models you mention.
 
Messages
478
I opened a GLTF that I had previously exported with 3ds max, edited material options to add transparency, and on export got this error:

Error:
Can not add Newtonsoft.Json.Linq.JValue to Newtonsoft.Json.Linq.JObject.
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
32,883
Country
netherlands
Do you know which material attribute you changed? Looks like there must be one I didn't touch in my tests.
 
Messages
478
Hi Arno,

Simply opening the file and exporting it, even without making changes makes the error on export. If you wish I can send the file.

Many thanks
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
32,883
Country
netherlands
I just remember that the SDK has a sample with various material settings, I'll try to import and export that one first.
 
Messages
478
Excellent Arno. I imported a regular fsx mdl and exported fine as gltf, so yeah, it's probably something in those naughty new materials :)
 

arno

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

It was a bug when writing the material draw order attribute. I have it fixed now. There are some other small issues that were reported that I want to check, but somewhere tonight I'll push a new build probably.
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
32,883
Country
netherlands
I just did some quick tests and here's what I noticed:
- the LOD 01 of the C152 Aerobat: it's longer than usual and some textures have difficulties to be found by MCX.
- a BGL from Sedona: same remark. I think that the textures are no longer located at the same level as the scenery repertoire but below as asobo-airport-ksez-sedona\scenery\sedona\texture, MCX has trouble locating them.

But it seems that it is a problem that you have yet noticed :cool:

I had a look, but I think the difference is that the texture.cfg file is located in a different location then before and that's probably way MCX does not find the fallback folders.
 

Lagaffe

Resource contributor
Messages
865
Country
france
Indeed, this could be the reason.
As there are no rules established in the SDK and in the addons that we see appearing, people do as they want, applying non rules, it may not be easy to solve.
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
32,883
Country
netherlands
I think the biggest problem is that the paths in the texture.cfg are intended for the sandbox in the sim when all packages are combined.
 
Messages
478
Fantastic Arno, excellent.

One thing I have not figured out, I loaded an old model, exported into new format and saved textures as PNG, copied the texture in to the PackageSources\modelLib\texture folder, but when running the package XML through the packagetool, the model was exported, but the textures was not, so the model appears in MSFS all white. Any ideas how to get the textures to convert too if I save them as PNG and copy to the correct modelib\texture folder?
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
32,883
Country
netherlands
Did you convert to png before exporting to glTF? Else the model will reference the wrong filenames.
 
Messages
478
Did you convert to png before exporting to glTF? Else the model will reference the wrong filenames.

Yep, both diffuse and emissive textures are named .png in the material editor. When I open the output glTF in a hex editor I see that the texture is named without an extention, whilst a file opened in the hex editor that was exported through babylon the same texture is listed with it's .png extention
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
32,883
Country
netherlands
glTF files are just ASCII, so you don't need a hex editor to view them. Where do you see the textures without extension? I checked a file I exported with MCX but in the images section all files are listed correctly.
 
Messages
478
glTF files are just ASCII, so you don't need a hex editor to view them. Where do you see the textures without extension? I checked a file I exported with MCX but in the images section all files are listed correctly.

Lol, didn't know they are ASCII, stupid me.

Anywhere, the textures are listed starting in:

"textures": [
{
"source": 0,
"name": "apttxt1"
},

And in the glTF exported by babylon it's:

"textures":[{"sampler":0,"source":0,"name":"apttxt1.png"},
 

arno

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

I don't think that matters. The name attribute is just a name, the source is the index of the image that is used as texture. In the images an uri with the texture file is specified.
 
Status
Not open for further replies.
Top