• 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 SimObject animation does not work well

Messages
9
Country
japan
I used the SimObject animation posted on Youtube as a reference, but it did not work well.

Please see the XML code I pasted and the Blender image.

Are there any flaws in this code or blender?

Please comment if you have any other images or codes you need.

XML:
<?xml version="1.0" ?>



    <ModelInfo guid="{4f2268af-215e-4a17-a8c9-cf0a5a193631}" version="1.1">
    <LODS>
        <LOD minSize="0" ModelFile="kakunouko"/>
    </LODS>




    <Animation guid="d05e84db-7da3-477f-abd7-7a307f2c61f3" length="250" name="door1" type="Sim" typeParam="AutoPlay" typeParam2="door1" />
    <Animation guid="5ed0b426-613a-41c3-9d4b-375f752afeaa" length="250" name="door2" type="Sim" typeParam="AutoPlay" typeParam2="door2" />
    <Animation guid="edc1bab0-37c7-4797-a149-ce5989b6f6eb" length="250" name="door3" type="Sim" typeParam="AutoPlay" typeParam2="door3"/>
    <Animation guid="a7a80774-56e8-47e5-a1f2-2c2debb562d3" length="250" name="door4" type="Sim" typeParam="AutoPlay" typeParam2="door4"/>
    <Animation guid="59231251-b910-423f-86cc-012b014f392a" length="250" name="door5" type="Sim" typeParam="AutoPlay" typeParam2="door5"/>


    <DefaultState name="kakunouko"/>

    <AnimGraph>
        <DefaultState name="kakunouko"/>
        <BlendTreeState name="kakunouko">
          <Animations>
            <Animation guid="d05e84db-7da3-477f-abd7-7a307f2c61f3" loop="False" speed="1"/>
            <Animation guid="5ed0b426-613a-41c3-9d4b-375f752afeaa" loop="False" speed="1"/>
            <Animation guid="edc1bab0-37c7-4797-a149-ce5989b6f6eb" loop="False" speed="1"/>
            <Animation guid="a7a80774-56e8-47e5-a1f2-2c2debb562d3" loop="False" speed="1"/>
            <Animation guid="59231251-b910-423f-86cc-012b014f392a" loop="False" speed="1"/>

          </Animations>
        </BlendTreeState>
    </AnimGraph>


<!--

IF   

 (E:LOCAL TIME, Seconds) > 28800

 AND

(E:LOCAL TIME, Seconds) < 64800

OR

(L:XMLVAR_YokeHidden1) = 1

 (28800 / 60 / 60) = 8 AM
 (64800 / 60 / 60) = 6 PM
 
THEN

PLAY ANIMATION TO 250

ELSE

PLAY ANIMATION TO 0


-->

<!-- old legacy code-->

    <PartInfo>
        <Name>door1</Name>

        <AnimLength>250</AnimLength>
        <Animation>
            <Parameter>
                <Code>
                (E:LOCAL TIME, Seconds) 28800 &gt; (E:LOCAL TIME, Seconds) 64800 &lt; and (L:XMLVAR_YokeHidden1) 1 == or if{ 250 } els{ 0 }
                </Code>
                <Lag>10</Lag>
            </Parameter>
        </Animation>
    </PartInfo>
    <PartInfo>
        <Name>door2</Name>
        <AnimLength>250</AnimLength>
        <Animation>
            <Parameter>
                <Code>
                (E:LOCAL TIME, Seconds) 28800 &gt; (E:LOCAL TIME, Seconds) 64800 &lt; and (L:XMLVAR_YokeHidden1) 1 == or if{ 250 } els{ 0 }
                </Code>
                <Lag>10</Lag>
            </Parameter>

        </Animation>
    </PartInfo>
    <PartInfo>
        <Name>door3</Name>
        <AnimLength>250</AnimLength>
        <Animation>
            <Parameter>
                <Code>
                (E:LOCAL TIME, Seconds) 28800 &gt; (E:LOCAL TIME, Seconds) 64800 &lt; and (L:XMLVAR_YokeHidden1) 1 == or if{ 250 } els{ 0 }
                </Code>
                  <Lag>10</Lag>
            </Parameter>
        </Animation>
    </PartInfo>
    <PartInfo>
        <Name>door4</Name>
        <AnimLength>250</AnimLength>
        <Animation>
            <Parameter>
                <Code>
                (E:LOCAL TIME, Seconds) 28800 &gt; (E:LOCAL TIME, Seconds) 64800 &lt; and (L:XMLVAR_YokeHidden1) 1 == or if{ 250 } els{ 0 }
                </Code>
                  <Lag>10</Lag>
            </Parameter>
        </Animation>
    </PartInfo>
    <PartInfo>
        <Name>door5</Name>
        <AnimLength>250</AnimLength>
        <Animation>
            <Parameter>
                <Code>
                (E:LOCAL TIME, Seconds) 28800 &gt; (E:LOCAL TIME, Seconds) 64800 &lt; and (L:XMLVAR_YokeHidden1) 1 == or if{ 250 } els{ 0 }
                </Code>
                  <Lag>10</Lag>
            </Parameter>
        </Animation>
    </PartInfo>

</ModelInfo>



<!-- new non working msfs code-->
<!--
<Behaviors>

            <Component ID="door1">
            <UseTemplate Name="ASOBO_GT_Anim_Code">
                    <ANIM_NODE_ID>portDXEst</ANIM_NODE_ID>
                    <ANIM_NAME>door1</ANIM_NAME>
                                   <ANIM_CODE>(E:LOCAL TIME, Seconds) 28800 &gt; (E:LOCAL TIME, Seconds) 64800 &lt; and if{ 250 } els{ 0 }</ANIM_CODE>
            <ANIM_WRAP>1</ANIM_WRAP>
            <ANIM_LENGTH>250</ANIM_LENGTH>
            </UseTemplate>

            </Component>

            <Component ID="door2" Node="door2">
                <Animation>
                            <Parameter>
                                   <Code>
                                    (E:LOCAL TIME, Seconds) 28800 &gt; (E:LOCAL TIME, Seconds) 64800 &lt; and if{ 250 } els{ 0 }
                                   </Code>
                            <Lag>10</Lag>
                            </Parameter>
                    </Animation>
            </Component>

            <Component ID="door3" Node="door3">
                <Animation>
                            <Parameter>
                                   <Code>
                                    (E:LOCAL TIME, Seconds) 28800 &gt; (E:LOCAL TIME, Seconds) 64800 &lt; and if{ 250 } els{ 0 }
                                   </Code>
                            <Lag>10</Lag>
                            </Parameter>
                    </Animation>
            </Component>

            <Component ID="door4" Node="door4">
                <Animation>
                            <Parameter>
                                   <Code>
                                    (E:LOCAL TIME, Seconds) 28800 &gt; (E:LOCAL TIME, Seconds) 64800 &lt; and if{ 250 } els{ 0 }
                                   </Code>
                            <Lag>10</Lag>
                            </Parameter>
                    </Animation>
            </Component>

            <Component ID="door5" Node="door5">
                <Animation>
                            <Parameter>
                                   <Code>
                                    (E:LOCAL TIME, Seconds) 28800 &gt; (E:LOCAL TIME, Seconds) 64800 &lt; and if{ 250 } els{ 0 }
                                   </Code>
                            <Lag>10</Lag>
                            </Parameter>
                    </Animation>
            </Component>

        
    </Behaviors>
-->
 

Attachments

  • Desktop Screenshot 2022.06.26 - 16.08.38.98.png
    Desktop Screenshot 2022.06.26 - 16.08.38.98.png
    1.2 MB · Views: 18
  • Desktop Screenshot 2022.06.26 - 16.11.54.66.png
    Desktop Screenshot 2022.06.26 - 16.11.54.66.png
    306.6 KB · Views: 17
Messages
502
Country
italy
We need the know the error the console is throwing
or the behaviour you are expecting and In the sim is not like you want

Moving on

It this line .glTF is missing, should be

Code:
&lt;LOD minSize="0" ModelFile="kakunouko.glTF"/&gt;

Inviato dal mio Mi 9 Lite utilizzando Tapatalk
 
Messages
9
Country
japan
Thank you for your response.

The behavior I am expecting is an animation like opening a hangar door. (URL)

I have pasted a portion of the modified XML.

The first image is the error in the console.
The second image is the SimObject xml in PackageDefinitions



XML:
<?xml version="1.0" ?>



    <ModelInfo guid="{4f2268af-215e-4a17-a8c9-cf0a5a193631}" version="1.1">
    <LODS>
        <LOD minSize="0" ModelFile="kakunouko.glTF"/>
    </LODS>
 

Attachments

  • Desktop Screenshot 2022.06.26 - 21.18.17.45.png
    Desktop Screenshot 2022.06.26 - 21.18.17.45.png
    1.8 MB · Views: 22
  • Desktop Screenshot 2022.06.26 - 21.20.56.84.png
    Desktop Screenshot 2022.06.26 - 21.20.56.84.png
    186.3 KB · Views: 20
Messages
502
Country
italy
The console has the solution

You output dir goes all the way to the model dir, but you need to stop one level up, in the video you have seen there is the correct path
08e3489e5b0829789d0d8fce9c5e3417.jpg


Inviato dal mio Mi 9 Lite utilizzando Tapatalk
 
Messages
502
Country
italy
Code:
&lt;OutputDir&gt;
SimObjects\Landmarks\kakunouko\&lt;\OutputDir&gt;
[\Code]

Inviato dal mio Mi 9 Lite utilizzando Tapatalk
 
Messages
9
Country
japan
After editing the xml in PackageDefinitions, the first error was corrected but a different error appeared.
 

Attachments

  • Desktop Screenshot 2022.06.26 - 22.34.39.12.png
    Desktop Screenshot 2022.06.26 - 22.34.39.12.png
    2.3 MB · Views: 21
Messages
502
Country
italy
i have tried the xml provided in the post above and works has expected, no error is thrown by the compiler.
The culript can be the gltf itself (the 3d model), usually this is due to stray/disconnected/lose vertex/edges/faces. You can fix by select all you meshes in Blender, edit mode, Mesh-Clean Up-Delete Loose



As a troubleshoot suggestion, you should try to export your hangar as a simple scenery object first, than try the animations an lastly wrapping the whole thing in a simboject
 
Messages
1
Country
canada
Hi Kapi
I look at your project and tools used to achieve that,
You're good with BLENDERb so why not going a little bit further.
Instead of having five animations to compose within the XML file (complicated Tool), you should have only one animation using the ARMATURE (BONE) tools in BLENDER.
Blenders Armature For Beginners_The Basics To Get Started - YouTube

Also, don't try to animate much complex objects at the beginning (simple is faster to test).
[020] Creating Animated Scenery - Microsoft Flight Simulator 2020 SDK Tutorials - YouTube
Export it in MSFS to test using a very simple XML file that should look like this:

<ModelInfo version="1.1" guid="{23b3f01d-ce4f-480b-92df-d6364748d141}">
<Animation name="KAPI" guid="b6491583-176e-4d14-8874-cdbeb9d2ebe7" type="Standard" typeParam="Autoplay"/>
</ModelInfo>

This XML file will be a repetitive animation as no condition are defined in XML file.

***Also remerber that a PACKAGE must be built and place in the COMMUNITY folder for scene containing animation to be seen in MSFS.

Next, when all will work it will be much easier to add some code lines for animation START conditions in the XML file and understand them.

Don't forget this is MY suggestion, have an opened mind for something better !
Good luck with this interesting project Kapi
 
Messages
9
Country
japan
Hi Kapi
I look at your project and tools used to achieve that,
You're good with BLENDERb so why not going a little bit further.
Instead of having five animations to compose within the XML file (complicated Tool), you should have only one animation using the ARMATURE (BONE) tools in BLENDER.
Blenders Armature For Beginners_The Basics To Get Started - YouTube

Also, don't try to animate much complex objects at the beginning (simple is faster to test).
[020] Creating Animated Scenery - Microsoft Flight Simulator 2020 SDK Tutorials - YouTube
Export it in MSFS to test using a very simple XML file that should look like this:

<ModelInfo version="1.1" guid="{23b3f01d-ce4f-480b-92df-d6364748d141}">
<Animation name="KAPI" guid="b6491583-176e-4d14-8874-cdbeb9d2ebe7" type="Standard" typeParam="Autoplay"/>
</ModelInfo>

This XML file will be a repetitive animation as no condition are defined in XML file.

***Also remerber that a PACKAGE must be built and place in the COMMUNITY folder for scene containing animation to be seen in MSFS.

Next, when all will work it will be much easier to add some code lines for animation START conditions in the XML file and understand them.

Don't forget this is MY suggestion, have an opened mind for something better !
Good luck with this interesting project Kapi
Roger that. I will give it a try.
However, I will be busy for the next four days, so I will be a little late in reporting the results. Sorry about that.
 
Top