.. include:: ../../../_includes/_warning_banner.rst Properties ========== The following tags can be defined in a model XML file. General Properties ------------------ These tags can be used at the top level of a model XML file. They must be children of the root ```` tag. Main model ^^^^^^^^^^ These tags define the main 3D model loaded by this model XML file. ```` .. code-block:: xml path/to/model/file Path to a model file to load. Can be a 3D model (AC3D or GlTF), or another model XML file. .. _model-xml-offsets: ```` .. code-block:: xml 0 0 0 0 0 0 Translates and rotates the model. The coordinate system used is ``x`` backwards, ``y`` right, ``z`` up. ```` FlightGear will look for textures for this model in this directory. Others ^^^^^^ ```` .. code-block:: xml ... ... Nasal code to be run when this model is loaded or unloaded respectively. Within this code, the ``cmdarg()`` function returns the model :doc:`property-root` .. hint:: To stop nasal code from interfering with XML syntax, enclose it in a ```` block: .. code-block:: xml ```` .. code-block:: xml value When this model is loaded for a multiplayer aircraft, everything under this tag will be added to FlightGear property tree under the model :doc:`property-root`. .. _model-xml-model-tag: Secondary models ---------------- The ```` tag is used to define a secondary model. There can be any number of them. **Example:** .. code-block:: xml path/to/model/file.xml pilot -3 It contains the following: ```` Path to a model file to load. Can be a 3D model (AC3D or GlTF), or another model XML file. ```` Name for this secondary model. It can be used to apply animations to the entire secondary model. ```` .. versionadded:: 2024.2 Name of parent to which this secondary model will be attached. Any offsets or animation on the parent will affect this model. ```` Offsets for this model only. Same syntax as for the :ref:`main model `. When a parent is specified with ````, offsets are relative to the parent position. ```` If the file specified by ```` is a model XML file, the content of ```` is added to this file. Combined with ``alias`` attributes, this can be used to make models with parameters: https://wiki.flightgear.org/Howto:Model_with_parameters ```` Only show this secondary model when this condition holds. See :doc:`../condition/index` for the syntax. ``interior`` Only the value ``interior`` is recognised. Depending on settings, a model marked as ``interior`` may not be loaded for AI or multiplayer models, to help with performance. Special objects --------------- Tags ````, ````, and ```` each define a kind of special object. See the following resources regarding their syntax: ```` https://wiki.flightgear.org/Compositor#Lights ```` https://wiki.flightgear.org/OSG_Text ```` .. warning:: ```` is currently non-functional in FlightGear 2024.2 `FGDATA/Docs/README.xmlparticles `__ They use following common tags: ```` Name for this object. It can be used to apply animations. ```` .. versionadded:: 2024.2 Name of parent to which this object will be attached, same as in secondary models. ```` This tag is *only* used by ```` and ````. Translation and rotation offsets for this object. Same syntax as for the :ref:`main model `. When a parent is specified with ````, offsets are relative to the parent position. ```` This tag is *only* used by ````, as a substitute for ```` (for translations). .. code-block:: xml 0 0 0 The coordinate system used is ``x`` backwards, ``y`` right, ``z`` up. ```` This tag is *only* used by ````, as a substitute for ```` (for rotations). There are three possible ways to specify the light direction: * With angles (similar to ````): .. code-block:: xml 0 0 0 * As a vector: .. code-block:: xml -1 0 0 * By pointing towards a specific position. .. code-block:: xml -1 0 0 Animations ---------- Objects can be animated with ````, taking properties as input. **Example:** .. code-block:: xml rotate Rudder surface-positions/rudder-pos-norm 30 1 The following tags are shared by all animations: ```` Type of animation, e.g. 'select', 'translate', 'rotate', etc. ```` Name of the object to which this animation applies. Many ```` can be defined for a single animation. ```` When this is false, the animation will stop moving/updating. See :doc:`../condition/index` for the syntax. .. caution:: When the condition is false, the animation does *not* return to its initial position. The remaining parameters depend on the type of animation. See https://wiki.flightgear.org/Howto:Animate_models for a detailed list of animation types and their parameters. Effects ------- Effects can change the way an object is rendered. **Example:** .. code-block:: xml Effects/model-transparent glass The following tags are enough to apply an already existing effect to the model: ```` Name of the effect to apply, as defined under ```` in the effect file. This is *not* the path to the effect file, although it is common to use the same name for the file and the effect. ```` Name of the object to which to this effect applies. Many ```` can be defined for a single effect. See `FGDATA/Docs/README.effects `__ for the full syntax of effects. .. caution:: Effects are disabled for GlTF models.