Class AnimationController
Namespace: ValveResourceFormat.Renderer
Assembly: Renderer.dll
Manages skeletal animation playback and computes animated bone poses.
public class AnimationController : BaseAnimationControllerInheritance
object ← BaseAnimationController ← AnimationController
Inherited Members
BaseAnimationController.Skeleton, BaseAnimationController.BindPose, BaseAnimationController.InverseBindPose, BaseAnimationController.Pose, BaseAnimationController.Update(float), BaseAnimationController.GetBoneMatricesRecursive(Bone, Matrix4x4, Frame?, Span<Matrix4x4>), BaseAnimationController.GetInverseBindPoseRecursive(Bone, Matrix4x4, Span<Matrix4x4>), BaseAnimationController.GetSkinningMatrices(Span<Matrix4x4>)
Constructors
AnimationController(Skeleton, FlexController[])
Initializes a new for the given skeleton and flex controllers, computing the bind pose and inverse bind pose matrices.
public AnimationController(Skeleton skeleton, FlexController[] flexControllers)Parameters
skeleton Skeleton
The skeleton whose bones define the rig.
flexControllers FlexController[]
The flex controllers used for facial/morph animation.
Properties
ActiveAnimation
Gets the currently active animation, or null if none is set.
public Animation? ActiveAnimation { get; }Property Value
AnimationFrame
Gets the decoded animation frame data for the current tick, or null when no animation is active.
public Frame? AnimationFrame { get; }Property Value
CurrentSubController
The current sub animation controller that is driving animation updates.
public AnimationController.SubController? CurrentSubController { get; }Property Value
AnimationController.SubController?
ExternalSkeletons
Gets the collection of external skeletons registered for sub-animation control, indexed by skeleton name.
public Dictionary<string, AnimationController.SubController> ExternalSkeletons { get; }Property Value
Dictionary<string, AnimationController.SubController>
Frame
Gets or sets the current frame index of the active animation.
public int Frame { get; set; }Property Value
FrameCache
Gets the frame cache used to retrieve and interpolate animation frames.
public AnimationFrameCache FrameCache { get; }Property Value
FrametimeMultiplier
Gets or sets the playback speed multiplier applied to the animation timestep.
public float FrametimeMultiplier { get; set; }Property Value
IsPaused
Gets or sets whether animation playback is paused. Setting to false forces an immediate pose update.
public bool IsPaused { get; set; }Property Value
Time
Gets the current playback time in seconds.
public float Time { get; }Property Value
Methods
GetFrame()
Returns the animation frame for the current time, using exact frame lookup when paused or interpolation during playback.
public Frame? GetFrame()Returns
The current animation frame, or null if no animation is active.
PauseLastFrame()
Pauses playback and seeks to the last frame of the active animation.
public void PauseLastFrame()RegisterExternalSkeleton(string, Skeleton)
Registers an external skeleton for sub-animation control, creating a bone remapping table.
public void RegisterExternalSkeleton(string skeletonName, Skeleton skeleton)Parameters
skeletonName string
The name identifying the external skeleton.
skeleton Skeleton
The external skeleton to register.
RegisterUpdateHandler(Action<Animation?, int>)
Registers a callback invoked each time the animation frame changes, receiving the active animation and frame index.
public void RegisterUpdateHandler(Action<Animation?, int> handler)Parameters
handler Action<Animation?, int>
The callback to invoke on each animation update.
SetAnimation(Animation?)
Sets the active animation, resets playback to frame zero, and clears the frame cache.
public void SetAnimation(Animation? animation)Parameters
animation Animation?
The animation to activate, or null to clear.
Update(float)
Advances the animation by timeStep seconds and recomputes bone poses.
public override bool Update(float timeStep)Parameters
timeStep float
Elapsed time in seconds since the last update.

