Class GraphContext
Namespace: ValveResourceFormat.Animation
Assembly: ValveResourceFormat.dll
The state shared by the nodes of a graph during an update.
public sealed class GraphContextInheritance
object ← GraphContext
Properties
BoneCount
Gets the number of bones in a pose of this graph.
public int BoneCount { get; }Property Value
int
BoneMaskPool
Scratch buffers for bone mask task list evaluation.
public BoneMaskPool BoneMaskPool { get; }Property Value
BranchState
Whether the nodes being updated are on the active branch of their state machine.
public BranchState BranchState { get; }Property Value
DeltaTime
Seconds advanced by the current update.
public float DeltaTime { get; }Property Value
float
Graph
The graph this context evaluates.
public AnimationGraph Graph { get; }Property Value
IsInLayer
public bool IsInLayer { get; set; }Property Value
bool
LayerContext
public LayerContext LayerContext { get; set; }Property Value
Pose
The pose produced by the previous graph update, used to resolve bone targets.
public Pose Pose { get; }Property Value
SampledEvents
The events sampled during the current graph update.
public SampledEventsBuffer SampledEvents { get; }Property Value
Skeleton
The graph library's view of the graph's skeleton (reference pose, bone masks).
public Skeleton Skeleton { get; }Property Value
UpdateID
Incremented once per graph update; used by nodes to evaluate at most once per frame.
public uint UpdateID { get; }Property Value
uint
WorldTransform
The character's world transform for the current update.
public FrameBone WorldTransform { get; }Property Value
WorldTransformInverse
The inverse of GraphContext.WorldTransform.
public FrameBone WorldTransformInverse { get; }Property Value
Methods
CreateCachedPose()
public int CreateCachedPose()Returns
int
DestroyCachedPose(int)
public void DestroyCachedPose(int id)Parameters
id int
GetCachedPoseBuffer(int)
public FrameBone[] GetCachedPoseBuffer(int id)Parameters
id int
Returns
GetDefaultPose()
The pose standing in for a source that produced none: the zero pose inside an additive layer, the reference pose otherwise.
public FrameBone[] GetDefaultPose()Returns
GetReferencedGraph(short)
Resolves a referenced graph slot index to the instantiated child graph, if any.
public AnimationGraph? GetReferencedGraph(short referencedGraphIdx)Parameters
referencedGraphIdx short
Returns
IsValidCachedPose(int)
public bool IsValidCachedPose(int id)Parameters
id int
Returns
bool
LogNodeNotImplemented(short, string)
Logs, once per node type, that a value node has no implementation yet and evaluates to a default value, so a single unported node degrades the graph instead of killing it.
public void LogNodeNotImplemented(short nodeIdx, string typeName)Parameters
nodeIdx short
typeName string
LogWarning<T>(short, string, T)
Logs a warning with a detail value, formatting it only the first time it is logged.
public void LogWarning<T>(short nodeIdx, string message, T detail)Parameters
nodeIdx short
message string
detail T
Type Parameters
T
LogWarning(short, string)
Logs a warning for a node, once per distinct message.
public void LogWarning(short nodeIdx, string message)Parameters
nodeIdx short
message string
RecordClipSample(GraphClip, float)
Records a clip sample when the update is recording them.
public void RecordClipSample(GraphClip clip, float percentageThrough)Parameters
clip GraphClip
percentageThrough float
RentPoseBuffer()
public FrameBone[] RentPoseBuffer()Returns
ReturnPoseBuffer(FrameBone[])
public void ReturnPoseBuffer(FrameBone[] buffer)Parameters
buffer FrameBone[]
SetNodeFromIndex<T>(short, ref T)
Resolves a node index of the definition to the node instance.
public void SetNodeFromIndex<T>(short childNodeIdx, ref T childNode) where T : GraphNodeParameters
childNodeIdx short
childNode T
Type Parameters
T
SetNodesFromIndexArray<T>(short[], ref T[])
Resolves an array of node indices to the node instances.
public void SetNodesFromIndexArray<T>(short[] childNodeIndices, ref T[] childNodes) where T : GraphNodeParameters
childNodeIndices short[]
childNodes T[]
Type Parameters
T
SetOptionalNodeFromIndex<T>(short, ref T?)
Resolves a node index that may be unset (-1) to the node instance.
public void SetOptionalNodeFromIndex<T>(short childNodeIdx, ref T? childNode) where T : GraphNodeParameters
childNodeIdx short
childNode T?
Type Parameters
T

