claus kludder
Resource contributor
- Messages
- 16
- Country
SOLUTION; Looped key framed animation of an rotating disk, with on/off swith now WORKING...
I tryed out this for a key framed animation ( An Ventilation rotor in the VC Roof, with an on/off switch on the Dashboard ) for FSX & P3D modeldef.xml, and it did not Work for Me even seach and try out many suggestions...
But I wanted it to Work as I did not like the TicK18/Ambient Params. You cannot create a working switch ( At least I could not ) for the Ambient animation, and the rotation speed is also to slow for a Ventilator Rotor after My opinion.
After working hard 3 very long days 15-16 hours each ( Even thought about create the rotor objeckt as an effect ) I had My Heruka
Because of all the help I found here on this forum from both Arno and other users, I decided to share this XML code here free to use both for freeware as well as commersial use.
The Switch code is quite simple and can be used for any kind of switches ( Actualle I spend a lot of time on that get it working, before I found an almost identically code here.
Because its only the switch wich has an "Lag" parameter, not the actual rotating object, Theres a small delay in the retracting of the switch, maybee anyone here can improve the XML code? But feel free to use it, just credit Me as I credit for the help I get, especially Bill Leaming, from wich's "3 Speed Wiper" animation XML souce code, I got the inspiration to the finally solution ;-)
The looping code of the rotating objeckt can be used to loop any key framed animation as well...
If You just want an keyframed animtion for and objeckt as well as the on/off switch without looping, heres another example wich can be used for any animated object with a switch to start and stop the animation...
Images from ongoing update of the Piper Pa28-140
Ventilator off FSX
Ventilator on FSX
Ventilator_0ff P3D
Ventilator_on P3D
Sincerely Regards
Claus V. Holmberg / SCANSIM Flightsimulation
I tryed out this for a key framed animation ( An Ventilation rotor in the VC Roof, with an on/off switch on the Dashboard ) for FSX & P3D modeldef.xml, and it did not Work for Me even seach and try out many suggestions...
But I wanted it to Work as I did not like the TicK18/Ambient Params. You cannot create a working switch ( At least I could not ) for the Ambient animation, and the rotation speed is also to slow for a Ventilator Rotor after My opinion.
After working hard 3 very long days 15-16 hours each ( Even thought about create the rotor objeckt as an effect ) I had My Heruka
Because of all the help I found here on this forum from both Arno and other users, I decided to share this XML code here free to use both for freeware as well as commersial use.
The Switch code is quite simple and can be used for any kind of switches ( Actualle I spend a lot of time on that get it working, before I found an almost identically code here.
Because its only the switch wich has an "Lag" parameter, not the actual rotating object, Theres a small delay in the retracting of the switch, maybee anyone here can improve the XML code? But feel free to use it, just credit Me as I credit for the help I get, especially Bill Leaming, from wich's "3 Speed Wiper" animation XML souce code, I got the inspiration to the finally solution ;-)
The looping code of the rotating objeckt can be used to loop any key framed animation as well...
Code:
<Animation name="Ventilation_Switch" guid="80AAE78A-E159-463b-A9EC-6672BA0ED196" length="100" type="Sim" typeParam2="Ventilation_Switch" typeParam="AutoPlay" />
<PartInfo>
<Name>Ventilation_Switch</Name>
<AnimLength>100</AnimLength>
<Animation>
<Parameter>
<Code>
(L:Ventilation_Switch,number) 100 *
</Code>
<Lag>400</Lag>
</Parameter>
</Animation>
<MouseRect>
<Cursor>Hand</Cursor>
<MouseFlags>LeftSingle</MouseFlags>
<TooltipText>Ventilation Switch</TooltipText>
<CallbackCode>
(L:Ventilation_Switch) ! (>L:Ventilation_Switch)
</CallbackCode>
</MouseRect>
</PartInfo>
<Animation name="ventilation_Anim" guid="A958CDE7-9FFE-4c33-A5EC-605563F5025F" length="100" type="Sim" typeParam2="ventilation_Anim" typeParam="AutoPlay" />
<PartInfo>
<Name>ventilation_Anim</Name>
<AnimLength>100</AnimLength>
<Animation>
<Parameter>
<Code>
(L:Ventilation_Switch,number) 100 *
if{ (L:Ventilation_Switch) 100 * != (L:Ventilation_Switch) 1 > or
if{ (L:Ventilation_Switch) (L:Ventilation_Switch) 0.75 * + 100 % d (>L:Ventilation_Switch) }
els{ (>L:Ventilation_Switch) }
</Code>
</Parameter>
</Animation>
</PartInfo>
If You just want an keyframed animtion for and objeckt as well as the on/off switch without looping, heres another example wich can be used for any animated object with a switch to start and stop the animation...
Code:
<Animation name="switch_cabin_heat" guid="BC4DDB66-F7AB-4eb3-8CCE-43DD216DE7A8" length="50" type="Sim" typeParam2="switch_cabin_heat" typeParam="AutoPlay" />
<PartInfo>
<Name>switch_cabin_heat</Name>
<AnimLength>50</AnimLength>
<Animation>
<Parameter>
<Code>
(L:switch_cabin_heat,number) 50 *
</Code>
<Lag>400</Lag>
</Parameter>
</Animation>
<MouseRect>
<Cursor>Hand</Cursor>
<MouseFlags>LeftSingle</MouseFlags>
<CallbackCode>
(L:switch_cabin_heat) ! (>L:switch_cabin_heat)
</CallbackCode>
</MouseRect>
</PartInfo>
<Animation name="cabin_heat_Disk" guid="3F965545-01BF-418d-A8D3-B42AAB283DB2" length="100" type="Sim" typeParam2="cabin_heat_Disk" typeParam="AutoPlay" />
<PartInfo>
<Name>cabin_heat_Disk</Name>
<AnimLength>100</AnimLength>
<Animation>
<Parameter>
<Code>
(L:switch_cabin_heat) 100 *
</Code>
<Lag>400</Lag>
</Parameter>
</Animation>
</PartInfo>
Images from ongoing update of the Piper Pa28-140
Ventilator off FSX
Ventilator on FSX
Ventilator_0ff P3D
Ventilator_on P3D
Sincerely Regards
Claus V. Holmberg / SCANSIM Flightsimulation
Last edited: