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

Knob animation

Messages
116
Country
canada
Hi all!

I'm trying to animate this knob. I've animated it in Blender, I just don't know how to write the code for custom animation. I basically just want a dummy switch where I click left and right to switch between intervals. In this case, MIN, NORM, HIGH, MAX. I want to be able to do this for other knobs with more intervals, but I'm just not sure how to code the animation in the XML. Hopefully, that makes sense, any advice is appreciated! Thanks!
knob.png
 
This is the best template to use for the multi-stage switches. You just supply the name of the animation from Blender and what code to execute for each position. The state is held internally in the component.

XML:
<UseTemplate Name = "ASOBO_GT_Switch_XStates">
    <ANIM_NAME>MySwitchAnimation</ANIM_NAME>
    <NUM_STATES>4</NUM_STATES>
    <CODE_POS_0></CODE_POS_0>
    <CODE_POS_1></CODE_POS_1>
    <CODE_POS_2></CODE_POS_2>
    <CODE_POS_3></CODE_POS_3>   
</UseTemplate>
 
sal1800 can you provide more details for that fairly useful-looking template? E.g.

* do the code sections provide the frame number for the animation?

* does the template provide all the default UI behaviour, i.e. the mouse scroll wheel will change the switch state, and maybe a mouse click does something?

So the general idea would be to put your intended program XML, such triggering a K: event or setting an L: var, in the CODE_POS section, followed by a frame number ?

I'm not sure what other basic properties you'd want - I guess the tooltip, whether you want 3 to scroll to 0, and what sound the switch should make.
 
It's quite an advanced template. It manages the animation automatically, I guess by just dividing up the keyframes for each position. You don't supply any keyframe numbers in the code params. I can see an optional param for <OVERRIDE_ANIM_CODE> if you needed it to animate based on some other simvar. It handles the scroll wheel and all of that.

I think you can use the <ANIMTIP_0_ON_PERCENT>, <ANIMTIP_1_ON_PERCENT>, etc. for the tooltips. You can try more of the animation standard parameters, like lag, bias and so on, as I think they will be used also.
All of these templates are in the official packages, fs-base-aircraft-common/ModelBehaviorDefs with basic interaction templates in /Generic/Complex.
 
Back
Top