<?xml version="1.0" encoding="UTF-8" ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:simpleType name="g_hyphen">
        <xs:restriction base="xs:string">
            <xs:pattern value="-"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="g_float_or_hyphen">
        <xs:union memberTypes="xs:float g_hyphen"/>
    </xs:simpleType>

    <xs:simpleType name="g_vector_float">
        <xs:list itemType="g_float_or_hyphen"/>
    </xs:simpleType>

    <xs:simpleType name="g_string">
        <xs:annotation><xs:appinfo><typeStr>String</typeStr></xs:appinfo></xs:annotation>
        <xs:restriction base="xs:string"/>
    </xs:simpleType>

    <xs:simpleType name="g_l10n_string">
        <xs:annotation><xs:appinfo><typeStr>String or l10n key</typeStr></xs:appinfo></xs:annotation>
        <xs:restriction base="xs:string"/>
    </xs:simpleType>

    <xs:simpleType name="g_float">
        <xs:annotation><xs:appinfo><typeStr>Float</typeStr></xs:appinfo></xs:annotation>
        <xs:restriction base="xs:float"/>
    </xs:simpleType>

    <xs:simpleType name="g_angle">
        <xs:annotation><xs:appinfo><typeStr>Angle</typeStr></xs:appinfo></xs:annotation>
        <xs:restriction base="xs:float"/>
    </xs:simpleType>

    <xs:simpleType name="g_time">
        <xs:annotation><xs:appinfo><typeStr>Time in seconds</typeStr></xs:appinfo></xs:annotation>
        <xs:restriction base="xs:float"/>
    </xs:simpleType>

    <xs:simpleType name="g_int">
        <xs:annotation><xs:appinfo><typeStr>Integer</typeStr></xs:appinfo></xs:annotation>
        <xs:restriction base="xs:integer"/>
    </xs:simpleType>

    <xs:simpleType name="g_bool">
        <xs:annotation><xs:appinfo><typeStr>Boolean</typeStr></xs:appinfo></xs:annotation>
        <xs:restriction base="xs:string">
            <xs:pattern value="true|false"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="g_node_index">
        <xs:annotation><xs:appinfo><typeStr>Index to i3d node or i3d mapping identifier</typeStr></xs:appinfo></xs:annotation>
        <xs:restriction base="xs:string"/>
    </xs:simpleType>

    <xs:simpleType name="g_node_indices">
        <xs:annotation><xs:appinfo><typeStr>List of indices to i3d nodes or i3d mapping identifiers</typeStr></xs:appinfo></xs:annotation>
        <xs:restriction base="xs:string"/>
    </xs:simpleType>

    <xs:simpleType name="g_vector_2">
        <xs:annotation><xs:appinfo><typeStr>Multiple values (x, y)</typeStr></xs:appinfo></xs:annotation>
        <xs:restriction base="g_vector_float">
            <xs:pattern value="\S+ \S+"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="g_vector_3">
        <xs:annotation><xs:appinfo><typeStr>Multiple values (x, y, z)</typeStr></xs:appinfo></xs:annotation>
        <xs:restriction base="g_vector_float">
            <xs:pattern value="\S+ \S+ \S+"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="g_vector_4">
        <xs:annotation><xs:appinfo><typeStr>Multiple values (x, y, z, w)</typeStr></xs:appinfo></xs:annotation>
        <xs:restriction base="g_vector_float">
            <xs:pattern value="\S+ \S+ \S+ \S+"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="g_vector_n">
        <xs:annotation><xs:appinfo><typeStr>Multiple values</typeStr></xs:appinfo></xs:annotation>
        <xs:restriction base="g_vector_float"/>
    </xs:simpleType>

    <xs:simpleType name="g_vector_trans">
        <xs:annotation><xs:appinfo><typeStr>Translation values (x, y, z)</typeStr></xs:appinfo></xs:annotation>
        <xs:restriction base="g_vector_float">
            <xs:pattern value="\S+ \S+ \S+"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="g_vector_rot">
        <xs:annotation><xs:appinfo><typeStr>Rotation values (x, y, z)</typeStr></xs:appinfo></xs:annotation>
        <xs:restriction base="g_vector_float">
            <xs:pattern value="\S+ \S+ \S+"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="g_vector_rot_2">
        <xs:annotation><xs:appinfo><typeStr>Rotation values (x, y)</typeStr></xs:appinfo></xs:annotation>
        <xs:restriction base="g_vector_float">
            <xs:pattern value="\S+ \S+"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="g_vector_scale">
        <xs:annotation><xs:appinfo><typeStr>Scale values (x, y, z)</typeStr></xs:appinfo></xs:annotation>
        <xs:restriction base="g_vector_float">
            <xs:pattern value="\S+ \S+ \S+"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="g_color">
        <xs:annotation><xs:appinfo><typeStr>Color values (r, g, b) or brand color id</typeStr></xs:appinfo></xs:annotation>
        <xs:restriction base="xs:string"/>
    </xs:simpleType>

    <xs:element name="bale">
        <xs:complexType>
            <xs:all>
                <xs:element name="baleMeshes" minOccurs="0" maxOccurs="1">
                    <xs:complexType>
                        <xs:choice maxOccurs="unbounded">
                            <xs:element name="baleMesh" minOccurs="0" maxOccurs="unbounded">
                                <xs:complexType>
                                    <xs:attribute name="fillTypes" type="g_string">
                                        <xs:annotation><xs:documentation xml:lang="en">If defined this mesh is only visible if any of this fillTypes is set</xs:documentation></xs:annotation>
                                    </xs:attribute>
                                    <xs:attribute name="isTensionBeltMesh" type="g_bool" default="false">
                                        <xs:annotation><xs:documentation xml:lang="en">Defines if this mesh is detected for tension belt calculation</xs:documentation></xs:annotation>
                                    </xs:attribute>
                                    <xs:attribute name="node" type="g_node_index">
                                        <xs:annotation><xs:documentation xml:lang="en">Path to mesh node</xs:documentation></xs:annotation>
                                    </xs:attribute>
                                    <xs:attribute name="supportsWrapping" type="g_bool">
                                        <xs:annotation><xs:documentation xml:lang="en">Defines if the mesh is hidden while wrapping or not</xs:documentation></xs:annotation>
                                    </xs:attribute>
                                </xs:complexType>
                            </xs:element>
                        </xs:choice>
                    </xs:complexType>
                </xs:element>
                <xs:element name="filename" type="g_string" minOccurs="0">
                    <xs:annotation><xs:documentation xml:lang="en">Path to i3d file</xs:documentation></xs:annotation>
                </xs:element>
                <xs:element name="fillTypes" minOccurs="0" maxOccurs="1">
                    <xs:complexType>
                        <xs:choice maxOccurs="unbounded">
                            <xs:element name="fillType" minOccurs="0" maxOccurs="unbounded">
                                <xs:complexType>
                                    <xs:all>
                                        <xs:element name="alpha" minOccurs="0" maxOccurs="1">
                                            <xs:complexType>
                                                <xs:attribute name="filename" type="g_string">
                                                    <xs:annotation><xs:documentation xml:lang="en">Alpha texture to apply to all mesh nodes</xs:documentation></xs:annotation>
                                                </xs:attribute>
                                            </xs:complexType>
                                        </xs:element>
                                        <xs:element name="diffuse" minOccurs="0" maxOccurs="1">
                                            <xs:complexType>
                                                <xs:attribute name="filename" type="g_string">
                                                    <xs:annotation><xs:documentation xml:lang="en">Diffuse texture to apply to all mesh nodes</xs:documentation></xs:annotation>
                                                </xs:attribute>
                                            </xs:complexType>
                                        </xs:element>
                                        <xs:element name="fermenting" minOccurs="0" maxOccurs="1">
                                            <xs:complexType>
                                                <xs:attribute name="outputFillType" type="g_string">
                                                    <xs:annotation><xs:documentation xml:lang="en">Output fill type after fermenting</xs:documentation></xs:annotation>
                                                </xs:attribute>
                                                <xs:attribute name="requiresWrapping" type="g_bool" default="true">
                                                    <xs:annotation><xs:documentation xml:lang="en">Wrapping is required to start fermenting</xs:documentation></xs:annotation>
                                                </xs:attribute>
                                                <xs:attribute name="time" type="g_float" default="1">
                                                    <xs:annotation><xs:documentation xml:lang="en">Fermenting time in ingame days which represent months</xs:documentation></xs:annotation>
                                                </xs:attribute>
                                            </xs:complexType>
                                        </xs:element>
                                        <xs:element name="normal" minOccurs="0" maxOccurs="1">
                                            <xs:complexType>
                                                <xs:attribute name="filename" type="g_string">
                                                    <xs:annotation><xs:documentation xml:lang="en">Normal texture to apply to all mesh nodes</xs:documentation></xs:annotation>
                                                </xs:attribute>
                                            </xs:complexType>
                                        </xs:element>
                                        <xs:element name="specular" minOccurs="0" maxOccurs="1">
                                            <xs:complexType>
                                                <xs:attribute name="filename" type="g_string">
                                                    <xs:annotation><xs:documentation xml:lang="en">Specular texture to apply to all mesh nodes</xs:documentation></xs:annotation>
                                                </xs:attribute>
                                            </xs:complexType>
                                        </xs:element>
                                    </xs:all>
                                    <xs:attribute name="capacity" type="g_float">
                                        <xs:annotation><xs:documentation xml:lang="en">Fill level of bale with this fill type</xs:documentation></xs:annotation>
                                    </xs:attribute>
                                    <xs:attribute name="forceAcceleration" type="g_float">
                                        <xs:annotation><xs:documentation xml:lang="en">Force acceleration value of bale with this fill type</xs:documentation></xs:annotation>
                                    </xs:attribute>
                                    <xs:attribute name="mass" type="g_float" default="500">
                                        <xs:annotation><xs:documentation xml:lang="en">Mass of bale with this fill type</xs:documentation></xs:annotation>
                                    </xs:attribute>
                                    <xs:attribute name="name" type="g_string">
                                        <xs:annotation><xs:documentation xml:lang="en">Name of fill type</xs:documentation></xs:annotation>
                                    </xs:attribute>
                                    <xs:attribute name="supportsWrapping" type="g_bool">
                                        <xs:annotation><xs:documentation xml:lang="en">Wrapping is allowed while this type is used</xs:documentation></xs:annotation>
                                    </xs:attribute>
                                </xs:complexType>
                            </xs:element>
                        </xs:choice>
                    </xs:complexType>
                </xs:element>
                <xs:element name="mountableObject" minOccurs="0" maxOccurs="1">
                    <xs:complexType>
                        <xs:attribute name="axisFreeX" type="g_bool" default="false">
                            <xs:annotation><xs:documentation xml:lang="en">Joint is free in X direction</xs:documentation></xs:annotation>
                        </xs:attribute>
                        <xs:attribute name="axisFreeY" type="g_bool" default="false">
                            <xs:annotation><xs:documentation xml:lang="en">Joint is free in Y direction</xs:documentation></xs:annotation>
                        </xs:attribute>
                        <xs:attribute name="forceAcceleration" type="g_float" default="4">
                            <xs:annotation><xs:documentation xml:lang="en">Acceleration force</xs:documentation></xs:annotation>
                        </xs:attribute>
                        <xs:attribute name="forceLimitScale" type="g_float" default="1">
                            <xs:annotation><xs:documentation xml:lang="en">Force limit scale</xs:documentation></xs:annotation>
                        </xs:attribute>
                        <xs:attribute name="triggerNode" type="g_node_index">
                            <xs:annotation><xs:documentation xml:lang="en">Trigger node</xs:documentation></xs:annotation>
                        </xs:attribute>
                    </xs:complexType>
                </xs:element>
                <xs:element name="packedBale" minOccurs="0" maxOccurs="1">
                    <xs:complexType>
                        <xs:choice maxOccurs="unbounded">
                            <xs:element name="singleBale" minOccurs="0" maxOccurs="unbounded">
                                <xs:complexType>
                                    <xs:attribute name="node" type="g_node_index">
                                        <xs:annotation><xs:documentation xml:lang="en">Single bale spawn node</xs:documentation></xs:annotation>
                                    </xs:attribute>
                                </xs:complexType>
                            </xs:element>
                        </xs:choice>
                        <xs:attribute name="singleBale" type="g_string">
                            <xs:annotation><xs:documentation xml:lang="en">Path to single bale xml filename</xs:documentation></xs:annotation>
                        </xs:attribute>
                    </xs:complexType>
                </xs:element>
                <xs:element name="parentFile" minOccurs="0" maxOccurs="1">
                    <xs:complexType>
                        <xs:all>
                            <xs:element name="attributes" minOccurs="0" maxOccurs="1">
                                <xs:complexType>
                                    <xs:choice maxOccurs="unbounded">
                                        <xs:element name="clearList" minOccurs="0" maxOccurs="unbounded">
                                            <xs:complexType>
                                                <xs:attribute name="keepIndex" type="g_int">
                                                    <xs:annotation><xs:documentation xml:lang="en">Index of list to keep</xs:documentation></xs:annotation>
                                                </xs:attribute>
                                                <xs:attribute name="path" type="g_string">
                                                    <xs:annotation><xs:documentation xml:lang="en">List to clear but keep one item</xs:documentation></xs:annotation>
                                                </xs:attribute>
                                            </xs:complexType>
                                        </xs:element>
                                        <xs:element name="remove" minOccurs="0" maxOccurs="unbounded">
                                            <xs:complexType>
                                                <xs:attribute name="path" type="g_string">
                                                    <xs:annotation><xs:documentation xml:lang="en">Path to remove from parent xml</xs:documentation></xs:annotation>
                                                </xs:attribute>
                                            </xs:complexType>
                                        </xs:element>
                                        <xs:element name="set" minOccurs="0" maxOccurs="unbounded">
                                            <xs:complexType>
                                                <xs:attribute name="path" type="g_string">
                                                    <xs:annotation><xs:documentation xml:lang="en">Path change in parent xml</xs:documentation></xs:annotation>
                                                </xs:attribute>
                                                <xs:attribute name="value" type="g_string">
                                                    <xs:annotation><xs:documentation xml:lang="en">Target value to set in parent file</xs:documentation></xs:annotation>
                                                </xs:attribute>
                                            </xs:complexType>
                                        </xs:element>
                                    </xs:choice>
                                </xs:complexType>
                            </xs:element>
                        </xs:all>
                        <xs:attribute name="xmlFilename" type="g_string">
                            <xs:annotation><xs:documentation xml:lang="en">Remove vehicle if unit empty</xs:documentation></xs:annotation>
                        </xs:attribute>
                    </xs:complexType>
                </xs:element>
                <xs:element name="size" minOccurs="0" maxOccurs="1">
                    <xs:complexType>
                        <xs:attribute name="diameter" type="g_float" default="0">
                            <xs:annotation><xs:documentation xml:lang="en">Bale Diameter</xs:documentation></xs:annotation>
                        </xs:attribute>
                        <xs:attribute name="height" type="g_float" default="0">
                            <xs:annotation><xs:documentation xml:lang="en">Bale Height</xs:documentation></xs:annotation>
                        </xs:attribute>
                        <xs:attribute name="isRoundbale" type="g_bool" default="true">
                            <xs:annotation><xs:documentation xml:lang="en">Bale is a roundbale</xs:documentation></xs:annotation>
                        </xs:attribute>
                        <xs:attribute name="length" type="g_float" default="0">
                            <xs:annotation><xs:documentation xml:lang="en">Bale Length</xs:documentation></xs:annotation>
                        </xs:attribute>
                        <xs:attribute name="maxStackHeight" type="g_int">
                            <xs:annotation><xs:documentation xml:lang="en">Max. stack height for automatic spawning of bales</xs:documentation></xs:annotation>
                        </xs:attribute>
                        <xs:attribute name="visualDiameter" type="g_float">
                            <xs:annotation><xs:documentation xml:lang="en">Bale Diameter (Real size of the visuals if different)</xs:documentation></xs:annotation>
                        </xs:attribute>
                        <xs:attribute name="visualHeight" type="g_float">
                            <xs:annotation><xs:documentation xml:lang="en">Bale Height (Real size of the visuals if different)</xs:documentation></xs:annotation>
                        </xs:attribute>
                        <xs:attribute name="visualLength" type="g_float">
                            <xs:annotation><xs:documentation xml:lang="en">Bale Length (Real size of the visuals if different)</xs:documentation></xs:annotation>
                        </xs:attribute>
                        <xs:attribute name="visualWidth" type="g_float">
                            <xs:annotation><xs:documentation xml:lang="en">Bale Width (Real size of the visuals if different)</xs:documentation></xs:annotation>
                        </xs:attribute>
                        <xs:attribute name="width" type="g_float" default="0">
                            <xs:annotation><xs:documentation xml:lang="en">Bale Width</xs:documentation></xs:annotation>
                        </xs:attribute>
                    </xs:complexType>
                </xs:element>
                <xs:element name="uvId" type="g_string" minOccurs="0">
                    <xs:annotation><xs:documentation xml:lang="en">Specify that this bale model has a custom UV. This will result in baleWrapper to replace the bale if the UV is different to the defined one in the baleWrapper. So the baleWrapper will always use a bale with a UV that matches the wrapping texture.</xs:documentation></xs:annotation>
                </xs:element>
            </xs:all>
        </xs:complexType>
    </xs:element>
</xs:schema>
