Here are my steps so far:
I managed to create an animation group in Blender so all doors are triggered by one animation and both open and close animations are in the same file:
This works.
I then created simobject with the following in sim.cfg:
Code:
[VERSION]
Major=1
Minor=0
[fltsim.0]
title=CYOW_Doors
model=
texture=
[General]
category=StaticObject
DistanceToNotAnimate=50
And this in CYOW_Doors.xml:
XML:
<?xml version="1.0" ?>
<ModelInfo guid="{42a07289-bac6-4fe7-0fdb-b245856b9a57}" version="1.1">
<LODS>
<LOD ModelFile="CYOW_Doors_LOD00.gltf" minSize="50"/>
<LOD ModelFile="CYOW_Doors_LOD01.gltf"/>
</LODS>
<Animation guid="42a07289-811d-4fba-8eb2-abfc2d6e0d00" name="DoorsOpen" type="Standard" typeparam2="DoorsOpen"/>
<AnimGraph>
<DefaultState name="CYOW_Doors_blend"/>
<BlendTreeState name="CYOW_Doors_blend">
<Animations>
<Animation guid="42a07289-811d-4fba-8eb2-abfc2d6e0d00" loop="False" speed="1.0"/>
</Animations>
</BlendTreeState>
</AnimGraph>
</ModelInfo>
The doors load closed, and animation is not visible, however the animation triggers behind the scenes as soon as object is rendered. If I come close fast, I see the door opening animation going on, but if I wait a bit when I'm far (so doors are static and closed) and then come closer - the doors just jump open immediately, so animation is played and stopped even when invisible. Doors are juming closed and open when I cross the threshold back and forth, but animation is done and not playing. So not sure what to do about that. I need the animation started only when I'm close.
As an alternative, I tried to make the taxi light trigger both animations - closed and opened doors. And it doesn't work. Here's the code I tried, based on SDK example:
XML:
<?xml version="1.0" ?>
<ModelInfo guid="{42a07289-bac6-4fe7-0fdb-b245856b9a57}" version="1.1">
<LODS>
<LOD ModelFile="CYOW_Doors_LOD00.gltf" minSize="50"/>
<LOD ModelFile="CYOW_Doors_LOD01.gltf"/>
</LODS>
<Animation guid="42a07289-811d-4fba-8eb2-abfc2d6e0d00" name="DoorsOpen" type="Standard"/>
<Animation guid="42a07289-811d-4fba-8eb2-abfc2d6e0d01" name="DoorsClose" type="Standard"/>
<AnimGraph>
<DefaultState name="DoorsOpen"/>
<BlendTreeState name="DoorsOpen">
<Animations>
<Animation guid="42a07289-811d-4fba-8eb2-abfc2d6e0d00" loop="False" speed="1" threshold="0"/>
</Animations>
<Value>(A:LIGHT TAXI ON, Bool) 1 == if{ 1 } els{ 0 }</Value>
</BlendTreeState>
<BlendTreeState name="DoorsClose">
<Animations>
<Animation guid="42a07289-811d-4fba-8eb2-abfc2d6e0d01" loop="False" speed="1" threshold="1"/>
</Animations>
<Value>(A:LIGHT TAXI ON, Bool) 1 == if{ 1 } els{ 0 }</Value>
</BlendTreeState>
<Transition end="DoorsOpen" start="DoorsClose">
<Condition>(A:LIGHT TAXI ON, Bool) True</Condition>
</Transition>
<Transition end="DoorsClose" start="DoorsOpen">
<Condition>(A:LIGHT TAXI ON, Bool) False</Condition>
</Transition>
</AnimGraph>
</ModelInfo>
I also tried this one:
XML:
<?xml version="1.0" ?>
<ModelInfo guid="{42a07289-bac6-4fe7-0fdb-b245856b9a57}" version="1.1">
<LODS>
<LOD ModelFile="CYOW_Doors_LOD00.gltf" minSize="50"/>
<LOD ModelFile="CYOW_Doors_LOD01.gltf"/>
</LODS>
<Animation guid="42a07289-811d-4fba-8eb2-abfc2d6e0d00" name="DoorsOpen" type="Standard" typeparam2="DoorsOpen"/>
<Animation guid="42a07289-811d-4fba-8eb2-abfc2d6e0d01" name="DoorsClose" type="Standard" typeparam2="DoorsClose"/>
<AnimGraph>
<DefaultState name="CYOW_Doors_open"/>
<BlendTreeState name="CYOW_Doors_open">
<Animations>
<Animation guid="42a07289-811d-4fba-8eb2-abfc2d6e0d00" loop="False" speed="1.0"/>
<Animation guid="42a07289-811d-4fba-8eb2-abfc2d6e0d01" loop="False" speed="1.0" threshold="1"/>
</Animations>
<Value>(A:LIGHT TAXI ON, Bool) 1 == if{ 1 } els{ 0 }</Value>
</BlendTreeState>
</AnimGraph>
</ModelInfo>
Both do not work. I can see the doors closing when the object is rendering, so closing animation works OK. But nothing is happening on switching taxi lights on or off. Any ideas?