Object library creation using Library Creator XML

From FSDeveloper Wiki
Jump to: navigation, search

How to create an object library

A library is a bgl file which contains one or more mdl (model) files. During placement of a model a reference is made to the model in that library file. Presume you created a windmill and put it in a library. Then you can place this model several times in several areas just by referencing that model.

Use Library Creator XML

It is possible to create a library bgl by hand, but there are several simple tools which can do that. One of these is "Library Creator XML".

  • Download the latest "Library Creator XML" from http://www.fsdeveloper.com > Downloads > Scenery Design > Tools
  • Install Library Creator XML
  • Configure it:
    • When using FSX: Select Options > FSX BGLComp path
    • Browse to the location of BglComp.exe for FSX which can be found in the SDK. In a default installation this will be "C:\Program Files\Microsoft Games\Microsoft Flight Simulator X SDK\SDK\Environment Kit\BGL Compiler SDK".
    • When using FS2004: Select Options > FS2004 BGLComp path
    • Browse to the location of BglComp.exe for FS2004 which can be found in the SDK.
    • Select Options and check Relative paths (this is optional, but advised when working in a team and you want to easily share sources with others).

Create the library

Create a library as follows by making a xml file which will be compiled to a bgl file:

  • Select File > New library...
  • Browse to a location where you want to store the xml file
  • Fill in a file name. In my example I called it my_sample_library.xml
  • Click on Save
  • Select the button "Add MDL objects" in the lower left corner and browse to the location of the mdl files. Notice in the white area that your mdl file has been added. Click the plus sign to see the GUID.
  • Click on Save so that you can later open the XML source file again to add more objects to it.


Compile the library

  • Select "File > Compile library BGL..."
  • Select a location where to store the bgl
  • Fill in the file name
  • Click on Save to start the compilation
  • The following content will be shown if the compilation is succesfull:

LibraryCreatorXML compilation log.jpg