Table of Contents

Class ModelMorphSettings

Namespace
Stride.Engine
Assembly
Stride.Engine.dll

The authored morph settings of a ModelComponent: whether morph targets apply, and their weights by name.

[DataContract]
public sealed class ModelMorphSettings
Inheritance
object
ModelMorphSettings
Extension Methods

Remarks

These are saved with the component. The rendered (runtime) weights start from them and can be changed by scripts and animation without changing these; see Morphs.

Constructors

ModelMorphSettings()

Creates settings with morphs enabled and no authored weight, so every target starts at 0.

public ModelMorphSettings()

Properties

Enabled

Whether the morph weights are applied to the meshes. When disabled, the meshes keep their base shape (skinning still applies) and the authored and runtime weights are kept, so enabling again restores the shape.

[DataMember(10)]
public bool Enabled { get; set; }

Property Value

bool

Weights

The authored weight of each morph target, by target name. A target missing from the dictionary has weight 0, and a name the model doesn't have is ignored.

[DataMember(30)]
[Display("Weights", null, Expand = ExpandRule.Once)]
public TrackingDictionary<string, float> Weights { get; set; }

Property Value

TrackingDictionary<string, float>

Remarks

Weights are not clamped: any finite value is allowed. These weights replace all runtime weights when the model binds, and on the next frame after this dictionary is replaced or one of its items is added, changed or removed. To drive weights from a script every frame, use SetMorphWeight(int, float) instead, which changes the runtime weights only.