API Reference · Skinning and morph targets
MorphShapes
public sealed class MorphShapesThe morph targets of a loaded model, addressed by name, with opposed pairs folded into one signed parameter each.
Why the folding. A character creator exports its sliders as pairs — eye_large and eye_small, build_heavy and build_slim — because a morph target can only add. Handed to a caller raw that is two independent 0..1 weights with a meaningless state in the middle where both are 1, and every consumer writes the same clamping code. Detected as a pair it is one number from −1 to 1 that cannot be set wrong.
The folding is a convenience over the raw weights and never a replacement: MorphShapes.Weights still reaches every target by its own name, and a pair the heuristic does not recognise simply appears as two parameters instead of one.
Properties
| Member | Description |
|---|---|
| A parameter's value. −1 to 1 for a detected pair, 0 to 1 otherwise; not clamped, because a caller overshooting a shape deliberately is a thing character creators do and clamping cannot be undone. |
| Every parameter name, in the order the targets were added. |
| Every parameter, as something a UI can lay out: a name, a range and a default. Built once, on first use, because pairing cannot know what is paired until every target is in. Adding a target after this has been read starts the set again rather than leaving it stale. |
| Every morph target by its own name, unfolded — the escape hatch from the pairing. |
Methods
| Member | Description |
|---|---|
| Registers one morph target of one mesh node under a name. The same name may be added for several nodes — a mesh split into two primitives shares its target names across both, and setting the parameter writes to all of them, which is what makes one slider reshape a head and the eyes in it together.
|
| Whether a parameter by this name exists. |
| Puts every parameter back to what the file said. |