Class FlexStateManager
Namespace: ValveResourceFormat.Renderer
Assembly: Renderer.dll
Manages flex controller state and morph target composition for facial animation.
public class FlexStateManagerInheritance
Constructors
FlexStateManager(RendererContext, Morph)
Initializes a new flex state manager for the given morph data.
public FlexStateManager(RendererContext renderContext, Morph morph)Parameters
renderContext RendererContext
The renderer context used to create GPU resources.
morph Morph
The morph data containing flex controllers and rules.
Properties
MorphComposite
Gets the morph composite that renders blended morph targets to the GPU.
public MorphComposite MorphComposite { get; }Property Value
Methods
EvaluateMorph(int)
Evaluates the flex rule for the specified morph target using current controller values.
public float EvaluateMorph(int morphId)Parameters
morphId int
Morph target identifier.
Returns
The computed morph weight.
ResetControllers()
Resets all flex controller values to zero.
public void ResetControllers()SetControllerValue(int, float)
Sets a single flex controller value, clamped to its defined range.
public bool SetControllerValue(int id, float value)Parameters
id int
Index of the flex controller.
value float
Desired value before clamping.
Returns
true if the value changed; otherwise false.
SetControllerValues(float[])
Sets multiple flex controller values in order, stopping at whichever array is shorter.
public bool SetControllerValues(float[] datas)Parameters
datas float[]
Array of controller values to apply.
Returns
true if any value changed; otherwise false.
UpdateComposite()
Evaluates all morph rules and pushes the resulting weights to the morph composite.
public void UpdateComposite()
