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

Messages
255
Country
germany
To make it easier for you, here is the complete folder except the PNG files of the stock textures. If you would contact me on deiscord, I would also send you the blender file. My user is GuidoH #4520
 

Attachments

  • SimObjects.zip
    2.6 MB · Views: 256
Messages
58
Country
switzerland
Hi.

Try a different name for Component ID. As far as I know, the names for Component ID and Node must not be identical!


Maybe this code will help:

<Component ID="CubeAction_Test" Node="CubeAction">
I'm not seeking to contradict you, Christian, but I was having troubles with Component ID and Node names when setting up visibility conditions, so I've been trying quite a lot of combinations and came to quite the opposite conclusion :
If the node/container/group is named "my_cube" in 3DSMax, the conditional visibility will work nicely if I set <Component ID="my_cube" Node="my_cube">.
If for any reason I need to edit the gltf object with MCX, then the nodes will be automatically renamed by MCX => I must set <Component ID="node0" Node="node0"> (or node1, node2, etc.. if more nodes defined)

My 2 cents
Antoine
 

rhumbaflappy

Administrator
Staff member
Resource contributor
Messages
5,945
Country
us-wisconsin
I tried the GuidoH example, and it didn't work in that the hangar door continually loops. I played with the XML code a bit and came up with this:

XML:
<?xml version="1.0"?>

<ModelInfo guid="{9b731e6d-f594-48ab-dfbf-00c4625e06be}" version="1.1">

    <LODS>
        <LOD minSize="0" ModelFile="Hangar_NW2Lo2.gltf"/>
    </LODS>

    <Animation guid="873FC11A-74DE-47c0-88B9-B3A21AFEFB76" length="100" name="Lamelle1" type="Sim" typeParam="AutoPlay" typeParam2="Lamelle1"/>
    <Animation guid="2BA02658-BC28-40FE-BFA5-885B0715B1B5" length="100" name="Lamelle2" type="Sim" typeParam="AutoPlay" typeParam2="Lamelle2"/>
    <Animation guid="A9893281-9135-4E85-AF78-E9D9F581E6B0" length="100" name="Lamelle3" type="Sim" typeParam="AutoPlay" typeParam2="Lamelle3"/>
    <Animation guid="3F1A43C3-6704-46BA-BDF1-5A87F96ACE29" length="100" name="Lamelle4" type="Sim" typeParam="AutoPlay" typeParam2="Lamelle4"/>
    <Animation guid="541DAAE9-D7BA-46AA-97B5-F669E862D294" length="100" name="Lamelle5" type="Sim" typeParam="AutoPlay" typeParam2="Lamelle5"/>
    <Animation guid="40D136BD-ED83-43DC-B408-7926FAAE3EBD" length="100" name="Lamelle6" type="Sim" typeParam="AutoPlay" typeParam2="Lamelle6"/>


    <DefaultState name="Hangar_NW2Lo2_Close"/>

    <AnimGraph>
        <DefaultState name="Hangar_NW2Lo2_Close"/>
        <BlendTreeState name="Hangar_NW2Lo2_Close">
          <Animations>
            <Animation guid="873FC11A-74DE-47c0-88B9-B3A21AFEFB76" loop="False" speed="1"/>
            <Animation guid="2BA02658-BC28-40FE-BFA5-885B0715B1B5" loop="False" speed="1"/>
            <Animation guid="A9893281-9135-4E85-AF78-E9D9F581E6B0" loop="False" speed="1"/>
            <Animation guid="3F1A43C3-6704-46BA-BDF1-5A87F96ACE29" loop="False" speed="1"/>
            <Animation guid="541DAAE9-D7BA-46AA-97B5-F669E862D294" loop="False" speed="1"/>
            <Animation guid="40D136BD-ED83-43DC-B408-7926FAAE3EBD" loop="False" speed="1"/>
          </Animations>
        </BlendTreeState>
    </AnimGraph>

    <PartInfo>
        <Name>Lamelle1</Name>
        <AnimLength>100</AnimLength>
        <Animation>
            <Parameter>
                <Code>
                (L:XMLVAR_YokeHidden1) 1 == if{ 50 } els{ 0 }
                </Code>
                <Lag>10</Lag>
            </Parameter>
        </Animation>
    </PartInfo>
    <PartInfo>
        <Name>Lamelle2</Name>
        <AnimLength>100</AnimLength>
        <Animation>
            <Parameter>
                <Code>
                (L:XMLVAR_YokeHidden1) 1 == if{ 50 } els{ 0 }
                </Code>
                <Lag>10</Lag>
            </Parameter>
        </Animation>
    </PartInfo>
    <PartInfo>
        <Name>Lamelle3</Name>
        <AnimLength>100</AnimLength>
        <Animation>
            <Parameter>
                <Code>
                (L:XMLVAR_YokeHidden1) 1 == if{ 50 } els{ 0 }
                </Code>
                <Lag>10</Lag>
            </Parameter>
        </Animation>
    </PartInfo>
    <PartInfo>
        <Name>Lamelle4</Name>
        <AnimLength>100</AnimLength>
        <Animation>
            <Parameter>
                <Code>
                (L:XMLVAR_YokeHidden1) 1 == if{ 50 } els{ 0 }
                </Code>
                <Lag>10</Lag>
            </Parameter>
        </Animation>
    </PartInfo>
    <PartInfo>
        <Name>Lamelle5</Name>
        <AnimLength>100</AnimLength>
        <Animation>
            <Parameter>
                <Code>
                (L:XMLVAR_YokeHidden1) 1 == if{ 50 } els{ 0 }
                </Code>
                <Lag>10</Lag>
            </Parameter>
        </Animation>
    </PartInfo>
    <PartInfo>
        <Name>Lamelle6</Name>
        <AnimLength>100</AnimLength>
        <Animation>
            <Parameter>
                <Code>
                (L:XMLVAR_YokeHidden1) 1 == if{ 50 } els{ 0 }
                </Code>
                <Lag>10</Lag>
            </Parameter>
        </Animation>
    </PartInfo>
</ModelInfo>

The important change is (L:XMLVAR_YokeHidden1) 1 == if{ 50 } els{ 0 }

When set to 100, the whole 100% keyframes play. When set to 50, the keyframes stop at 50%. The yoke toggle toggles the open or close state. Attached is a zip with the alteration I made to Guido's code. Many thanks Guido.
 

Attachments

  • SimObjectTest.zip
    2.6 MB · Views: 162
Last edited:
Messages
5
Country
newzealand
If I want the entire model to disappear, (Which has about 50 Objects and 3 separate animations,) do I just leave out the <Component><Component\> ?
I can't seem to get it to work, but I have managed to get one of my objects going invisible.
 
Messages
255
Country
germany
Hey guys any idea why this is not working?
<?xml version="1.0" ?>
<ModelInfo guid="{55d2870f-e330-454a-b702-52b7882b0f72}" version="1.1">
<LODS>
<LOD ModelFile="StrahlerRotWeiss.gltf" minSize="0"/>
</LODS>
</ModelInfo>
<ModelBehaviors>
<Include Path="Asobo\Misc\SimObjects.xml"/>
<Component ID="Strahler" Node="Spot">
<Visibility>
<Parameter>
<Code>
(E:TIME OF DAY, enum) 1 == (A:AMBIENT PRECIP STATE, mask) 2.0 &lt; and if{ 0 } els{ 1 }
</Code>
</Parameter>
</Visibility>
</Component>
</ModelBehaviors>
 
Messages
255
Country
germany
<Component ID="Strahler" Node="Spot">

Try to give both the same name as the node in Blender/3DSMax has.
I'll give it a try and I assume you are right. It makes sence if the node is the node of blender in my case. Like the animation names are the same in blender and in the XML as well. If You get my Like, it works...
Thx Senchay for your answer anyway...
Best regards Guido
 
Messages
255
Country
germany
I'm using this in my test nowand it doesn't work. I will now change the data of the folder in SimObjects the same name and I'll try SpotNight
1622792995253.png

<Component ID="SpotLight" Node="SpotLight">
 
Messages
255
Country
germany
Didn't work but I changed the parent child relation that was missing and try it again now with name="SpotNight"
So the best way to do it is using the same name/ID/filename/folder name for the simobject. So I used SpotNight for all the identifiers that have to be used for the simobject in XML and files and folders.
<?xml version="1.0" ?>

<ModelInfo guid="{ec38ac37-e9e8-46ea-2bda-35735fcdf5be}" version="1.1">
<LODS>
<LOD ModelFile="SpotNight.gltf" minSize="0"/>
</LODS>
</ModelInfo>
<ModelBehaviors>
<Include Path="Asobo\Misc\SimObjects.xml"/>
<Component ID="SpotNight" Node="SpotNight">
<Visibility>
<Parameter>
<Code>
(E:TIME OF DAY, Enum) 1 == if{ 1 } els{ 0 }
</Code>
</Parameter>
</Visibility>
</Component>
</ModelBehaviors>
 
Last edited:
Messages
58
Country
switzerland
Didn't work but I changed the parent child relation that was missing and try it again now with name="SpotNight"
I'm not sure for Blender, but I reckon it might be the same as in 3DSMax : lights are by default only visible by night.

In 3DSMax there's however an "automatic day/night switch" for lights, I haven't tried it out, I assume there could be a similar switch in Blender too.

Otherwise, even if you set visibility to 1 during daytime your lights won't be visible in the sim...

Hint : reduce the complexity by first setting a "straightforward" visibility condition until the Simobject correctly shows up/disappears, then only work on the conditions themselves.
E.g. I use codes like (E:LOCAL MONTH OF YEAR, Number) 4 == if{ 1 } els{ 0 } so that my Simobject is only visible if I set the sim in April.

My 2 cents
Antoine
 
Last edited:
Messages
96
Country
spain
oi oi, reviving this thread cause id like to know how i can add a time of day condition to this:

Code:
<?xml version="1.0" encoding="utf-8" ?>
<ModelInfo version="1.1" guid="{a7e57515-27c1-4a27-80b3-fd22a273cd5d}">
    <LODS>
        <LOD MinSize="10" ModelFile="ATR72.gltf"/>
    </LODS>
</ModelInfo>



<ModelBehaviors>
        <Component ID="ATR72" Node="ATR72">
            <Visibility>
                <Parameter>
                    <Code>(E:LOCAL YEAR, Number) 2007 &gt;= (E:LOCAL YEAR, Number) 2025 &lt;= and if{ 1 } els{ 0 }</Code>
                </Parameter>
            </Visibility>
        </Component>

        <Component ID="ATR72closed" Node="ATR72closed">
            <Visibility>
                <Parameter>
                    <Code>(E:LOCAL YEAR, Number) 2007 &gt;= (E:LOCAL YEAR, Number) 2025 &lt;= and if{ 1 } els{ 0 }</Code>
                </Parameter>
            </Visibility>
        </Component>



</ModelBehaviors>


as you see i have 2 nodes (a plane that has an open and closed mesh).
they currently should only appear after 2007 (and until 2025), but i'd also change the visibility that the closed one shows from 10pm until 5am and then it's open. how does that work? simply adding (E:LOCAL TIME, Seconds) variables to my existing code didn't work.. :(
 
Messages
255
Country
germany
Hi, not really sure what u r trying to achieve? The present code makes the two items visible in the years 2007 through 2025. Why 2007? we have 2021 so the 2007 doesn't make any sense to me. And than? 1st object is the opened one and the second the closed one. Well let's talk on discord https://discord.gg/WZDT7YKuJm
 
Messages
96
Country
spain
because i made it possible for an atr to appear where before it was a dc-9. its kind of an easter egg. anyways the main condition should be: open plane visible from 5am to 10pm, closed all other times :s
 
Messages
1,053
Country
australia
simply adding (E:LOCAL TIME, Seconds) variables to my existing code didn't work..
Show your code.

Code:
(E:LOCAL TIME, seconds) &lt; [5am in seconds]  (E:LOCAL TIME, seconds) &gt; [10pm in seconds] (E:LOCAL YEAR, Number) 2007 &gt;= (E:LOCAL YEAR, Number) 2025 &lt;= and and || if{ 1 } els{ 0 }

Change the time in seconds to the time in seconds. This should work for between 10pm and 5am visible. Because it's reverse polish notation the || (or operator) works on the first two conditions. Then the second "and" makes it true when the year condition is also true.

A more natural way of writing this would be:

Code:
( (E:LOCAL TIME, seconds) &lt; [5am in seconds]  || (E:LOCAL TIME, seconds) &gt; [10pm in seconds] ) and ( (E:LOCAL YEAR, Number) 2007 &gt;= and (E:LOCAL YEAR, Number) 2025 &lt;= ) if{ 1 } els{ 0 }

But that's not how reverse polish notation works.
 
Messages
96
Country
spain
many thanks Ant! i had exactly what you had, but without the and and. that must be why. i was wondering if there was || notation but its good to know this will work. let me test it. many thanks!
 
Messages
96
Country
spain
update: this didn't work. i have the atr appearing in its open form at the correct time, but it doesnt disappear based on date and the closed version doesn't show at all
1634681898719.png



perhaps my code is still wrong? i kind of just copied what i had before / you told me ...


Code:
<?xml version="1.0" encoding="utf-8" ?>
<ModelInfo version="1.1" guid="{a7e57515-27c1-4a27-80b3-fd22a273cd5d}">
    <LODS>
        <LOD MinSize="10" ModelFile="ATR72.gltf"/>
    </LODS>
</ModelInfo>



<ModelBehaviors>
        <Component ID="ATR72" Node="ATR72">
            <Visibility>
                <Parameter>
                    <Code>(E:LOCAL YEAR, Number) 2007 &gt;= (E:LOCAL YEAR, Number) 2025 &lt;= (E:LOCAL TIME, Seconds) 18000 &gt;= (E:LOCAL TIME, Seconds) 81600 &lt;= and and if{ 1 } els{ 0 }</Code>
                </Parameter>
            </Visibility>
        </Component>

        <Component ID="ATR72_closed" Node="ATR72_closed">
            <Visibility>
                <Parameter>
                    <Code>(E:LOCAL YEAR, Number) 2007 &gt;= (E:LOCAL YEAR, Number) 2025 &lt;= (E:LOCAL TIME, Seconds) 81601 &gt;= (E:LOCAL TIME, Seconds) 17999 &lt;= and and if{ 1 } els{ 0 }</Code>
                </Parameter>
            </Visibility>
        </Component>



</ModelBehaviors>
Show your code.

Code:
(E:LOCAL TIME, seconds) &lt; [5am in seconds]  (E:LOCAL TIME, seconds) &gt; [10pm in seconds] (E:LOCAL YEAR, Number) 2007 &gt;= (E:LOCAL YEAR, Number) 2025 &lt;= and and || if{ 1 } els{ 0 }

Change the time in seconds to the time in seconds. This should work for between 10pm and 5am visible. Because it's reverse polish notation the || (or operator) works on the first two conditions. Then the second "and" makes it true when the year condition is also true.

A more natural way of writing this would be:

Code:
( (E:LOCAL TIME, seconds) &lt; [5am in seconds]  || (E:LOCAL TIME, seconds) &gt; [10pm in seconds] ) and ( (E:LOCAL YEAR, Number) 2007 &gt;= and (E:LOCAL YEAR, Number) 2025 &lt;= ) if{ 1 } els{ 0 }

But that's not how reverse polish notation works.
 
Messages
1,053
Country
australia
Yes, your code is wrong. You need 3 "and" in the first condition as you are comparing 4 conditions and all 4 of those conditions need to be compared so it's condition 1 AND condition 2 AND condition 3 AND condition 4 which is 3 "and" to compare 4 conditions. You would write this as "and and and" instead of "and and"
'
In your second condition you need "|| and and " . || is the OR operator. As you are comparing the times and seeing if one OR the other is correct (if the time is later than 10pm OR earlier than 5pm). So you check if the time of day is one OR the other AND the year is greater than 2007 AND the year is less than 2025 so you would write this as "|| and and"
 
Top