plane icon Welcome to Microsoft Flight Simulator’s SDK Q&A Platform!

You have questions regarding the SDK? DevMode Tools? SimConnect? You would like to submit an idea for future improvements, seek help or exchange knowledge? You’re in the right place.


Please take a moment to read the platform’s guidelines before you get started!


question

virtuali avatar image
virtuali asked FlyingRaccoon commented

"Export Selection as Submodel" creates empty files

I'm trying the new Sub model merging feature, which according to the latest docs enters in Beta, so it's supposed to be ready for testing.

But when I try to use it, enabling the option to export as Sub model ( regardless if it's enabled from the Babylon page, or from the Multi exporter Options ), creates an an empty .GLTF with a 0-length .BIN file.

The object to be exported is a Skinned mesh character, with 5 LODs, each one on its own Layer named LOD0, LOD1, etc., plus an additional Layer named "RIG", with just the animated hierarchy made of 3DS Max Dummy nodes, which would normally be exported in a separate animation .GLTF file.

This works perfectly fine when the model is exported normally, with each LOD calling into the separate animation file through the <AnimationFileList>, which is listed as "Deprecated", with the suggestion to use Sub Model Merging instead.

In all cases ASOBO_animation_retargeting and ASOBO_unique_id are enabled for both the meshes and the skeleton, and exporting the old way doesn't give any errors about duplicated Id's, it all works, animations works, LODs do switch fine, and the character even works as an Attachment to another vehicle ( great new feature, BTW ).

It's just the sub model option I can't manage to use.

While exporting from the Multi Exporter doesn't give any errors, just a very fast export with those empty files, exporting from Babylon page results in the following, depending on what is selected:

1) If only the active LOD Layer (which contains only the skinned mesh ) is visible on screen, pressing Export results in Empty GLTF/BIN files

2 ) If I select the Skinned Mesh before Exporting, it gives the following errors:

"More than one root node for the skin. The skeleton bones need to be part of the same hierarchy. The Skin cannot be exported"

"Export Canceled: Sequence contains no matching element" and then a .NET Exception "Sequence contains no matching element" in System.Linq.Enumerable.First

3) If I select the whole animated hierarchy (which was on the hidden "RIG" layer until now, so I enabled the layer and selected the whole hierarchy and the skinned Mesh at the same time ), it still give the "More than one root node for the skin. The skeleton bones need to be part of the same hierarchy", however the .GTLF/BIN files now seems to be valid.

But isn't this resulting in merging both the Mesh and the animation in a single .GLTF, defeating the purpose of having a separate animation file shared by multiple LODs ?


Also, why the different behavior if the object to be exported is selected or not in Max, considering the "Export only selected" option is Disabled ? Shouldn't that option always export what is visible at any given time ( assuming "export hidden objects is also Disabled, of course ), and not being affected by what is actually selected ?



modeling3dsmax
10 |10000

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

lpierabella avatar image
lpierabella answered virtuali edited

Hi @virtuali to make the "Export as submodel" feature work you need to select the object that will be part of the submodel

Each submodel is a gltf scene.

In case you are selecting a layer, this does not work, same with the preset system in multi-exporter as it clears your selection.

Try with the BabylonExporter and select an object, if this still does not work...send us a screenshot of your Babylon exporter settings.

Specify a submodel is indeed not perfect from a user point of view currently, we will work on an improvement in the future versions.

1 comment
10 |10000

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

Hi, lpierabella, the empty files happened only in case #1, when I didn't selected anything, because I assumed this worked in the same way as normal: what you see on screen is what is exported, unless the "export hidden objects" option is enabled.

The issue is, with case #2, in which I selected only the skinned mesh but not the skeleton, I got the "Export Canceled: Sequence contains no matching element" and then a .NET Exception "Sequence contains no matching element" in System.Linq.Enumerable.First and on case #3, when I selected both the skinned mesh and the Skeleton, I got the "More than one root node for the skin. The skeleton bones need to be part of the same hierarchy" error, but in this case at least it generated the .BIN/.GLTF files.

That' was the meaning of my question: since the only way I could produce a non-empty file was to select both the Mesh and the Skeleton, isn't this defeating the purpose of using merging in the first place, because I'm attaching a skeleton with all its key frames to each LOD meshes ?.

I have 6-7 skinned mesh for each LOD, all supposed to share the same skeleton, and this works perfectly fine with the Animationfilelist method, but since you are listing this as Deprecated and not the most efficient, I wanted to try the model merging instead.

Could be the issue is the skeleton is made of actual 3ds Max Bones, instead of Dummies, maybe Bones are not recognized by the exporter in this context, even if they usually work in other cases ?

0 Likes 0 ·
lpierabella avatar image
lpierabella answered FlyingRaccoon commented

Hi @virtuali indeed the error is not easy to understand I added a new error message that will be available next release

Here are some explanations.

  1. make sure that you do not have more than one root in the skinned bones list, otherwise, you'll get "More than one root node for the skin. The skeleton bones need to be part of the same hierarchy". This rule works for submodel and non-submodel export
  2. Exporting a mash as a submodel to eventually merge, you need to make sure there is at least a common ancestor between the submodel mesh and his skin bones(in case there is a skin)

here a more practical scenario that cannot work and is similar to your use case

1650630630072.png

I improved the error message, it will now say

1650630879639.png

and this how-to-fix it

1650630685945.png

or

1650630809053.png




1650630630072.png (64.0 KiB)
1650630685945.png (10.6 KiB)
1650630809053.png (70.0 KiB)
1650630879639.png (6.1 KiB)
1 comment
10 |10000

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

@Nocturne To be added to the documentation
1 Like 1 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 5 attachments (including images) can be used with a maximum of 19.1 MiB each and 23.8 MiB total.