• 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 model orientation

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
34,347
Country
netherlands
Hi all,

This evening I found out that the glTF model and the CFG points were not aligned correctly in MCX. They were rotated 180 degrees relative to each other. I have fixed this by rotating the model 180 degrees on import. This also means that the existing option to rotate a glTF model on export by 180 degrees now has a default value of true, to make sure that an import-export sequence results in a consistent model.

For both the import and export there is an option with which you can control this behavior. So if you have specific situations where it should not happen you can disable it. But I think in general this behavior should not give issues.

You might wonder why I did not just rotate the CFG points 180 degrees, instead of the model. But I feel that rotating the model gives more consistent results. Especially when converting between different sims like FSX, P3D and MSFS. Now the nose of the aircraft will point in the +Y direction for all sims again.

Let me know if my reasoning is not correct and gives you as a developer problems.
 
Let me know if my reasoning is not correct and gives you as a developer problems.
Correct? "Spot on," maybe? After this reorientation, my FSDS animations import perfectly. Before this, I'd had to flip my animations two, or three times, through immense 90 degree arcs of virtual space.

mcx import.JPG


The image shows an exported radar, that has been animated in FSDS and then superimposed over a static version of itself in MCX. Besides learning how to animate using MCX, this is the only path that I have found, for Sketchup modellers to bring animations into MSFS.

Thank you.
 
I guess I spoke too soon. Now, if it is not too much trouble, could you make FSDS animations export perfectly? Apparently, all that happened from the orientation change, is that imported objects appear to have correct orientation, but obviously, they do not maintain that:

rotation.JPG


You can see that the animated flag has been rotated 90 degrees in the red axis and also 180 degrees in the blue axis.
 
Hi Rick,

Which format did you export to in this case, was it glTF?
 
Yes, also the animation was frozen upon final export.
 
Hi,

Does your model have many animations? Only a few simple animations can be exported to glTF. If there are more the animations are stripped on export.

I'll see if I can find a model to test your animation flipping with.
 
The animations are a rotating radar and an oscillating flag. They could not be simpler, or fewer and still be more than one. Later today I will build and upload a model that includes a reoriented animation.
 
Ok, the demo is ready. The animation came through, the difference being the other model was fairly complex, maybe 40k polys. Besides being reoriented, the normals appear to be flipped, or something.


transform.JPG
 

Attachments

Thanks, I have it to my todo list and will take a look. I assume the animation was fine when you exported it from MCX to glTF?
 
Yes all parts are present and the animation was oriented properly, until glTF export.

I build the model and export fixed and moving parts as Collada, with MCX I re export the part to be animated as .fsc, perform the animation and then save that part with an "r" added to the name, to visually distinguish it. If you import MCX demo propR.fsc into MCX, you can see that the normals are oriented properly and this remains the case after merging. It is only after glTF export, that the model displaces and I think it is extremely fortuitous that I added a spinner, lest we missed the reversed normals.

I believe MCX arbitrarily sets PBR Alpha mode to Blend. When I import a Collada model, some of the materials are already set to blend, even though it is the first import. Am I correct in this and if so, is there a aspect, or attribute, that establishes PBR Alpha mode, before I do?

Finally, you messaged that only a few simple animations will export to glTF. This is not the case with MCX export to .mdl. MCX is still limited, but it can export an average working airplane model, with no issue. Are you able to inform if this is also the case with the full .mdl to glTF conversion capability - and also, if you expect to establish increased robustness with the MCX export to glTF, that does not convert from .mdl?

Because it would be good to know, whether it is possible to use MCX to convert animated models for use in MSFS, or if Sketchup users in particular, need to establish an entirely new pipeline. One of my explorations, as an example, is developing my own .mdl>glTF converter. Between decompiling to .x file, Visual Studio and GitHub, it seems like it is mostly a matter of putting one's mind to it. I am guessing there must be a software version of Freelancer, where I could just submit a request, offer a reward and wait for my app.
 
Hi,

If MCX detects an alpha channel in a texture when a COLLADA file is imported the alpha mode is automatically set to blend. This is similar with the source and destination blend that are automatically set for FSX.

For the animation export, it is only restricted when you import from mdl file. If you import from COLLADA or similar formats there is no restriction. Also when you create the animation in MCX there is no restriction.

There is a version of MCX without this restriction as well, which I have provided to some developers who want to convert their own work. It exports all animations. I'm still thinking if there is a good way to make this wider available, without helping pirates too much.
 
I imported two animations from FSDS format and they did not compile. The model however, was somewhat complex, at 40k polygons, it was in Collada format. This is prohibitively restrictive for even scenery creation, it means a given model can support only one animation. This is despite the alignment issue, which presumably is addressable.

Also I do not know how to use the inbuilt animator, if you had an example, or instructional, I might be able to figure it out.
 
Hi,

Amount of polygons has no influence on the ability to export animations. You can export up to 5 ambient type animations to glTF. More animations or different types of animations are not exported.

I need to check if I made a blog post or video about making an animation. Else it might be a good topic to add to the manual.
 
Ok great, I tried to export a pair of simple animations and that part worked, this time. Still hoping for accurate orientation after export, thanks.
 
Hello,

I encounter this rotation problem yesterday and just saw this thread now.
My problem is the following: I have a model that is based on 4 LODs. When I import a specific LOD by importing its glTF, it appears right in MCX, but when I import the 4 LODs at the same time by importing the XML file, only the first LOD appears in the correct direction. The 3 other LODs appear with 180 degress of rotation.
This is not a big problem if I do not export the 4 LODs at the same time, in which case, the model won't appear correctly in MSFS: the model will rotate when aproching it.
So if I want to modifiy these glTF, I have to modifify each LOD one at a time and not the 4 LODs at the same time.
Is this a bug in MCX or have I missed something?
Thank you.

By the way, the more I use MCX, the more I discover features. This toolkit is really incredible, thank you Arno!
 
It must be a bug that not all lods are rotated. Let me have a look at it.
 
Hi,

Thanks for reporting, that was a bug indeed. I have fixed it now, so in the next development release it will be OK.
 
Back
Top