How to export animated objects from Blender for MSFS
This article explains how to create 3D objects in Blender that rotate, scale, or perform other animations, and import them into Microsoft Flight Simulator (MSFS) scenery. To do this, we will use glTF-Blender-IO-MSFS , a plugin that allows Blender to export 3D data for MSFS. In the game, you can rotate radar antennas, lighthouse lights, windmills, and more, and use scaling to make lights (light-emitting objects) blink.
このページを日本語で見る
Contents
Installing the Blender plugin glTF-Blender-IO-MSFS
To create add-on content for Microsoft Flight Simulator, you will need to install various tools onto your computer, including the Blender plugin glTF-Blender-IO-MSFS. Please refer to the page below.Creating animated 3D objects with Blender
First, we will explain how to create a 3D object with a simple animation (action).First, decide the number of frames for your animation. Click on the area indicated by the arrow in the image and enter the number of frames.
Here we'll define a 180 frame animation. Blender's animation playback speed is about 22.5 fps, so specifying 180 frames will result in a roughly 8 second animation.
First, in the top right of the screen, click to select the part you want to animate, "Cone." Next, drag the blue square left and right on the timeline at the bottom left of the screen to select 1 (frame). Finally, click the (Object) icon at the bottom right of the screen and open the "Transform" column. Then enter "0°" in the "Rotation" Z axis column, which will be the angle for the first frame, and click the "・" mark on the right side of it.
The generated node name "ConeAction" can be changed by clicking on it.
Additionally, an orange dot will appear on the first frame of the timeline at the bottom left of the screen, indicating that a keyframe has been set. The color of the Z-axis field under "Transform" - "Rotation" at the bottom right of the screen will turn yellowish, and the "・" mark on the right will change to a "◆" mark.
Now try clicking the [▶] button at the bottom centre of the screen. The cone parts should rotate 360 degrees approximately once every 8 seconds. You can also see the cone parts rotating by dragging the blue square left and right on the timeline at the bottom left of the screen.
Setting Blender animation for MSFS
From here onwards, we will be configuring for MSFS. The task is to "add the generated actions to the NLA (NonLinear Animation) stack." However, you don't need to understand what this means (lol)[Technical explanation]
Converts individual actions into new NLA strips (tracks) that are placed on top of the NLA stack. You can then use the NLA Editor to edit multiple animations at the same time. The NLA stack allows you to assign and manage multiple actions to a single object.
Your animated object is now ready, export it using the plugin glTF-Blender-IO-MSFS .
Output animation objects to glTF format files for MSFS
Use the plugin glTF-Blender-IO-MSFS to output the animation object you created to a glTF format file for MSFS. For information on how to use glTF-Blender-IO-MSFS, see the page How to use glTF-Blender-IO-MSFS to export and import 3D data between Blender and MSFS .
How to use glTF-Blender-IO-MSFS to export and import 3D data between Blender and MSFS
In the "Object" tab, specify the objects to export. Select the collection you want to export from the collection list in the upper right of the screen. Next, click the "Reload LODs" button. Then, each mesh data in the scene will be recognized and displayed in a list. Check "Grouped by collections".
Check "Genete XML" when exporting for the first time. Uncheck "Genete XML" if you are exporting for the second or subsequent time to correct the model.
In the "Export Path" field, specify the destination folder for the .glTF file.
In the field below that, select the name of the collection to export (here, "tower").
This image shows an example for Blender version 3.3.
Check the boxes in the "Animation" column as shown in this image. "Always Sample Animations" is unchecked by default. Check this box manually. If this box is not checked, animations will not work properly in-game.
Check the boxes in the "Animation" column as shown in this image. "Sampling Animations" is unchecked by default. Check this box manually. If this box is not checked, animations will not work properly in-game.
"animations":[
{
"channels":[
{
"sampler":0,
"target":{
"node":1,
"path":"rotation"
}
}
],
"name":"ConeAction",
"samplers":[
{
"input":8,
"interpolation":"LINEAR",
"output":9
}
]
}
],
Add animation tag to object XML file
To make animations exported from Blender work in MSFS games, you need to add animation tags to the ".xml" file automatically generated by the exporter plugin. This is done only once at the beginning. If you re-export the model after making corrections, you don't need to add it again. Instead, use the xml file you added last time as is. Be careful not to overwrite this xml file when exporting.For more information on the xml files that define 3D models and animation tags, see the following page.
MODEL DEFINITIONS (MSFS SDK docs)
MODEL ANIMATION DEFINITIONS (MSFS SDK docs)
The content of the xml file automatically generated by the exporter plugin will be one of the following.
<?xml version="1.0" encoding="utf-8"?>
<ModelInfo guid="{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}" version="1.1">
<LODS>
<LOD minSize="0" ModelFile="tower.gltf"/>
</LODS>
</ModelInfo>
or
<?xml version="1.0" encoding="utf-8"?>
<ModelInfo guid="{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}" version="1.1"/>
Add a line with the animation tag
<Animation name="ConeAction" guid="yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy" type="Standard" typeParam="Autoplay"/>
to it.
In the name="ConeAction" field, write the name of the animation action you incorporated in Blender (the NlaTrack track name).
In the guid="yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy" field, obtain a globally unique GUID and write it there.
How to obtain a GUID
There are several tools to generate GUIDs, including the software development tool "Microsoft Visual Studio." Here we will use the Online GUID / UUID Generator , which is available for free online.
You can specify the output format in the "Format:" field. Check "Hyphens".
You can specify the encoding format in the "Encording:" field. There is no need to check anything. Then click the [Generate some GUIDs!] button.
GUIDs (MSFS SDK docs)
Completed xml file
After adding the animation tag, the completed xml file will look like this:
<?xml version="1.0" encoding="utf-8"?>
<ModelInfo guid="{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}" version="1.1">
<LODS>
<LOD minSize="0" ModelFile="tower.gltf"/>
</LODS>
<Animation name="ConeAction" guid="yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy" type="Standard" typeParam="Autoplay"/>
</ModelInfo>
or
<?xml version="1.0" encoding="utf-8"?>
<ModelInfo guid="{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}" version="1.1">
<Animation name="ConeAction" guid="yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy" type="Standard" typeParam="Autoplay"/>
</ModelInfo>
If your ModelInfo line originally ended with "/>", don't forget to remove the "/".
Checking animated objects in-game
Incorporate the completed ".bin", ".gltf", and ".xml" files into your scenery project using the MSFS SDk and build it. For instructions on how to do this, see the page How to use glTF-Blender-IO-MSFS to export and import 3D data between Blender and MSFS .
How to use glTF-Blender-IO-MSFS to export and import 3D data between Blender and MSFS