# Pose selection for human actor

The pose selection logic is defined in `\properties\animation_selector\`**`human_pose_selector.set`**

By default, on spawn the unit has no pose animation assigned.\
The Pose Selector triggers on the first valid match of one of four requests whose names correspond to pose types.

**Pose types:**

* `snipe` — peeking over a fence or out of a trench;
* `squat` — sitting;
* `stand` — standing;
* `lie` — lying.

For each of the four requests, the logic for selecting a specific pose is described using `if`-block conditionals.

## Pose animation set

Each human pose has three animation sets:

* aim — aiming;
* fire — recoil animation on shot;
* idle — the position from which idle animations start.

Each of the aim, fire, and idle sets may contain either a full-body animation or two separate animations for the torso (head and arms) and the pelvis (legs).

## Pose Selector configuration

To specify the animation set that corresponds to the selected pose, use the `pose` block.\
It is also possible to select an animation set by the FSM counter pose.

> **Pose Selector file template**
>
> ```
> {stand
>     {if <condition>
>         {pose
>             {aim ["<anm_aim" | "<anm_aim_down>" "<anm_aim_up>"]}
>             {fire ["<anm_fire" | "<anm_fire_down>" "<anm_fire_up>"]}
>             {idle ["<anm_idle" | "<anm_idle_down>" "<anm_idle_up>"]}
>         }
>     }
>     [...]
>     {pose [...]}
> }
> {snipe [...]}
> {squat [...]}
> {lie [...]}
> ```

Specifying animations for the **fire set** is optional; if omitted, firing is performed without a body animation.\
If only the **aim set** is defined, idle animations are taken from `aim`.\
The **idle set** alone may be defined if the pose does not allow aiming or shooting.

<details>

<summary>Example: Pose selection with specified animations</summary>

```
{pose
    {aim "pose_stand_fire_mgun_down" "pose_stand_fire_mgun_up"}
    {fire "stand_fire_mgun_down_1" "pose_stand_fire_mgun_up_1"}
    {idle }
}
```

</details>

<details>

<summary>Pose selection by FSM counter <code>pose</code></summary>

<pre><code>{switch_by_counter "pose"
    {common
        {aim "pose_stand_fire_mgun_down" "pose_stand_fire_mgun_up"}
<strong>        {fire "stand_fire_mgun_down" "stand_fire_mgun_up"}
</strong>    }
    {pick 1}
    {pick 1
        {aim "pose_stand_fire_mgun_down_1" "pose_stand_fire_mgun_up_1"}
        {fire "stand_fire_mgun_down_1" "pose_stand_fire_mgun_up_1"}
    }
    {pick 1
        {idle "pose_stand_look_around_gun_1"}
    }
    {pick 1
        {idle "pose_stand_gun_aside_2"}
    }
}
</code></pre>

</details>
