- Messages
- 21
- Country
Tks
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.
Ok, that's my hagar xml file which I placed in the SimObjects sub folder of my project so it has a sim.cfg and a model.xml that's also contained in the zip file:
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 :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">
<?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>
<?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 < and if{ 0 } els{ 1 }
</Code>
</Parameter>
</Visibility>
</Component>
</ModelBehaviors>
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...<Component ID="Strahler" Node="Spot">
Try to give both the same name as the node in Blender/3DSMax has.
<Component ID="SpotLight" Node="SpotLight">
<?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>
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.Didn't work but I changed the parent child relation that was missing and try it again now with name="SpotNight"
<?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 >= (E:LOCAL YEAR, Number) 2025 <= and if{ 1 } els{ 0 }</Code>
</Parameter>
</Visibility>
</Component>
<Component ID="ATR72closed" Node="ATR72closed">
<Visibility>
<Parameter>
<Code>(E:LOCAL YEAR, Number) 2007 >= (E:LOCAL YEAR, Number) 2025 <= and if{ 1 } els{ 0 }</Code>
</Parameter>
</Visibility>
</Component>
</ModelBehaviors>
Show your code.simply adding (E:LOCAL TIME, Seconds) variables to my existing code didn't work..
(E:LOCAL TIME, seconds) < [5am in seconds] (E:LOCAL TIME, seconds) > [10pm in seconds] (E:LOCAL YEAR, Number) 2007 >= (E:LOCAL YEAR, Number) 2025 <= and and || if{ 1 } els{ 0 }
( (E:LOCAL TIME, seconds) < [5am in seconds] || (E:LOCAL TIME, seconds) > [10pm in seconds] ) and ( (E:LOCAL YEAR, Number) 2007 >= and (E:LOCAL YEAR, Number) 2025 <= ) if{ 1 } els{ 0 }
<?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 >= (E:LOCAL YEAR, Number) 2025 <= (E:LOCAL TIME, Seconds) 18000 >= (E:LOCAL TIME, Seconds) 81600 <= 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 >= (E:LOCAL YEAR, Number) 2025 <= (E:LOCAL TIME, Seconds) 81601 >= (E:LOCAL TIME, Seconds) 17999 <= and and if{ 1 } els{ 0 }</Code>
</Parameter>
</Visibility>
</Component>
</ModelBehaviors>
Show your code.
Code:(E:LOCAL TIME, seconds) < [5am in seconds] (E:LOCAL TIME, seconds) > [10pm in seconds] (E:LOCAL YEAR, Number) 2007 >= (E:LOCAL YEAR, Number) 2025 <= 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) < [5am in seconds] || (E:LOCAL TIME, seconds) > [10pm in seconds] ) and ( (E:LOCAL YEAR, Number) 2007 >= and (E:LOCAL YEAR, Number) 2025 <= ) if{ 1 } els{ 0 }
But that's not how reverse polish notation works.