• 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 Flag waving in the wind direction

Messages
233
Country
canada
Is that possible to do? Some kind of blender aimation with a script? Does SDK support anything like that and is there any documentation or tutorials on how to do that?
 
Messages
233
Country
canada
That's nice, but how to orient it to the wind direction? It would be very wrong if it waves the other way from the wind :)
 
Messages
233
Country
canada
I replicated the flag from that tutorial, and it works within Blender when I click play, but I can't export it to MSFS - all I get is a static flag. I can't make keyframes in Blender with this flag - pressing I and "add keyframe" doesn't do anything at all, I see no keyframes added. So I need to find out how to make the animation from the cloth simulation, and how to export it correctly for MSFS. Then if I cna orient the flag to the wind it would be great, but so far - na animation at all. I appreciate your help.
 

Lagaffe

Resource contributor
Messages
865
Country
france
Hi,
A flag is composed by two elements: the flag and his support.
It's the support that you should anim to turn with the wind and it's also the parent of the flag which has it's proprer animation.
 
Last edited:
Messages
233
Country
canada
Hi,
A flag is composée by two éléments: the flag and his support.
It's the support that you should anim to turn with the wind and it's also the parent of the flag which has it's proprer animation.
It makes sense, actually I assumed just that, however I don't know how to do this either and could not find any documentation or tutorial about how to do that. Even just the flag animation creation/export is not working for me so far. Flag pole wind alignment I don't even know how to approach... Any advice?
 
Messages
75
Country
germany
Hi,

for the wind direction, you must enter in the xml file this:


XML:
<?xml version="1.0" encoding="utf-8" ?>
<ModelInfo version="1.1" guid="{XXXGUID}">

    <LODS>
        <LOD MinSize="0" ModelFile="ModelName.gltf"/>
    </LODS>

    <Animation name="AnimationName" guid="XXXGUID" length="360" type="Sim" typeParam2="AnimationName" typeParam="AutoPlay"/>
    
    <PartInfo>
      <Name>AnimationName</Name>
      <AnimLength>360</AnimLength>
      <Animation>
        <Parameter>
          <Code>(A:AMBIENT WIND DIRECTION, Degrees)</Code>
        </Parameter>
      </Animation>
    </PartInfo>

</ModelInfo>

then turn the flag around 360 degrees with 360 frames.
That works for me. However, I also manage not to create an animation with bones. The problem is always that it totally distorts my model.
 
Messages
233
Country
canada
Hmm. Didn't work for me. I did the animation in Blender and there are 360 frames and flag rotates when I move the playhead. "use this frame" is not checked in Blender2MSFS. However the flag sits fixed at a single position while windsocks rotate around. It just sits displaying one of the frames (including cloth warp, so the animation is there somewhere). Also, if that would work, how would I use cloth animation - the flag would be still at each wind position. Is there a way to do nested animation somehow? Or animate one object and another separately - how would I set up the BLender2MSFS export and XML file then?
Here's my XML for this object (does not work):

XML:
<?xml version="1.0" ?>
    <ModelInfo guid="{a152500f-f08e-481b-f2cb-ff01c04e0ef2}" version="1.1">
        <LODS>
            <LOD MinSize="0" ModelFile="CNC3_Flag-Canada.gltf"/>
        </LODS>
        <Animation guid="a152500f-f08e-481b-f2cb-ff01c04e0ef2" length="360" name="AnimationFlag" type="Sim" typeParam="AutoPlay" typeParam2="AnimationFlag"/>
        <PartInfo>
            <Name>AnimationFlag</Name>
            <AnimLength>360</AnimLength>
            <Animation>
                <Parameter>
                    <Code>(A:AMBIENT WIND DIRECTION, Degrees)</Code>
                </Parameter>
            </Animation>
        </PartInfo>
    </ModelInfo>
 
Last edited:
Messages
233
Country
canada
You need different Guid for Animation and Model.
I changed the animation guid to a different value but the flag still does not animate...
XML:
<?xml version="1.0" ?>
	<ModelInfo guid="{a152500f-f08e-481b-f2cb-ff01c04e0ef2}" version="1.1">
		<LODS>
			<LOD MinSize="0" ModelFile="CNC3_Flag-Canada.gltf"/>
		</LODS>
		<Animation guid="a152500f-f08e-481b-f2cb-af01c04e0efa" length="360" name="AnimationFlag" type="Sim" typeParam="AutoPlay" typeParam2="AnimationFlag"/>
		<PartInfo>
			<Name>AnimationFlag</Name>
			<AnimLength>360</AnimLength>
			<Animation>
				<Parameter>
					<Code>(A:AMBIENT WIND DIRECTION, Degrees)</Code>
				</Parameter>
			</Animation>
		</PartInfo>
	</ModelInfo>
 
Messages
233
Country
canada
OK, I found the Blender post about how to push animation to GUID and name it appropriately, the animation without the wind, just rotating the flag rounf and round, now works like this:
XML:
<?xml version="1.0" ?>
	<ModelInfo guid="{57494dc9-64f5-49d9-b307-411b9fe16954}" version="1.1">
		<Animation guid="11a27969-811d-4fba-8eb2-bbfc2d6e0d0f" name="wind" type="Standard" typeParam="Autoplay,Random"/>
	</ModelInfo>
But when I change it to this code, nothing happens:
XML:
<?xml version="1.0" ?>
	<ModelInfo guid="{57494dc9-64f5-49d9-b307-411b9fe16954}" version="1.1">
		<Animation guid="11a27969-811d-4fba-8eb2-bbfc2d6e0d0f" length="360" name="wind" type="Sim" typeParam="AutoPlay" typeParam2="wind"/>
		<PartInfo>	
			<Name>wind</Name>
			<AnimLength>360</AnimLength>
			<Animation>
				<Parameter>
					<Code>(A:AMBIENT WIND DIRECTION, Degrees)</Code>
				</Parameter>
			</Animation>
		</PartInfo>
	</ModelInfo>
 
Messages
233
Country
canada
then turn the flag around 360 degrees with 360 frames.
That works for me. However, I also manage not to create an animation with bones. The problem is always that it totally distorts my model.
Are you sure it works in MSFS 2020? Seems to be the way it worked in MSX. It didn't work for me... Does it actually work for you in MSFS2020?
 
Messages
75
Country
germany
Yes 100% in sim.
Do you have the model in the simobject folder?
In the simobject folder of the paderborn freeware scenery you can see how it works.
 
Messages
90
Country
germany
Would you mind to provide a short example how the files and directories are supposed to look like and what are the correct steps to proceed?

I'm struggling with the same problem (except that I want to make a switching animation depending on the wind direction). I tried to infer what to do based on the EDLP scenery as well as the SDK example (in particular the jetway one), but I can't get it work.

I have my model in the SimObject folder as suggested, and when I'm in the scenery editor, my object is listed under SimObjects and I can add it to the scene. However, when I build my scenery, copy it to the community folder, and load the scenery in the sim, the model doesn't show up at all.

My file structure looks as follows:
Code:
SimObjects
+- misc
  +- Model_Name
     +- model
     |  +- Model_Name.bin
     |  +- Model_Name.gltf
     |  +- Model_Name.xml
     |  +- model.CFG
     +- sim.cfg
I basically have the same files in Packages/scenery-name as well as in PackageSources. The content of model.cfg and sim.cfg has been adopted from the EDLP scenery. The model itself works fine when exported as usual into an ArtProj.

Do you have any suggestions what might be wrong? Any help is appreciated!
 
Messages
233
Country
canada
Yes 100% in sim.
Do you have the model in the simobject folder?
In the simobject folder of the paderborn freeware scenery you can see how it works.
No, it's the first time I hear about the simobject folder. This is new to me. I wish there was a clear tutorial on how to do this. I was saving this into the regular PackageSources\modelLib\CNC3Model\ where all my models are saved for this scenery. What should I do to get it into the simobject folder, and what should be config files? I'm using Blender2MSFS.
 
Messages
90
Country
germany
Here is what I've done so far:

1. Add an asset group of type "SimObjects" to your scenery, either in dev mode or manually by adding the following to your PackageDefinitions/project-name.xml file:
XML:
        <AssetGroup Name="SimObjects">
            <Type>SimObject</Type>
            <Flags>
                <FSXCompatibility>false</FSXCompatibility>
            </Flags>
            <AssetDir>PackageSources\SimObjects\misc\Model_Name</AssetDir>
            <OutputDir>SimObjects\misc\Model_Name</OutputDir>
        </AssetGroup>
"Model_Name" should be replaced by whatever you are modeling, e.g., "ICAO_WindSock" (in the following as well).

2. Create a directory SimObjects in your PackageSources folder, within that folder create a folder named misc, and within that folder, create a folder named Model_Name.

3. In the folder Model_Name, create an additional folder model (literally) and if your model has textures, also create a folder named texture.

4. Also in the Model_Name folder, create a file named sim.cfg with the following content:
Code:
[VERSION]
Major=1
Minor=0

[fltsim.0]
title=Model_Name
model=
texture=

[General]
category=StaticObject
Again replace "Mode_Name" with whatever you are using.

5. Export your model as usual using Blender2MSFS into the Model_Name folder. If your model has textures, remember to copy them to the texture folder.

6. In the model's XML file, specify the animation as desired, i.e., as you have done it above.

7. In the folder Model_Name, create a file named model.cfg with the following content:
Code:
[models]
normal=Model_Name.xml
The field needs to be adapted according to the name of your XML file. At this point, your file and directory structure should look as shown in my previous post.

8. Open your scenery in dev mode, build the scenery, close everything, copy your scenery to the community folder, and open the scenery in dev mode again. If you now open the scenery editor, your object should be listed in SimObjects and you can place it in the scene.

However, this is the point where I stuck. In particular, the 3D model it self doesn't show up, neither in the scenery editor nor later after building the scenery. I also tried to copy the SimObjects folder created above directly to the created package. Then it looks exactly the same as in the EDLP scenery, but this was unsuccessful as well.

So some of the above mentioned steps is likely not correct or something else is missing. Thank you in advance for your help!
 
Messages
90
Country
germany
I guess I figured it out :D

It seems like that the texture folder need to be present in the Model_Name folder even when the model has no textures at all. Furthermore, the texture folder need to contain a file named "texture.CFG" with the following content:
XML:
[fltsim]
fallback.1=..\..\..\..\scenery\global\scenery\TEXTURE

Please let me know of this works for you as well!
 
Messages
233
Country
canada
I guess I figured it out :D

It seems like that the texture folder need to be present in the Model_Name folder even when the model has no textures at all. Furthermore, the texture folder need to contain a file named "texture.CFG" with the following content:
XML:
[fltsim]
fallback.1=..\..\..\..\scenery\global\scenery\TEXTURE

Please let me know of this works for you as well!
Thanks. I will try to follow this and see if it works for me. The difficult part is also baking in the cloth weaving animation in blender - I can't make it work on export so far. So there would be one animation with flag weaving in the wind, and the other one for the wind angle. Noth sure how to make both work at the same time... I will try though.
 
Messages
90
Country
germany
Maybe you can work with multiple objects in Blender and set a parent relation? I.e., you have the root of the bunting that has no weaving animation but has a wind direction animation. In addition, you have the rest of the bunting with the weaving animation as well as a parent relation to the root. When the root rotates, all child elements will rotate as well.

I need to figure out that issue as well because I want to create a windsock next.

Btw, according to the windsock in the ELDP scenery, you can also set a wind velocity dependent animation:
XML:
    <Animation name="EDLP_Windsock_Speed_00" guid="65EEB9F1-259C-44CE-954D-69C2420B3431" type="Standard"/>
    <Animation name="EDLP_Windsock_Speed_05" guid="4D419C72-7949-4C72-A81F-03BB969ED86D" type="Standard"/>
    <Animation name="EDLP_Windsock_Speed_10" guid="1FB42441-63DD-4EBC-9241-3393D378B869" type="Standard"/>
    <Animation name="EDLP_Windsock_Speed_15" guid="C1800E30-EF34-444D-93FC-6D5ABE2AAA92" type="Standard"/>
    <Animation name="EDLP_Windsock_Speed_20" guid="6C39D52C-E70F-4054-8E9C-1A55EC704574" type="Standard"/>
    <Animation name="EDLP_Windsock_Speed_25" guid="64C096E1-67C1-4204-B262-E8425AC8B8F8" type="Standard"/>   

    <AnimGraph>     
        <DefaultState name="EDLP_Windsock_Blend"/>       
        <BlendTreeState name="EDLP_Windsock_Blend">
          <Animations>
            <Animation guid="65EEB9F1-259C-44CE-954D-69C2420B3431" loop ="True" speed="1" threshold="0"/>
            <Animation guid="4D419C72-7949-4C72-A81F-03BB969ED86D" loop ="True" speed="1" threshold="5"/>
            <Animation guid="1FB42441-63DD-4EBC-9241-3393D378B869" loop ="True" speed="1" threshold="10"/>
            <Animation guid="C1800E30-EF34-444D-93FC-6D5ABE2AAA92" loop ="True" speed="1" threshold="15"/>
            <Animation guid="6C39D52C-E70F-4054-8E9C-1A55EC704574" loop ="True" speed="1" threshold="20"/>
            <Animation guid="64C096E1-67C1-4204-B262-E8425AC8B8F8" loop ="True" speed="1" threshold="25"/>
          </Animations>
          <Value>(A:AMBIENT WIND VELOCITY, KNOTS)</Value>
        </BlendTreeState>
     </AnimGraph>
 
Messages
233
Country
canada
Maybe you can work with multiple objects in Blender and set a parent relation? I.e., you have the root of the bunting that has no weaving animation but has a wind direction animation. In addition, you have the rest of the bunting with the weaving animation as well as a parent relation to the root. When the root rotates, all child elements will rotate as well.

I need to figure out that issue as well because I want to create a windsock next.
I tried just the weaving for now. I managed to convert it to keyframes by exporting cloth simulation object to .mdd and reimporting. So no modifier is present now, instead there are tons of keyframes, which is good. But when I start it with the ame command that worked before it still doesn't work:

1602954623594.png


XML:
<?xml version="1.0" ?>
    <ModelInfo guid="{a152500f-f08e-481b-f2cb-ff01c04e0ef3}" version="1.1">
        <LODS>
            <LOD MinSize="0" ModelFile="CNC3_Flag-Canada.gltf"/>
        </LODS>
        <Animation guid="11a27969-811d-4fba-8eb2-bbfc2d6e0d0f" name="weave" type="Standard" typeParam="Autoplay,Random"/>
    </ModelInfo>

I pushed down the new animation, got the action track in NLE window, seems that it should work but it doesn't
 
Top