LIVERY XML Examples
The examples on this page are all taken from the livery.xml
file of a modular SimObject. This file goes in the model folder of a part of a livery and is used to define the LOD properties for the model part, as well as any dynamic elements. LOD setup is explained on the LOD Selection System page, and so here we will show examples of the setup of the different types of dynamic materials.
Adaptive Text Example
The following XML is an example of how adaptive text is set up (note that the material uses the "language_code" label key, and so will be translated based on the contents of the <text>.lbl
file):
<?xml version="1.0" encoding="UTF-8"?>
<ModelInfo version="1.0" guid="<!-- GUID HERE -->">
<LODS>
<!-- LOD DATA HERE -->
</LODS>
<DynamicMaterial>
<MatName>Custom_Text_00</MatName>
<Type>Text</Type>
<TextureSize Width="1024" Height="100" />
<TextLayer>
<Line>
<Content>Special Air Service</Content>
<FontFamily>Roboto</FontFamily>
<MacStyle Bold="true" Italic="false" Underline="false"/>
<FontSize Value="AUTO" Unit="px"/>
<Color>#111111</Color>
<Alignement>center</Alignement>
<StrokeColor>#dddddd</StrokeColor>
<StrokeWidth Value="10" Unit="px"/>
<LetterSpacing Value="5" Unit="px"/>
</Line>
</TextLayer>
<Labels>
<Label Key="Category" Value="ActivityName"/>
<Label Key="Activity" Value="TOR"/>
<Label Key="language_code"/>
</Labels>
</DynamicMaterial>
</ModelInfo>
Adaptive Texture Example
The following XML is an example of how adaptive textures are set up, where the final image will be selected based on the labels from a <texture>.lbl
file:
<?xml version="1.0" encoding="UTF-8"?>
<ModelInfo version="1.0" guid="<!-- GUID HERE -->">
<LODS>
<!-- LOD DATA HERE -->
</LODS>
<DynamicMaterial>
<MatName>CUSTOM_Image_00</MatName>
<EnforcePlayerCompany>EnforceLogo</EnforcePlayerCompany>
<Type>Texture</Type>
<Labels>
<Label Key="Category" Value="Logo"/>
<Label Key="Activity" Value="AEA"/>
</Labels>
</DynamicMaterial>
<DynamicMaterial>
<MatName>CUSTOM_Image_01</MatName>
<Type>Texture</Type>
<Labels>
<Label Key="Category" Value="Sticker"/>
<Label Key="Activity" Value="AEA"/>
<Label Key="Format" Value="2x1"/>
<Label Key="Country" Value="Any"/>
</Labels>
</DynamicMaterial>
</ModelInfo>
Adaptive Material Example
The following XML is an example of how adaptive materials are set up, where the final material will be selected based on matching labels within the <material>.lbl
file:
<?xml version="1.0" encoding="UTF-8"?>
<ModelInfo version="1.0" guid="<!-- GUID HERE -->">
<LODS>
<!-- LOD DATA HERE -->
</LODS>
<DynamicMaterial>
<MatName>Mat_Livery_1</MatName>
<Type>Material</Type>
<Labels>
<Label Key="Category" Value="Material"/>
<Label Key="Country" Value="Any"/>
</Labels>
</DynamicMaterial>
<DynamicMaterial>
<MatName>Mat_Livery_2</MatName>
<Type>Material</Type>
<Labels>
<Label Key="Category" Value="Material"/>
<Label Key="Country" Value="Any"/>
</Labels>
</DynamicMaterial>
</ModelInfo>
Adaptive Palette Example
The following XML is an example of how adaptive color palettes are set up, where the first is simply finding a palette from the <palette>.lbl
file based on the associated labels, and the second is defining random colours:
<?xml version="1.0" encoding="UTF-8"?>
<ModelInfo version="1.0" guid="<!-- GUID HERE -->">
<LODS>
<!-- LOD DATA HERE -->
</LODS>
<DynamicMaterial>
<MatName>Flag_01</MatName>
<Type>Color</Type>
<PaletteId>1</PaletterId
<Labels>
<Label Key="Category" Value="Palette"/>
<Label Key="Country" Value="Any"/>
</Labels>
</DynamicMaterial>
<DynamicMaterial>
<MatName>Fuselage_1</MatName>
<Type>Color</Type>
<RandomColors>
<color>#278d12</color>
<color>#1f8557</color>
<color>#e7468e</color>
<color>#ea713a</color>
<color>#a6eb72</color>
<RandomColors>
<Labels>
<Label Key="Category" Value="Palette"/>
<Label Key="Activity" Value="FEF"/>
</Labels>
</DynamicMaterial>
</ModelInfo>