• 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 optimizing of variants / functions: submodel (merging) / model attachments

Messages
54
Country
switzerland
I'm working on a custom asset, a sailship. It actually comes in two variants, one with hoisted and one with furled sails. The hull, masts and everyting else is the same for both versions. So my idea was, instead of creating two completely different modellLib folders, I'd rather create 3 individual objects for base (hull etc.), hoisted sails and furled sails. Then I put all glTFs in one modellLib folder and create 2 XML descriptions that share the same base.gtlf with either an additional hoisted or furled sails object. Can you follow the idea?
Making it short: all my tests for such a concept failed. Maybe just a stupid thing I missed... Any help is appreciated. Please consider I have multiple LODs for each of the 3 objects (which shouldn't matter in the end).
I know I can parent objects when I import them into a scenery, but that's not my idea of an 'universal' asset.
If you say there will be no gain in performance/ressources by referencing the variants to the same base object, then that'll help, too.;)
EDIT:
It seems that «Submodel Merging» could be the function I am looking for. However, SDK doc declares it as a beta and ─ more important to me ─ says that the Blender plugin currently does no support it (subModel.gltf seem to need a special tag or something like that.)
There's a similar function called «Model Attachments», but unfortunately the same applies: not supported by Blender plugin.
Thus, any help and alternative ideas still appreciated!
 
Last edited:
Hello

I don't know if this will really help, but somewhere in the forums Mr. Milton Shupe designed a beautiful sail ship as well. Perhaps if you dig in you will find something useful there.
I'm asshamed that I cannot provide a direct link... I cannot remember where it is. Perhaps in the Showroom.

All the best,
Sergio Kauffman.
 
Hi Sergio. Thank you for hinting at that. I found the model on simouthouse. Unfortunately it is a FSX model from 2015. Since I don't want any legacy code in my new MSFS models, it won't help me much in this respect. Since the issue is 'only' about package optimisation it's not a real problem. And I'll wait for aglTF-export plugin that supports those promising looking tags. However I found some interesting 'canons' FX in the file. :cool: But that's future work, too.
 
There's a similar function called «Model Attachments», but unfortunately the same applies: not supported by Blender plugin
Hey deHavilland, the official SDK documentation does say it doesn't support the ModelAttachment feature for Blender, but as far as I know it's definitely possible and I have achieved results with it.

You will have to export with the ASOBO_uniqueID GLTF option which is supported in the Blender plugin now. Other than that make sure to follow the rest of the SDK entry on Model Attachments but export with Blender instead of 3ds Max, it's a almost the exact same process.

You'll get a very simple XML entry like this but more complex attachment hierarchies are possible.

XML:
<ModelInfo>
    <LODS>
        <LOD minSize="150" ModelFile="external_lod00.gltf">
            <AttachModel id="cube_Attach"/>
        </LOD>
        <LOD minSize="10" ModelFile="external_lod01.gltf"/>
    </LODS>
    
    <ModelAttachments>
        <ModelAttachment id="cube_Attach">
            <AttachToNode>x0_fuselage</AttachToNode>
            <Model>..\modelAttachments\cube_Attach.xml</Model>
        </ModelAttachment>
    </ModelAttachments>

<!-- Rest of file-->

</ModelInfo>

cube_Attach.xml is just another model <ModelInfo> graph similar to how you would define any model, including it's own animations, LODs etc.

If you have any problems, let me know and I can try and help out!
 
To me it seems too simple to incorporate each sail state as a livery. Your concern about complexity imo, suggests you could be adding draw calls by creating extra nodes.
You can completely replace each model folder, Livery 1 is model.1 with furled sails, Livery 2 is model.2 with fairwind sails and Livery 3 is model.3 with gale rigged sails.

Another trick developers of sail ships in the past have used, was to control the state of sail rigging with the flaps function. This technique also would be relatively easy to incorporate into a project and you could model various degrees of reefed sails, as the intermediate steps of sequential flaps.
 
In the scenery I published a couple of days ago, I used additional "liveries" to have a ship version without wakes (when anchored). That was an easy thing, because I only needed to add a single .xml file ─ stripped of the behaviour node with the the wake FX. Currently I need two complete glTF files for the versions with either furled or hoisted sails. What I'd like to have is a single 'base' ship model (hull, all masts, almost everything abord) to which I'd attach either the furled or the hoisted sails. I definitively need to give FoxtrotScenery's code a try!
 
Last edited:
<AttachToNode>x0_fuselage</AttachToNode>
This must sound like a very naive question: where do I get the node name from? Is it maybe from the 'nodes' section in the gltf file?

EDIT: On a sidenote: Just read that the SU13 SDK shall have 'Blender Plugin added to Core SDK'. Looks like good news? With that at least continuous support seems established.
 
Last edited:
This must sound like a very naive question: where do I get the node name from? Is it maybe from the 'nodes' section in the gltf file?
Correct, the Blender Asobo plugin takes the name of the object to be its unique ID since Blender objects can (in 99.9% of the cases) not be named the same. If there's cases where there are similar names which can happen when you have rigs and bones in different rigs can be named the same, you'll have an option to override the ID

1692000753631.png


So in this case, I have a cube with a custom name below, and when exporting with the ASOBO_unique_id extensions you'll see it appear in the new GLTF tree

1692000566395.png


JSON:
"nodes" : [
        {
            "extensions" : {
                "ASOBO_unique_id" : {
                    "id" : "this_is_my_cube"
                }
            },
            "mesh" : 0,
            "name" : "this_is_my_cube"
        }
    ],
 
Thanks alot, I'm gonna try that now.
When attaching an object to another, there's something I wonder: How is the poly resp. verts count for the max number of verts that are allowed for a certain minSize? With high-poly assets the desired minSize value is often ignored resp. replaced by the max value. So attaching objects could be a 'cheat' for some ugly LOD swaps? 😇
 
To be honest I'm not entirely sure how that works but as far as I know, each Model Attachment has its own set of LODs with it's own set of rules for display. So there's definitely a way to explore that to achieve different results compared to just one regular model and one set of LODs.
 
Thanks again FoxtrotScenery, that attach code worked very well in a test. The 2 versions of the ship, furled or hoisted sails, now use a single 'base' file (hull and masts) and either an attached sail object, furled or hoisted. Now comes the sweat work as I need to reorganize the blender files so that hoisted and furled sails are seperate collections to export ─ for every LOD. Except the lowest one, that obviously can't have attachments to it. Doesn't bother, I look for my last LODs to have only one or two drawcalls.

Yet another question. Apart from the 2 complete ship objects the SDK's object list now also shows the two 'only sails' objects. Is there maybe a way I can hide them when compiling an asset pack?

BTW, I assume I could move/migrate the attached SimObjects into 'static objects' in the modelLib (and so not increase the number of overall SimObjects in the Scenery)?
 
I'm not sure how that happens and I can't reproduce it on my part. Out of curiosity, do you create a new SimObject for the attachment or do you create it within the ship's SimObject by defining a single xml file without any sim.cfg etc.? Could you show a picture of the root of your SimObjects folder maybe, that way I could be maybe help you figure out how to get rid of it.
 
You probably hit the nail. I tried doing it without the dot.folders (keeping those for the various liveries, maybe the 'single xml file' solution you have in mind?), but I always ended with errors.
1692109952241.png


The sim.cfg of the main ('both') folder looks like this:
[fltsim.0]
title=sailship_brig_furled
model=
texture=

[fltsim.1]
title=sailship_brig_hoisted
model=hoisted
texture=hoisted
 
Ah so you have a attachment as an additional simobject indeed. In my example I just include a subfolder in my base simobject called modelAttachments which hosts a various range of attachments inside that folder. Each attachment is just a single gltf with its own xml, nothing else. You'll get a structure like this:

1692118451191.png


With the modelAttachments folder looking like this:
1692118471457.png


You can use the model.[NAME] to define the sims the same way as you did before, but you can keep everything in a single simobject by just using gltfs.

Hope that works for you, it's been a while since I played around with this so let me know if it doesn't
 
Thanks, works great! This is just the sleak, elegant solution I was looking for! And my question about using Sim or Lib objects for the attachments is also answered in a very positive fashion.
I've learned a lot here in the past days ─ which doesn't mean I won't come back to you and this thread. ;)

Just for the record (in case anyone stumbles across this read): LODs configured to have minSize below 5 may not have attachments.
1692196130605.jpeg
 
Last edited:
Hi Guys, I'm personally getting:
1718114603573.png
the GLTFCompiler Failed to load when exporting with Asobo Unique ID
What can this be?
 
Duplicated nodes possibly. Need more info, the yellow error messages will relate. Full Console message, 3d software used might help.
 
Duplicated nodes possibly. Need more info, the yellow error messages will relate. Full Console message, 3d software used might help.
You are correct. Duplicate bone names that share the same unique ID. I need to fix this issue but I'm just wondering how.
 

Attachments

  • Screenshot 2024-06-11 181201.png
    Screenshot 2024-06-11 181201.png
    78 KB · Views: 9
  • Screenshot 2024-06-11 180226.png
    Screenshot 2024-06-11 180226.png
    73.1 KB · Views: 12
So much red...3ds Max has a resolve unique ID's function that only occasionally works for me. The way to do it manually is to select each node, right click to Babylon Properties and rename it.
 
Back
Top