# Blend Shapes

## Overview

The Blend Shapes Component  controls the blend shapes of a skinned mesh..just like the [SkinnedMeshRenderer ](https://docs.unity3d.com/Manual/class-SkinnedMeshRenderer.html)component does. but you don't have to search for the mesh deep in the hierarchy.

![Sample of the BlendShapes component](/files/-M7TqpgaC2rje9sfCroj)

![Blend Shapes inside the SkinnedMeshRenderer Component.](/files/-M7TrxIbSqUhotx5UPs9)

![Blend Shapes inside the SkinnedMeshRenderer Component.](/files/-M7TrxIbSqUhotx5UPs9)

Also you can load/save[ **Blend Shape Presets**](/animal-controller/utilities/blend-shapes/blend-shape-preset.md) to have different variations.

## Parameters

### Mesh

Reference to the skinned mesh renderer.

### LODs

Extra meshes that share the same Blendshapes, like LODs meshes or the Magic Tattoos on the Poly Art Animals:

![The "magic" mesh also changes with the mesh of the wolf](/files/-M7TwgqirotM2Ieo3njL)

### Pin Blend Shape&#x20;

![](/files/-M7U55u4CMmzILbyjk-5)

The Pin blendshape is the value stored to be used with Unity Events, since this unity Events cannot have more than one value on its listeners.

![](/files/-M7TzOkRJFVQG5Vnv-Wr)

E.g. : In the first Listener we Store/Pin Blend Shape (the first one, with index=0) and on the second Listener we change the value of tha stored/pinned blend shape with the Slider value of the UI component.

***You can check how to use the Pin Shape on the Callback Sample scenes of each Animal.***

### Blend Shape Weight List

![](/files/-M7U5WntkNn4FmI1Ruke)

List of all the Blend shapes weights of the skinned mesh renderer. Each Blendshape have a label for its Index. E.g.: (00) is the **Index** for the Blend Shape Big Eyes on the Wolf.

### Preset

The[ **Blend Shape Preset**](/animal-controller/utilities/blend-shapes/blend-shape-preset.md) is simply an array of float values to save/load the Blend shapes you have modified.

### Load Preset

If the **Preset** parameter has a preset set, then At start the component this preset will be loaded.

### Random

At Start this component will generate random blend shape weights.&#x20;

## Editor Buttons

![](/files/-M7U6C414Aet-8Ym9X3r)

### Reset

Reset all the weights of the blendshapes to zero.

### Randomize

Randomize all the weights of the blendshapes&#x20;

### Save

Save the current blend shapes to a preset.

### Load

Load a blend preset.

## Public Methods

### `float[] GetBlendShapeValues()`

> Gets an array of all the blendshape weights on the skinned mesh renderer.

### `void LoadSmoothPreset(BlendShapePreset preset)`

> Blends from the current blend shapes weights to the weights of the preset.

### `void LoadPreset()`

> Load the weights from the preset stored on the [**Preset** ](/animal-controller/utilities/blend-shapes.md#preset)parameter.

### `LoadPreset(BlendShapePreset preset)`

> Load the weights from the preset.

### `void SavePreset()`

> Save the current blendshape weights to the preset on the [**Preset** ](/animal-controller/utilities/blend-shapes.md#preset)parameter.

### `void Randomize()`

> Randomize the weights on the skinned mesh and its LODs

### `void SetWeight(string name, float value)`

> Set a new weight on a blendshape using its name

### `void SetWeight(int index, float value)`

> Set a new weight on a blendshape using its index

### `void _PinShape(string name)`

> Store/Pin a blend shape by its name

### `void _PinShape(int index)`

> Store/Pin a blend shape by its Index

### `_PinnedShapeSetValue(float value)`

> Set a new weight on the Stored/Pinned blend shape

### `void UpdateBlendShapes()`

> Updates all the weights of the component to the Skinned mesh renderer


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://malbersanimations.gitbook.io/animal-controller/utilities/blend-shapes.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
