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

P3D v5 Two animations on the same part

Messages
152
Country
france
Hi all, I am trying to understand whether it is possible to assign two different animations onto a same moving part: one animation on the model part and another on the SceneGraph Node ? It seems possible using MCX so ...

Reason for that is some aircraft use the same moving part for different purposes: elevator and spoiler for instance thus my question here.

If it is possible is there an animation that takes precedence over the other one ?

Thanks
 
Messages
854
Country
indonesia
yes, you can.
use model (mdl) you can use parent-child hirearchy. you must have source model file
use C++/GDI+ use parent-child
 

tgibson

Resource contributor
Messages
10,160
Country
us-california
I believe what he is saying is assign one animation to the part's parent (usually a small cube or similar object), and the other animation to the part itself (the child of the parent part). The animation of the parent is inherited by the child (spoiler, for example) and the child also has its own animation (elevator, for example).
 
Messages
659
Country
australia
If we're talking about Elevator and Spoiler on the same part then you would only use one animation. But you write your code so that the code checks your flight condition and then sets the appropriate animation value.

If you want a more specific answer you should ask a more specific question.
 
Messages
152
Country
france
thanks guys for responding. Ok as you said let's be more specific: as Tom said I would like the same part to act as a spoiler (when the spoiler is activated) and otherwise act as an elevator (some jet fighters use that combination).

So instead of creating one animation on the parent and another one for the child I tried to write one code only combining the two animations and after two or three cups of coffee here it is :

<PartInfo>
<Name>custom_elevator_spoiler</Name>
<AnimLength>100</AnimLength>
<Animation>
<Parameter>
<Code>
(A:GENERAL ENG COMBUSTION:1, bool)
(A:SPOILERS HANDLE POSITION, percent) 0 == and
if{ (A:ELEVATOR DEFLECTION PCT, percent) }
els{ (A:SPOILERS HANDLE POSITION, percent) }
</Code>
<Lag>100</Lag>
</Parameter>
</Animation>
</PartInfo>

The above code seems to work (maybe it can be improved). However I would like to introduce a third state which is to have the very same part going down when the engine is shut down (to reflect the loss of hydraulic pressure). I tried to modify the above code without success as I do not know how to add a third value when the GENERAL ENG COMBUSTION condition goes to zero
 
Messages
440
Country
us-wisconsin
This may be worth a try, ofc not tested...
XML:
<Code>
    (A:GENERAL ENG COMBUSTION:1, bool) if{
        (A:SPOILERS HANDLE POSITION, percent) 0 == if{
            (A:ELEVATOR DEFLECTION PCT, percent)
        } els{
            (A:SPOILERS HANDLE POSITION, percent)
        }
    } els{
        0
    }
</Code>
 
Messages
152
Country
france
well no luck .. the part never takes the "0" value which is the one it should take when the engine is off right ? The elevator deflection works as expected though and I think the spoiler as well.
 
Messages
577
Country
france
You need to use two empty plain axes :
- one of them is the first parent
- the second is the child of the first empty and
- the part is the child or the second empty.

Actions should be linked at each empty and among the empty selected, the right action is played.
I use this on Vtail aircraft to have elevons and rudder on the same part.
 
Last edited:
Messages
152
Country
france
Thanks Lagaffe
As I am not a real xml expert do you have an example of what you just explained ?
 
Messages
1,564
Country
thailand
One thing to consider is that (A:SPOILERS HANDLE POSITION, percent) might never be exactly equal to 0.00000000 ...

Try (A:SPOILERS HANDLE POSITION, percent) 0.2 &lt; and see if that makes a difference.

It's a good idea to look at a numerical readout of variables.

Bob
 
Messages
152
Country
france
so your code works now ! thanks for the advise.

By the way how can I look at the numerical readout of that variable (or another) while in flight ?
 
Messages
577
Country
france
In the SDK, you have SIMVARS.exe for this purpose (..\SDK_MSFS\Samples\SimvarWatcher\bin\x64\Release\Simvars.exe)
 
Messages
152
Country
france
Lagaffe I just noticed that you are referring to the MSFS SDK. However in the P3D SDK there is no simvar.exe
 
Messages
577
Country
france
For P3D v5 you can use BlackBox3 (https://www.robbiemcelrath.com)

It is less simple than Simvars but it complains. You have a little GUI in which you populate variables that you want read ans lauch it whit the sim for the results.
You can find an online help on Robbie homesite. I have use it with success for debugging my C150 TiBush/Damage Mod.
 
Messages
1,564
Country
thailand
This is the Blackbox website: https://www.robbiemcelrath.com/fs/blackbox/about. Blackbox can also output the variables you are watching to a .csv or .txt file so you can see how they change each gauge update cycle.

Debugging:. - Use a gauge debug app such as BlackBox, or xml vars from Doug Dawson, or LOCALVARS which is part of Tom Aguilo's XMLTOOLS. They are indispensable for debugging logic errors.

Or, just write your own simple gauge that shows the variable of interest in readout form - in an <Element>.

Bob
 
Top