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

MSFS [SOLVED] Propeller Visibility does not seem to work.....

mskhan1991

Resource contributor
Messages
895
Country
pakistan
Hi!

I would be grateful if anyone can help me with this. I did my animation groups and used the simple aircraft xml for animating my propeller. It was working previously but them something happened with the xform and I had to redo everything from start. Now the prop is spinning but the visibility is not working. The three stages of props are always visible when the engine is started (i.e. still, slow and blurred). The helper is the rotational animation and the slow, still and blurred are meshes linked to it. They meshes are not animated however I have added keys at 0 and 100 frames for the animation group to export. What could I be doing wrong???

1714589151156.png
 

Attachments

  • modeldef xml.txt
    9.4 KB · Views: 29
Ok if you're trying to copy the SImpleAircraft, your propanim node must have no key on frame 0, so your 100 key animation would presumably have 5 keys at 20, 40, 60, 80 and 100. Your meshes have no keys at all. In the Babylon Animation Groups, you declare your propanim node for keys 0 to 80 and you declare each of your meshes for keys 20 to 100. If that doesn't work, reanimate your propanim node from 0 to 5 and then declare propanim for keys 1 to 5 and your meshes for keys 0 to 4. You don't have to reanimate it either, you can simply scale your 100 key animation to 5 keys by right clicking in the timeline and selecting all keys, they will turn white, set the cursor within the range of keys, you will see a white arrow, click and drag to scale the key timeline up or down.
 
Ok if you're trying to copy the SImpleAircraft, your propanim node must have no key on frame 0, so your 100 key animation would presumably have 5 keys at 20, 40, 60, 80 and 100. Your meshes have no keys at all. In the Babylon Animation Groups, you declare your propanim node for keys 0 to 80 and you declare each of your meshes for keys 20 to 100. If that doesn't work, reanimate your propanim node from 0 to 5 and then declare propanim for keys 1 to 5 and your meshes for keys 0 to 4. You don't have to reanimate it either, you can simply scale your 100 key animation to 5 keys by right clicking in the timeline and selecting all keys, they will turn white, set the cursor within the range of keys, you will see a white arrow, click and drag to scale the key timeline up or down.
Propanim= keys 20-100 = animationgroup length 0-80?

Blades= keys 0-100 (2 keyframes, one at 0 and other at 100) = animationgroup length 20-100 for all?

This does not work. I did indeed have my still disappearing but then I didnt know what I did that made it happen....
 
Ok well you want to look at the assigned keys for each type of state, propanim uses one key combination and the propeller states use a different combination, both on the animation timeline and in the Babylon Animations Group. I can tell you this is not the only way to animate propellers. For example I have an aircraft that has no keyframes on its prop mesh, the prop_anim node is animated with keys 0, 1, 2, 3, 4 on the timeline and in the Babylon Animation Groups and prop1_still is parented to prop_anim, has no keyframes in the timeline and has keys 0, 4 in the Babylon Animation Groups.
 
I'll start by saying I'm not familiar with 3DS nor do I use the old style of writing modeldef code for MSFS. I use the newer Behavior format.

Having said that if the various props are simple visibility parts attached to a common rotating part then they shouldn't need any keyframes nor you should you be assigning animations.

Here is an example of how I use Behavior format and Blender. The prop part is named "winjeel_prop_speed_2" and that is what the sim picks up. In Blender I do not have any animation assigned to these prop parts. It's only the parent part of the propeller which is animated. All the various props are non-animated children of the animated parent.

Code:
        <Component ID="winjeel_prop_speed_2" Node="winjeel_prop_speed_2">
            <UseTemplate Name="ASOBO_GT_Visibility">
                <VISIBILITY_CODE>
                    (A:IS USER SIM,bool)
                    if{    (A:GENERAL ENG RPM:1, RPM) 250 &gt;= (A:GENERAL ENG RPM:1, RPM) 900 &lt; &amp; if{ 1 } els{ 0 } }
                    els{ (A:PROP MAX RPM PERCENT:1, percent) 9.6 &gt;= (A:PROP MAX RPM PERCENT:1, percent) 34.6 &lt; &amp; if{ 1 } els{ 0 } }
                </VISIBILITY_CODE>
            </UseTemplate>
        </Component>

In MSFS the part name and the animation can be different. You should ensure the animation name in the modeling program matches the name in your code but for things like emission and visibility there are no animations and in those cases the part name should match the name used in your code.
 
(A:IS USER SIM,bool)

You have different prop states for when your aircraft is AI? Everything we're dealing with here is model/keyframe related, btw as easily supported by modeldef as by behavior code. The SimpleAircraft sample animations are not nearly so simple as they could be but they do follow that same convention as you suggest above. There has to be a Blender allegory to the requirement to declare animations in the Babylon Animation Groups.
 
You have different prop states for when your aircraft is AI? Everything we're dealing with here is model/keyframe related, btw as easily supported by modeldef as by behavior code. The SimpleAircraft sample animations are not nearly so simple as they could be but they do follow that same convention as you suggest above. There has to be a Blender allegory to the requirement to declare animations in the Babylon Animation Groups.
I have different prop animations for the user aircraft because, and I've written about this earlier, the default variable for prop animation runs at about 18fps which is less than ideal. It's fine for AI aircraft but not good enough for the user aircraft.

No, there isn't a Blender allegory to declare animations. In blender you simply name the animation (usually in NLA tracks if you want more than one part to share the same animation) the same as it is in your code. That's all. There is no Babylon Animation Groups or an equivalent in Blender.
 
Ok so now I have solved the issue using newer method of prop animation templates as following
Code:
<Component ID="ENGINE">
            <UseTemplate Name="ASOBO_ENGINE_Propeller_Template">
                <ID>1</ID>
                <ANIM_NAME>Prop_Anim</ANIM_NAME>
                <STILL_NODE_ID>PROP_STILL</STILL_NODE_ID>
                <SLOW_NODE_ID>PROP_SLOW</SLOW_NODE_ID>
                <PROP_BLURRED_NODE_ID>PROP_BLUR</PROP_BLURRED_NODE_ID>
                <PROP_SIDE_BLURRED_NODE_ID>PROP_SIDE</PROP_SIDE_BLURRED_NODE_ID>
                <BLADE_COUNT>2</BLADE_COUNT>
                <USE_BLADE_ROTATION>True</USE_BLADE_ROTATION>
            </UseTemplate>
        </Component>

How can I change the prop node visibility as per RPM percent 0-20, 20-50, 50-greater.

Like in your code
Code:
 (A:GENERAL ENG RPM:1, RPM) 250 &gt
 
We can go to the SDK Template Explorer and look up ASOBO_ENGINE_Propeller_Template and this is what we see.

Propeller.png
 

Attachments

  • 1715217760844.png
    1715217760844.png
    98 KB · Views: 11
Ok so now I have solved the issue using newer method of prop animation templates as following
Code:
<Component ID="ENGINE">
            <UseTemplate Name="ASOBO_ENGINE_Propeller_Template">
                <ID>1</ID>
                <ANIM_NAME>Prop_Anim</ANIM_NAME>
                <STILL_NODE_ID>PROP_STILL</STILL_NODE_ID>
                <SLOW_NODE_ID>PROP_SLOW</SLOW_NODE_ID>
                <PROP_BLURRED_NODE_ID>PROP_BLUR</PROP_BLURRED_NODE_ID>
                <PROP_SIDE_BLURRED_NODE_ID>PROP_SIDE</PROP_SIDE_BLURRED_NODE_ID>
                <BLADE_COUNT>2</BLADE_COUNT>
                <USE_BLADE_ROTATION>True</USE_BLADE_ROTATION>
            </UseTemplate>
        </Component>

How can I change the prop node visibility as per RPM percent 0-20, 20-50, 50-greater.

Like in your code
Code:
 (A:GENERAL ENG RPM:1, RPM) 250 &gt

You may define the MIN_RPM_FOR_SLOW and MIN_RPM_FOR_BLUR parameters.

It looks like the Asobo template only gives you 3 types of prop: Still, Slow and Blur.


Code:
<Component ID="EXT_ENGINE">
            <UseTemplate Name="ASOBO_ENGINE_Propeller_Template">
                <ID>1</ID>
                <ANIM_NODE_ID>Prop1</ANIM_NODE_ID>
                <ANIM_NAME>prop1_anim</ANIM_NAME>
                <STILL_NODE_ID>prop0_still</STILL_NODE_ID>
                <FROSTED_STILL_NODE_ID>prop0_still_frost</FROSTED_STILL_NODE_ID>
                <SLOW_NODE_ID>prop0_slow</SLOW_NODE_ID>
                <PROP_BLURRED_NODE_ID>prop0_blurred</PROP_BLURRED_NODE_ID>
                <PROP_SIDE_BLURRED_NODE_ID>PROP_SIDE_BLUR</PROP_SIDE_BLURRED_NODE_ID>
                <NO_PROP_CONE_BLUR>True</NO_PROP_CONE_BLUR>
                <MIN_RPM_FOR_SLOW>320</MIN_RPM_FOR_SLOW>
                <MIN_RPM_FOR_BLUR>570</MIN_RPM_FOR_BLUR>
            </UseTemplate>
        </Component>

The templates will eventually lead to code like this (looks familiar doesn't it?):

Code:
<Template Name="ASOBO_ENGINE_Propeller_Slow_Visibility_Template">
    <UseTemplate Name="ASOBO_GT_Visibility_Code">
        <VISIBILITY_CODE>
                    (A:PROP RPM:#ID#, rpm) #MIN_RPM_FOR_SLOW# &gt;
                    (A:PROP RPM:#ID#, rpm) #MIN_RPM_FOR_BLUR# &lt; and
            </VISIBILITY_CODE>
    </UseTemplate>
</Template>
 
Code:
<Template Name="ASOBO_ENGINE_Propeller_Slow_Visibility_Template">
    <UseTemplate Name="ASOBO_GT_Visibility_Code">
        <VISIBILITY_CODE>
                    (A:PROP RPM:#ID#, rpm) #MIN_RPM_FOR_SLOW# &gt;
                    (A:PROP RPM:#ID#, rpm) #MIN_RPM_FOR_BLUR# &lt; and
            </VISIBILITY_CODE>
    </UseTemplate>
</Template>
Oh yes, can I define this in the same XML? I do not get the concept of template here.....? sorry for being an idiot, just stuck at the old way of xml here..... :(
 
Oh yes, can I define this in the same XML? I do not get the concept of template here.....? sorry for being an idiot, just stuck at the old way of xml here..... :(
Templates are like macros.

The Asobo one's are just massively nested templates which makes it quite hard to understand what they are doing most times.

Here is some code for a very simple propeller animation and visibility conditions which should suit most people's use cases for a fixed pitch propeller. Constant speed propellers would need to be a bit more complicated as you would have to animated the pitch of the blades too.

In this case you have a Prop_core part which is animated to rotate and is always visible in all states (as a part this could be the prop shaft to the engine). Then you have 4 parts for the various propeller speeds which are switched using the visibility conditions.

Anything in CAPITAL letters is a macro name. When you call the template with UseTemplate you use the PARAMETERS to change the default values in the Template you are using. ASOBO_GT_Anim_Code and ASOBO_GT_Visibility are base level templates. The Asobo templates will eventually end up calling a base template but they also put a lot of stuff in the top level templates to account for every single possible situation.

Code:
        <UseTemplate Name="ASOBO_GT_Anim_Code">
            <ANIM_NAME>Prop_core</ANIM_NAME>
            <ANIM_CODE>(A:PROP ROTATION ANGLE:1,degrees) 3.60 / </ANIM_CODE>
            <ANIM_LENGTH>100</ANIM_LENGTH>
        </UseTemplate>
        <Component ID="prop_speed_0_vis" Node="prop_speed_0_vis">
            <UseTemplate Name="ASOBO_GT_Visibility">
                <VISIBILITY_CODE>
                    (A:PROP RPM:1, RPM) 1000 &lt=;
                </VISIBILITY_CODE>
            </UseTemplate>
        </Component>
        <Component ID="prop_speed_1_vis" Node="prop_speed_1_vis">
            <UseTemplate Name="ASOBO_GT_Visibility">
                <VISIBILITY_CODE>
                    (A:PROP RPM:1, RPM) 1000 &gt; (A:PROP RPM:1, RPM) 1400 &lt; &amp;
                </VISIBILITY_CODE>
            </UseTemplate>
        </Component>
        <Component ID="prop_speed_2_vis" Node="prop_speed_2_vis">
            <UseTemplate Name="ASOBO_GT_Visibility">
                <VISIBILITY_CODE>
                    (A:PROP RPM:1, RPM) 1400 &gt; (A:PROP RPM:1, RPM) 1800 &lt; &amp;
                </VISIBILITY_CODE>
            </UseTemplate>
        </Component>
        <Component ID="prop_speed_3_vis" Node="prop_speed_3_vis">
            <UseTemplate Name="ASOBO_GT_Visibility">
                <VISIBILITY_CODE>
                    (A:PROP RPM:1, RPM) 1800 &gt;
                </VISIBILITY_CODE>
            </UseTemplate>
        </Component>
 
Templates are like macros.

The Asobo one's are just massively nested templates which makes it quite hard to understand what they are doing most times.
.............................
[/CODE]
Oh yes, I have been trying to work with the new style of code and getting the hang of it. For now I have settled with simple animation, I don't plan on changing the width of blade disc since its a constant speed prop on my project. I am using following code for now:


Code:
<Component ID="ENGINE">
            <UseTemplate Name="ASOBO_ENGINE_Propeller_Template">
                <ID>1</ID>
                <ANIM_NAME>Prop_Anim</ANIM_NAME>
                <STILL_NODE_ID>PROP_STILL</STILL_NODE_ID>
                <SLOW_NODE_ID>PROP_SLOW</SLOW_NODE_ID>
                <PROP_BLURRED_NODE_ID>PROP_BLUR</PROP_BLURRED_NODE_ID>
                <PROP_SIDE_BLURRED_NODE_ID>PROP_SIDE</PROP_SIDE_BLURRED_NODE_ID>
                <BLADE_COUNT>2</BLADE_COUNT>
                <MIN_RPM_FOR_SLOW>300</MIN_RPM_FOR_SLOW>
                <MIN_RPM_FOR_BLUR>1500</MIN_RPM_FOR_BLUR>
                <USE_BLADE_ROTATION>True</USE_BLADE_ROTATION>
            </UseTemplate>
        </Component>
 
Back
Top