---
Product: Aspose.3D
Platform: net
Page Type: docs
Canonical URL: https://docs.aspose.org/3d/net/developer-guide/deformers
---

# Working with Deformers

Apply skeletal and morph-target deformations to meshes in Aspose.3D for .NET — binding bones to vertices with SkinDeformer, defining morph targets with MorphTargetDeformer, and controlling blend weights at runtime.

## Overview

Aspose.3D for .NET supports two deformation systems: **skeletal deformation** via `SkinDeformer` and `Bone`, which bind a skeleton to a mesh for character animation, and **morph target deformation** via `MorphTargetDeformer`, which blends between multiple mesh shapes.

---

### Skeletal Deformation with SkinDeformer

A `SkinDeformer` attaches a set of `Bone` objects to a mesh. Each bone defines a weight for every vertex it influences. The mesh deforms when the bone transforms change.

```csharp
using Aspose.ThreeD;
using Aspose.ThreeD.Deformers;
using Aspose.ThreeD.Entities;

var scene = new Scene();
var mesh = new Mesh("body");
Node meshNode = scene.RootNode.CreateChildNode("body", mesh);

// Create a SkinDeformer and attach it to the mesh
var skin = new SkinDeformer();
mesh.Deformers.Add(skin);

// Define a bone and assign per-vertex weights
var bone = new Bone("spine");
bone.BoneTransform = Matrix4.Identity;
bone.SetWeight(0, 1.0);
bone.SetWeight(1, 0.8);
skin.Bones.Add(bone);
```

> Vertex indices passed to `SetWeight` must be valid indices in the mesh's control-points array. Weights are typically normalized so they sum to 1.0 across all bones influencing a vertex.

---

### Morph Target Deformation

`MorphTargetDeformer` blends the base mesh toward one or more target shapes. Each target is a separate mesh with the same topology but different vertex positions.

```csharp
using Aspose.ThreeD;
using Aspose.ThreeD.Deformers;
using Aspose.ThreeD.Entities;

var scene = new Scene();
var baseMesh = new Mesh("face_neutral");
scene.RootNode.CreateChildNode("face", baseMesh);

// Target shape
var smileMesh = new Shape("face_smile");

// Attach a MorphTargetDeformer
var morph = new MorphTargetDeformer();
baseMesh.Deformers.Add(morph);

// Add a morph channel targeting the smile mesh
var smileChannel = new MorphTargetChannel("smile");
smileChannel.Targets.Add(smileMesh);
morph.Channels.Add(smileChannel);

// At runtime, set the blend weight (0.0 = base, 1.0 = full target)
smileChannel.SetWeight(smileMesh, 0.75);
```

---

### API Quick Reference

| Member | Description |
|---|---|
| `new SkinDeformer()` | Create a skeletal deformer to attach to a mesh |
| `skin.Bones` | `IList<Bone>` of bones in this deformer |
| `new Bone(name)` | Create a named bone |
| `bone.SetWeight(vertexIndex, weight)` | Assign a blend weight to a vertex |
| `bone.BoneTransform` | Bind-pose offset matrix for this bone |
| `new MorphTargetDeformer()` | Create a morph target deformer |
| `morph.Channels` | `IList<MorphTargetChannel>` of blend channels |
| `new MorphTargetChannel(name)` | Create a named morph channel |
| `channel.ChannelWeight` | Blend weight: 0.0 = base, 1.0 = target |
| `channel.SetWeight(target, weight)` | Sets the blend weight for a target shape (`target`: `Shape`, `weight`: `double`) |
| `mesh.Deformers` | Collection of deformers on a mesh |

## See Also

- [Aspose.3D for .NET — Enterprise Documentation](https://docs.aspose.com/3d/net/)
- [Working with Scene Entities](scene-entities) — attach deformers to scene nodes