Scenery creators: please move or rename your modelLib.BGL

ModelLibChanger simply changes all ModelLib.bgl name and then scans the files in each folder in Community and rewrites the layout.json - for every folder.

1 Like

Are you sure that’s all it does? It lists a bunch of add ons and mentions the renaming the ModelLib.bgl, but just as many add ons are listed, without a mention of the modelLib, but does mention the file count in the json and offers to correct that?

I was able to figure out how to choose which add ons to fix by simply selecting them. So I left them all alone unless it mentioned the modelLib name.

All seems well, nothing bad has happened! I few out of one airport it renamed the modelLib for and it seemed unharmed.

Yeah I didn’t like that it rewrote the layout.json, as a developer, so I preferred not to use it…

Although it DID find something that I missed, so :man_shrugging:

It probably won’t harm it, but sometimes there are files present that the developer doesn’t want the sim to know are there…

Yeah, I didn’t want to change anything other than what I was trying to fix! But seems no harm was done by renaming all the modelLibs it pointed out.

This issue came out several months ago, when some users reported conflicts between sceneries and/or missing objects, so we asked Asobo about this, and they confirmed which cases can be considered conflicts and which aren’t so:


CASE 1

Scenery A installed in Community\SceneryA with a modelLib-SceneryA.BGL located in the following folder inside its package: scenery\MyCompany-SceneryA\modelLib-SceneryA.BGL

Scenery B installed in Community\SceneryB with a modelLib-SceneryB.BGL located in the following folder inside its package: scenery\MyCompany-SceneryB\modelLib-SceneryB.BGL

THIS IS THE BEST SOLUTION, because by giving both the pathname and the filename unique names, it’s very unlikely we’ll end up with a name clash.


CASE 2

Scenery A installed in Community\SceneryA with a modelLib-SceneryA.BGL located in the following folder inside its package: scenery\global\modelLib-SceneryA.BGL

Scenery B installed in Community\SceneryB with a modelLib-SceneryB.BGL located in the following folder inside its package: scenery\global\modelLib-SceneryB.BGL

This is NOT a conflict, although some care should be taken on the filename, to be sure it’s not used by something else.


CASE 3

Scenery A installed in Community\SceneryA with a modelLib.BGL located in the following folder inside its package: scenery\MyCompany-SceneryA\modelLib.BGL

Scenery B installed in Community\SceneryB with a modelLib.BGL located in the following folder inside its package: scenery\MyCompany-SceneryB\modelLib.BGL

This is NOT a conflict, since the pathname is different so, even if the filename is the same, it doesn’t matter.


CASE 4

Scenery A installed in Community\SceneryA with a modelLib.BGL located in the following folder inside its package: scenery\global\modelLib.BGL

Scenery B installed in Community\SceneryB with a modelLib.BGL located in the following folder inside its package: scenery\global\modelLib.BGL

THIS IS A CONFLICT, because both the pathname and the filename are identical so, depending on the scenery loading order, objects from either A or B might show, so it better be fixed.

How to fix conflicts depends if you are users of the scenery, or developers:

USERS

Rename the modelLib.BGL file inside the package AND update the layout.json file with the new name, or use utilities to do that.

DEVELOPERS

Edit the <OutputDir> path in the .XML file in the Package Definitions folder of your project, and replace the path, for example changing it from Scenery\Global\Scenery\ to Scenery\MyCompany-MyScenery, and rebuild the project.

This will only affect the pathname ( which is enough to prevent conflicts ), because the filename of the resulting .BGL is controlled by the name of the folder in the PackageSources which contains the source .GLTF/.XML files for the models so, if you also want an unique filename, you must also rename the PackageSources\modelLib folder in your project AND edit the path in the <AssetDir> tag to match the new folder name.

GUID Conflicts - Developers

Even if your pathname and filename are unique, there’s still a chance for a conflict, which might be caused by GUIDs reused by you or other developers. Every 3D object in the sim must have an unique GUID, a common error is to copy the .XML file of the SDK sample and changing the name of the .GLTF without generating a new GUID for it.

One of the easiest way to generate GUIDs is using this free app on the Windows Store:

Be sure the .XML file located in the same folder of the .GLTF file has a unique GUID and, if you changed it, be sure you also changed it in the airport .XML source file to match, the Rebuild the project.

8 Likes

There still are a lot of airport designers using modelLib.BGL.
For those of you who have MSFS Addons Linker, there is an automatic filename updater that takes care of this.

2 Likes

Correct. The community folder names don’t matter at all. What is within the Scenery or SimObject folders all must be unique (and then correctly referenced in the layout.json)

2 Likes

So with Sim Update 5.

If you export your scenery and rename the modellib.BGL none of your model assets will load in.

You may want to test this on your end if this same result happens. If this happens, change it back to ‘modellib.’