• 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.

Triggering a Standard Human SimObject animation from SimConnect or SimVar

SPerx

Moderator
Staff member
Messages
82
Country
unitedkingdom
I have a Human SimObject exported from 3ds Max containing a single 250-frame Standard animation.



The animation loops correctly.

If I remove AutoPlay, the figure is visible but frozen.

I experimented with adding an ASOBO_GT_Anim_Code behaviour driven by LIGHT TAXI, but although the scenery compiled, the animation remained frozen.

My C++ SimConnect framework is already detecting the Taxi Light correctly, so the event side is working.

My question is:

Is there a supported way to start a Standard animation on demand, or must the asset be exported as a different type of animation to be controlled by Model Behaviors or WASM?
 
Do you have the code you have created so far?



(The standard LIGHT TAXI var is not available.on your SimObject btw, so that might be the reason the anim is not firing)
 
Hi, this is the current code.

""

<?xml version="1.0" encoding="utf-8" ?>
<ModelInfo version="1.1" guid="{2adbaf56-831d-4dbb-a613-dd5c0f7ac0d6}">

<ModelBehavior>

<!-- Animation defined in your GLTF -->
<Animations>
<Animation name="marshaller_2" guid="c04ab74e-9c20-4f75-a414-4ae2b8068522" type="Standard">
<Parameter>
<Code>(A:LIGHT TAXI, Bool)</Code>
</Parameter>
</Animation>
</Animations>

<!-- Behavior logic driven directly by aircraft SimVar -->
<Behaviors>
<Behavior>
<Component ID="TaxiLightTrigger">
<UseTemplate Name="ASOBO_GT_Condition">
<Condition>(A:LIGHT TAXI, Bool) 1 ==</Condition>
</UseTemplate>

<OnTrue>
<AnimPlay Name="marshaller_2"/>
</OnTrue>

<OnFalse>
<AnimStop Name="marshaller_2"/>
</OnFalse>
</Component>
</Behavior>
</Behaviors>

</ModelBehavior>

<!-- LOD definition -->
<LODS>
<LOD MinSize="0" ModelFile="military_marshaller_2_lod0.gltf"/>
</LODS>

</ModelInfo>

""
 
Hi, this is the current code.

""

<?xml version="1.0" encoding="utf-8" ?>
<ModelInfo version="1.1" guid="{2adbaf56-831d-4dbb-a613-dd5c0f7ac0d6}">

<ModelBehavior>

<!-- Animation defined in your GLTF -->
<Animations>
<Animation name="marshaller_2" guid="c04ab74e-9c20-4f75-a414-4ae2b8068522" type="Standard">
<Parameter>
<Code>(A:LIGHT TAXI, Bool)</Code>
</Parameter>
</Animation>
</Animations>

<!-- Behavior logic driven directly by aircraft SimVar -->
<Behaviors>
<Behavior>
<Component ID="TaxiLightTrigger">
<UseTemplate Name="ASOBO_GT_Condition">
<Condition>(A:LIGHT TAXI, Bool) 1 ==</Condition>
</UseTemplate>

<OnTrue>
<AnimPlay Name="marshaller_2"/>
</OnTrue>

<OnFalse>
<AnimStop Name="marshaller_2"/>
</OnFalse>
</Component>
</Behavior>
</Behaviors>

</ModelBehavior>

<!-- LOD definition -->
<LODS>
<LOD MinSize="0" ModelFile="military_marshaller_2_lod0.gltf"/>
</LODS>

</ModelInfo>

""
this feel like provided by AI, most of the tags do not exist in the SDK documentation

the following should be correct, i suppose you have at least 2 animations, one when the marshaller is doing something (marshaller_2), another one when the marshaller is idle

The key is (L:marshaller_activity) . You can use any other var, but those must be available on your simobject. So L: var are ok (they are global variables), the most abused one is
XMLVAR_YokeHidden1 because several aircraft have it too
or E var like the one related to time e.g. E:TIME OF DAY




<?xml version="1.0" encoding="utf-8" ?>
<ModelInfo>

<Animation name="marshaller_2" guid="c04ab74e-9c20-4f75-a414-4ae2b8068522" type="Standard"/>
<Animation name="Idle1" guid="CC18178F-6A78-4D2F-9436-57AB48A9383E" type="Standard"/>

<AnimGraph>

<DefaultState name="Idle"/>

<BlendTreeState name="Idle" doBlend="False">
<Animations>
<Animation guid="CC18178F-6A78-4D2F-9436-57AB48A9383E" loop ="True" speed="1"/>
</Animations>
</BlendTreeState>

<BlendTreeState name="doing_stuff">
<Animations>
<Animation guid="c04ab74e-9c20-4f75-a414-4ae2b8068522" loop ="True" speed="1"/>
</Animations>
</BlendTreeState>

<Transition start="Idle" end ="doing_stuff">
<Condition>(L:marshaller_activity) 1 ==</Condition>
</Transition>
<Transition start="doing_stuff" end ="Idle">
<Condition>(L:marshaller_activity) 0 ==</Condition>
</Transition>

</AnimGraph>
</ModelInfo>
 
Thank you for your very helpful reply.

Yes, the code I posted was AI generated. I had thought that Microsoft Co-Pilot may be useful because I assumed that it would have some connectivity with ASOBO Studios and thus be able to create viable solutions. The undocumented tags arose when the AI Engine claimed that the SDK documentation is not well maintained and the AI was using "correct" current SDK. This of course led to a cycle of changes which ended with a project which did not compile. I have learned my lesson.

The animation is a single one of 250 frames, which Christian made for me. It starts with a few seconds at rest, then performs the action - it is a military groundcrew member marshalling an aircraft away from a TAB-V shelter. I was planning to use the taxi light switch as the trigger, so that the sim user can indicate "ready to taxi" by turning on the taxi light, which triggers the animation. So I think that it has just one animation when it is "doing-stuff".

I will spend some time on comparing the code and see if I can make progress based on your help. Thanks again.
 
Back
Top