Description
The Morphs
property provides access to the morph targets of a skinned model. Morph targets are used to create complex animations by blending different shapes of a model. This property is part of the SkinnedModelRenderer
class, which is responsible for rendering skinned models with bones and animations in the world.
Usage
To use the Morphs
property, you need to have an instance of the SkinnedModelRenderer
class. You can then access the morphs of the model through this property. This is useful for dynamically adjusting the appearance of a model at runtime by modifying its morph targets.
Example
// Assuming 'renderer' is an instance of SkinnedModelRenderer
var morphs = renderer.Morphs;
// Example: Adjust a specific morph target
morphs.SetWeight("Smile", 0.5f); // Set the weight of the 'Smile' morph target to 50%
// Example: Iterate over all morphs
foreach (var morph in morphs)
{
Console.WriteLine($"Morph Name: {morph.Name}, Weight: {morph.Weight}");
}