• 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 Simple Animation

Christian Bahr

Resource contributor
Messages
994
Country
germany
Hi!

I am currently in the process of adding some of my models to the MFS and that has worked quite well so far. Mostly they are static models without animation, such as the large halls, plants, the tower, etc.
But at one point I just get stuck. It's about objects that have animation. Even simple things like the rotating light on the tower are not animated in the MFS. Or, I would like to have all of my animated people in the MFS. That doesn't work either.

Maybe this is a general problem with the MFS SDK or I just have the wrong approach !? I was able to export the models successfully, i.e. without error messages, as glTF graphic format and the animations are also displayed correctly in the preview for glTF models - everything is as it should be. Only in the MFS itself, I just can't get any animations. And that's exactly where I get stuck and can't get any further.

How do you create your animations or has anyone ever managed to bring an animated object into the MFS? Is there a specific workflow that you have to adhere to?
 
I am also very interesting because I am almost at the same point in my apprenticeship programme.
 
Have you "Tagged" the animation in the model behavior file? We now have to define the animations through the .XML file accompanied with the .gltf instead of the unified modeldef.xml.
 
Have you "Tagged" the animation in the model behavior file? We now have to define the animations through the .XML file accompanied with the .gltf instead of the unified modeldef.xml.
Yes, I read about it somewhere, but I couldn't figure it out. Unfortunately I don't know what an example of a model behavior file should look like or what the content of the xml file should look like. I didn't find anything in the documentation of the SDk that could help me.
 
The model behaviour file includes the animation information used on a particular model. Attached an example code that I confirmed to be working in the sim. Basically it's quite similar to the "Ambient" tag used in P3D, the animation name is different in this case. We can use the name of our choice, but it should match the name in the babylon animation groups. This is important otherwise the animation won't work. The rest of the process is similar as with any other scenery object. Let me know if that helps.

Screenshot_7.png
 
Last edited:
Yes, I read about it somewhere, but I couldn't figure it out. Unfortunately I don't know what an example of a model behavior file should look like or what the content of the xml file should look like. I didn't find anything in the documentation of the SDk that could help me.
Look at the DA62 sample aircraft found in the SDK or downloadable from within MSFS 2020. The entire package and source files are there. If you are using Max the geometry with animations and textures as well as the layer system can be examined. All xml files are included.
 
I was going to ask a similar question. I'm quite perplexed at this new system vs the old modeldef.xml way. Where are the actual xml animations defined? I looked at the ModelBehaviorDefs directory and it's a little confusing. For example on the DA62 source file, the animations are setup as point helpers ( using 3ds max 2018 ). If I look at the "LeftFlap" helper, where is the actual animation tag? I can't find a part name in the xml library with the name "LeftFlap". I know I am missing something... or a lot of things lol.

Really wondering why they did it this way vs keeping the old way of a centralized xml code file. Thanks in advance and sorry if I hijacked the original question. I can post this separately if needed.

EDIT. I realized by reading SimArc's post a few times that the Babylon animation groups has the names defined. Makes a little more sense.

I guess the next question is where do I define a custom animation code. Do I just make my own xml file and reference that?

Thanks again
 
The model behaviour file includes the animation information used on a particular model. Attached an example code that I confirmed to be working in the sim. Basically it's quite similar to the "Ambient" tag used in P3D, however the animation name is different in this case. Although we can use a name of our choice, but it should match the name in the babylon animation groups. This is important otherwise the animation won't work. The rest of the process is similar as with any other scenery object. Let me know if that helps.

View attachment 62396
Thanks, this seems to be exactly what I was looking for. Will try that out later.
 
I just wanted to briefly report that it worked with the XML file for animations. With that I have taken a decisive step forward. Thank you very much for this very valuable advice!
 
Is the animation xml the same as for the object? Where do you get the guid for the animation?
 
I got it working finally. But when I use the Multi-export tool it doesn't work. So I have to use the Babylon.js export tool and select Export with Animation enabled
 
Ok one second. How does this applies to blender? And what is babylon? Isn't there a full range tutorial somewhere because the more I read the most I get confused on how behavior files workz how to assign animations or animations groups and such. Any help would be appreciated, thanks ♥️
 
Ok one second. How does this applies to blender? And what is babylon? Isn't there a full range tutorial somewhere because the more I read the most I get confused on how behavior files workz how to assign animations or animations groups and such. Any help would be appreciated, thanks ♥
I'm not sure if it works with Blender. But Babylon is the export tool used in 3ds max. You can also assign animation groups in 3ds max and change the name of the animation as well.
 
I'm not sure if it works with Blender. But Babylon is the export tool used in 3ds max. You can also assign animation groups in 3ds max and change the name of the animation as well.
So in order to have working animations I only have to export through 3DSMax? I know it might sound stupid but is there any chance we can get a full video or written guide on animations setup starting from naming inside the modeler and such, so I can try to translate the guide to blender (if possible with Blender2MSFS)? I know it's time taking but consider there is NO INFORMATION about this. It would be of help to the whole Community somehow
 
I have also been looking at animations wrt MSFS and have found there are two ways to get them into MSFS. The old modeldef.xml way and the newer Animation Templates way. Have a look at the SDK and GaugeAircraft example. Look at the xml for the exterior model. You see this

Code:
    <Animation name="c_wheel"                 guid="BC935F16-43CD-4046-8EF3-06E44A5940AB" length="200" type="Sim" typeparam2="c_wheel" typeparam="AutoPlay" />

    <PartInfo>
        <Name>c_wheel</Name>
        <AnimLength>200</AnimLength>
        <Animation>
            <Parameter>
          <Code>
            (A:GEAR CENTER STEER ANGLE, grads) 0 &gt; if{ (A:GEAR CENTER STEER ANGLE, grads) 0.5 * } els{ (A:GEAR CENTER STEER ANGLE, grads) 0.5 * 200 + }
          </Code>
            </Parameter>
        </Animation>
        <MouseRect>
            <TooltipID>TOOLTIPTEXT_STEER_ANGLE</TooltipID>
        </MouseRect>
    </PartInfo>

If you look at the DA62 - or look at the 172 inside the OneStore folder asobo-aircraft-c172sp-as1000 you have animation templates. These boil down to being a bunch of macro like functions with variables you pass into these macro functions that build the animation code like partInfo

Code:
    <Component ID="GEARS">
        <UseTemplate Name="ASOBO_GEAR_Center_Template">
            <ANIM_NAME>c_gear</ANIM_NAME>
        </UseTemplate>
        <UseTemplate Name="ASOBO_GEAR_Left_Template">
            <ANIM_NAME>l_gear</ANIM_NAME>
        </UseTemplate>
        <UseTemplate Name="ASOBO_GEAR_Right_Template">
            <ANIM_NAME>r_gear</ANIM_NAME>
        </UseTemplate>
        <Component ID="GEAR_Tires">
            <DefaultTemplateParameters>
                <NO_STILL_BLURRED_TRANSITION/>
            </DefaultTemplateParameters>
            <UseTemplate Name="ASOBO_GEAR_Center_Tire_Template">
                <ANIM_NAME>c_tire_key</ANIM_NAME>
                <NODE_ID_STILL>CENTRAL_WHEEL</NODE_ID_STILL>
                <NODE_ID_BLURRED>CENTRAL_WHEEL_BLURRED</NODE_ID_BLURRED>
            </UseTemplate>
            <UseTemplate Name="ASOBO_GEAR_Left_Tire_Template">
                <ANIM_NAME>l_tire_key</ANIM_NAME>
                <NODE_ID_STILL>LEFT_WHEEL</NODE_ID_STILL>
                <NODE_ID_BLURRED>LEFT_WHEEL_BLURRED</NODE_ID_BLURRED>
            </UseTemplate>
            <UseTemplate Name="ASOBO_GEAR_Right_Tire_Template">
                <ANIM_NAME>r_tire_key</ANIM_NAME>
                <NODE_ID_STILL>RIGHT_WHEEL</NODE_ID_STILL>
                <NODE_ID_BLURRED>RIGHT_WHEEL_BLURRED</NODE_ID_BLURRED>
            </UseTemplate>
        </Component>
        <UseTemplate Name="ASOBO_GEAR_Steering_Template">
            <ANIM_NAME>c_wheel_key</ANIM_NAME>
        </UseTemplate>
    </Component>

The UseTemplate points to macros which point to more macros etc.

Drilling down to exterior.xml in the fs-base-aircraft-common folder you get to:

Code:
    <Template Name="ASOBO_GEAR_Center_Template">
        <DefaultTemplateParameters>
            <ANIM_NAME>GEAR_Center</ANIM_NAME>
            <ID>0</ID>
        </DefaultTemplateParameters>
        <UseTemplate Name="ASOBO_GEAR_Base_Template">
        </UseTemplate>
    </Template>

Have not got this to work yet, but it's worth a look at for us blender guys. Your gltf and bin files reference the animation in the <model behavior> section of the associates xml in the model folder.
 
Hi Christian,

If I understand correctly, it should be also possible to create door's animations for hangar ?
Yes, that is possible. The doors would then open and open in an endless loop. The interesting question would be whether an animation can be linked to an event. So, for example, you enter a very specific frequency on the radio and use it to control the hangar door.
 
Back
Top