# IWeaponViewModel interface

> The owner's view model for the weapon a holder holds, which the weapon changes while it's out: an ammo counter on the model, a glow as it heats, a stock that folds out. Each change reaches the owner's client with the body's state and lasts until it's changed again or the weapon is put away, when the view model goes back to how its viewmodel record draws it.

Namespace `EvilEngine.Api.Weapons`, assembly `EvilEngine.Api`. Engine commit 4ff877b1.

```csharp
public interface IWeaponViewModel
```

The owner's view model for the weapon a [holder](/docs/api/iweaponholder) holds, which the weapon changes while it's out: an ammo counter on the model, a glow as it heats, a stock that folds out. Each change reaches the owner's client with the body's state and lasts until it's changed again or the weapon is put away, when the view model goes back to how its `viewmodel` record draws it.

## Members

### Skin (property)

```csharp
int? Skin { get; set; }
```

The skin the stack's driving part draws, the model that plays the weapon's animations, or `null` for the record's own. Below 0, it throws.

### Stack (property)

```csharp
ContentId? Stack { get; set; }
```

A `viewmodel` record drawn in place of the weapon's own stack, or `null` for its own. The new stack shows as soon as it's built, with no lowering and raising, and plays from its idle, so an [Animate](/docs/api/iweaponholder#animate) on the same tick plays on the new stack.

```csharp
holder.ViewModel.Stack = ContentId.Parse("mygun:viewmodel/unfolded");
holder.Animate("unfold");
```

### Hidden (property)

```csharp
bool Hidden { get; set; }
```

Whether the view model is hidden, as a scope's view hides it.

### Body (method)

```csharp
void Body(string group, int? choice)
```

Picks a choice of a body group by its name on every part whose model has it, or `null` for the part's own. Names match whatever their case. Below 0, it throws.

```csharp
holder.ViewModel.Body("counter", holder.Clip);
```

### Pose (method)

```csharp
void Pose(string parameter, double? value)
```

Sets a pose parameter by name, or `null` for 0. The parameter drives every blend a part's animations name it in, as a Source model's pose parameters do.
