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.
I'm confused, you just said it's not working?No idea, so far it works like that , Im a zero when it comes to programming
HiThe code structure is slightly different in the case of 'Model Behaviours'. Firstly, the custom code for any simobject needs to go in a separate <ModelBehaviours> tag within the .XML and not within the <ModelInfo> tag. Secondly, The 'node' name is missing which defines exactly which part will use the code. Try with the attached code and see if it helps. Just replace the text in red with your required conditions. PS: I haven't tried this for visibility conditions, but it's working for other purposes and it should work here too.
XML:<ModelBehaviors> <Component ID="Any Name of your choice" Node="3ds max object name"> <Visibility> <Parameter> <Code>***Insert Code here***</Code> </Parameter> </Visibility> </Component> </ModelBehaviors>
Be aware that many things in the behaviour xml refer to a node instead the model (e.g. a specific scenegraph node or modelpart). These are not named based on the model name in MCX. MCX does number them automatically.Hi,
Sorry for my poor english, but I think that Node="3ds max object name" is not the best description in this case.
When you edit with MCX your object, you can read via the icon "Object information", two datas:
- the GUID of the object,
- the name of the object.
The name is the information to use to define the Node. => Node= "MCX object name" is more apropriate in my own opinion.
So you can use 3DS or Blender without any trouble.
Yes, that helps me indeed, thank you so much!Thank you for this!
Here is the code if you want, for example, that something is only visible between 10 and 18 o'clock every day. Maybe it helps someone
XML:<Visibility> <Parameter> <Code>(E:LOCAL TIME, Seconds) 36000 >= (E:LOCAL TIME, Seconds) 64800 <= and if{ 1 } els{ 0 }</Code> </Parameter> </Visibility>
[VERSION]
Major=1
Minor=0
[fltsim.0]
title=bfd_test
model=bfd_test
texture=
[fltsim.1]
title=bfd_test2
model=bfd_test2
texture=
[General]
category=StaticObject
<LODS>
<LOD MinSize="25" ModelFile="bfd_test.gltf"/>
<LOD MinSize="0" ModelFile="bfd_test_LOD01.gltf"/>
</LODS>
<?xml version="1.0" encoding="utf-8" ?>
<ModelInfo>
<LODS>
<LOD MinSize="70" ModelFile="Windmill.gltf"/>
<LOD MinSize="50" ModelFile="Windmill_LOD1.gltf"/>
<LOD MinSize="40" ModelFile="Windmill_LOD2.gltf"/>
<LOD MinSize="0" ModelFile="Windmill_LOD3.gltf"/>
</LODS>
<Behaviors>
<Include ModelBehaviorFile="Asobo\Misc\SimObjects.xml"/>
<Component ID="WindTurbine">
<UseTemplate Name="ASOBO_WindTurbine_Template">
</UseTemplate>
<!-- Commented until an emissive node is defined in model
<Component ID="WindTurbine_Light" Node="">
<UseTemplate Name="ASOBO_GT_Material_Emissive_Code">
<EMISSIVE_CODE>(E:SIMULATION TIME, seconds) 10 * 5 %</EMISSIVE_CODE>
</UseTemplate>
</Component>
-->
</Component>
</Behaviors>
</ModelInfo>
<?xml version="1.0" encoding="utf-8" ?>
<ModelInfo guid="{8861718c-071b-45bd-e444-a7f80aa54802}" version="1.1" />
<ModelBehaviors>
<Component ID="bonhomme-de-neige" Node="bonhomme-de-neige">
<Visibility>
<Parameter>
<Code>(E:LOCAL MONTH OF YEAR, Number) 4 == if{ 1 } els{ 0 }</Code>
</Parameter>
</Visibility>
</Component>
</ModelBehaviors>
This exemple adapted from my "Parasol (Open/Closed)" works very well.<?xml version="1.0" encoding="utf-8" ?>
<ModelInfo guid="{8861718c-071b-45bd-e444-a7f80aa54802}" version="1.1">
<LODS>
<LOD MinSize="0" ModelFile="bonhomme-de-neige.gltf"/>
</LODS>
</ModelInfo>
<ModelBehaviors>
<Component ID="bonhomme-de-neige" Node="bonhomme-de-neige">
<Visibility>
<Parameter>
<Code>(E:LOCAL MONTH OF YEAR, Number) 4 == if{ 1 } els{ 0 }</Code>
</Parameter>
</Visibility>
</Component>
</ModelBehaviors>
Thanks but it doesnt workTest this one:
This exemple adapted from my "Parasol (Open/Closed)" works very well.