Examples

var builder = Graph.Builder;

var speed = builder.FloatParameter( "speed" );
var blend = builder.Blend( builder.Clip( "idle" ), builder.Clip( "run" ), speed );

var graph = builder.Create( blend );

build Constructors 1

functions Methods 110

Abs (input)
Node
The absolute value of .
Add (a, b)
Node
a + b
AddControlParameter (name, kind, settings)
Node
Add a control parameter of any kind, settable by name at runtime. Prefer the typed helpers (Sandbox.Animation.GraphBuilder.FloatParameter(System.String,System.Single,System.Single), Sandbox.Animation.GraphBuilder.BoolParameter(System.String) and friends).
AimAt (child, worldTarget)
Node
And (conditions)
Node
True when all conditions are true.
AngleMath (input, operation)
Node
Normalize an angle (in degrees) with the given .
BindVirtualParameter (name, value)
Bind an existing node as a named virtual parameter.
Blend (source, target, weight)
Node
Blend between two nodes. A weight of 0 plays , 1 plays .
BlendSpace (parameter, looping)
BlendSpaceBuilder
Blend between any number of nodes placed along a parameter axis - a 1D blend space. The parameter value picks the two neighbouring entries and blends between them, e.g. idle at 0, walk at 100, run at 300, driven by movement speed.
BlendSpace2D (parameterX, parameterY, looping)
BlendSpace2DBuilder
Blend between nodes placed on a 2D parameter plane - a 2D blend space, e.g. directional locomotion clips positioned by the velocity they're authored at. The points are triangulated at build time; the parameter picks the enclosing triangle and blends its three corners.
BoneMask (maskName)
Node
One of the skeleton's authored bone masks, by name.
BoneMaskBlend (source, target, weight)
Node
Blend between two bone masks. A weight of 0 uses , 1 uses .
BoneMaskSelector (id, defaultMask, options, settings)
Node
BoneMaskSwitch (condition, whenTrue, whenFalse, settings)
Node
Select between two bone masks based on a bool , optionally blending when it changes.
BoneTarget (boneName)
Node
Add a constant target that refers to a character bone rather than a fixed transform.
BoolParameter (name)
Node
Add a bool control parameter, settable by name at runtime.
Cached (source, cacheOnInit)
Node
Latch a value from - by default once when this node starts (cache-on-init), otherwise once when its branch deactivates (cache-on-exit). Works with bool, float, ID, vector and target values.
Ceiling (input)
Node
The smallest integer not less than .
Clamp (input, min, max)
Node
Clamp to [, ].
Clip (animation, settings)
Node
Play an animation clip, by resource path.
ClipSelector (cases)
Node
ClipVariation (seed, options)
Node
Compare (input, comparison, comparand, epsilon)
Node
True when compares against using .
Constant (value)
Node
Add a constant float value.
ConstantId (value)
Node
Add a constant ID (tag) value, matched by name against events, selectors and comparisons.
ConstantTarget (position, rotation)
Node
Add a constant, always-set target holding a fixed position and rotation.
Create (root, name)
Graph
Creates an animation graph with producing the final pose.
CurrentSyncEvent (sourceState, info)
Node
The source state's current sync position, as an event index, a percentage through that event, or both. Only meaningful as a state-machine transition condition.
CurrentSyncEventId (sourceState)
Node
The ID of the source state's current sync event. Only meaningful as a state-machine transition condition.
Curve (input, points)
Node
CurveEvent (settings)
Node
Samples the curve from float curve events on the currently playing animations, returning the curve value at the event's current percentage-through.
Divide (a, b)
Node
a / b
DurationScale (child, duration)
Node
Scale the playback speed of a node so it plays over a desired duration, e.g. stretching a reload animation to match the weapon's reload time.
Ease (input, settings)
Node
Ease towards over time whenever it changes, smoothing out sudden value jumps.
ExternalGraphSlot (slotName, fallback)
Node
An empty child-graph slot filled at runtime by native integration using . Plays (or nothing) while empty.
ExternalPose (slotName)
Node
A pose slot filled by native integration before evaluation. Managed runtime pose assignment is not currently exposed.
FloatMath (operation, a, settings)
Node
FloatParameter (name, min, max)
Node
Add a float control parameter, settable by name at runtime. Provide < to describe a bounded range for tools.
FloatSelector (cases, defaultValue, easeTime, easing)
Node
Floor (input)
Node
The largest integer not greater than .
FootIK (child, leftFootBone, rightFootBone, settings)
Node
Two-bone IK applied to the left and right foot bones with independent targets, falling back to solving only one foot when a single target is provided.
FootstepCondition (phase, settings)
Node
True while the currently sampled animations are in the given Sandbox.Animation.GraphBuilder.FootPhase - e.g. gate a transition so it's only taken when a specific foot is planted.
FootstepEventId (priority, settings)
Node
The sync event ID carried by the highest-priority sampled foot event.
FootstepPercentage (phase, priority, settings)
Node
The percentage (0-1) through the currently sampled foot event of the given Sandbox.Animation.GraphBuilder.FootPhase, or -1 when none matches.
Fraction (input)
Node
The fractional part of .
GraphEventCondition (conditions, match, settings)
Node
IdBasedClipSelector (id, options, fallback)
Node
IdBasedSelector (id, options, fallback)
Node
IdCompare (id, matchIds, mustMatch)
Node
IdEvent (defaultValue, priority, settings)
Node
The ID of the highest-priority sampled ID animation event, or when none qualifies.
IdEventCondition (eventIds, match, search, settings)
Node
IdEventPercentage (eventId, priority, settings)
Node
The percentage (0-1) through the sampled ID animation event matching , or -1 when none is sampled.
IdParameter (name, options)
Node
Add an ID (tag) control parameter, settable by name at runtime. IDs are matched by name against events, selectors and comparisons. Optionally list the this parameter is expected to take, for tools.
IdSelect (cases, defaultValue)
Node
IdSwitch (condition, whenTrue, whenFalse)
Node
Select between two ID values based on a bool .
IdToFloat (id, mapping, defaultValue)
Node
InRange (input, min, max, inclusive)
Node
True when is within [, ].
IsExternalGraphSlotFilled (externalGraphSlot)
Node
True while the given Sandbox.Animation.GraphBuilder.ExternalGraphSlot(System.String,Sandbox.Animation.GraphBuilder.Node) has a child graph connected.
IsTargetSet (target)
Node
True while the given target is set.
Layers (baseNode)
LayersBuilder
Stack animation layers on top of a base pose, each optionally weighted and masked to part of the skeleton - e.g. an upper-body action layered over locomotion. Add layers, then use it anywhere a Sandbox.Animation.GraphBuilder.Node is expected.
LookAt (child, pitch, yaw, settings)
Node
Modulo (a, b)
Node
a modulo b
Multiply (a, b)
Node
a * b
Negate (input)
Node
-input
Not (value)
Node
Invert a bool value.
NullTarget ()
Node
Or (conditions)
Node
True when any condition is true.
OrientationWarp (clip, target, relativeToCharacter, samplingMode, alignmentMode)
Node
Redirect an animation clip's root-motion facing toward a character-space - either a direction (a vector node) or an angle offset in degrees (a float node). Uses an orientation warp event on the clip.
ParameterizedSelector (parameter, options, settings)
Node
Passthrough (child)
Node
Pass a child pose through unchanged. Occasionally useful as an explicit graph node.
Pose (animation, time)
Node
Sample a single pose from an animation at a fixed time driven by , normalized 0-1 across the clip - e.g. scrubbing a pose-sheet animation where every frame is a distinct pose, like the citizen's hand poses.
RandomFloat (min, max)
Node
Sample a uniform random value each time this node is initialized, holding it until shutdown.
ReferencedGraph (graphPath, fallback)
Node
Embed another animation graph asset as a child graph. Its control parameters are reflected from this graph by matching name. Plays (or nothing) while the child graph is unavailable.
ReferencePose ()
Node
The skeleton's reference (bind) pose.
Remap (input, inputRange, outputRange)
Node
Remap from one range to another, clamped to the output range.
RootMotionOverride (child, settings)
Node
Replace a pose's root motion with a desired character-space movement velocity, facing direction, or both - e.g. driving movement from gameplay values instead of the authored root motion.
Scale (child, boneMask, enabled)
Node
Apply a bone mask as a per-bone scale on top of a child pose - the mask weight becomes the scale factor for each bone.
Selector ()
SelectorBuilder
Select between pose nodes by condition, evaluated once when the node starts playing - e.g. on state entry. Plays the first option whose condition is true, falling back to the first option.
SpeedScale (child, speed)
Node
Scale the playback speed of a node.
Spring (input, settings)
Node
Smoothly track with a damped spring - useful for damping noisy inputs like velocity before they drive a blend space.
StateCompletedCondition (sourceState, transitionDuration, transitionDurationOverride)
Node
StateMachine ()
StateMachineBuilder
Add a state machine. Add states wrapping pose nodes, wire them together with transitions, then use it anywhere a Sandbox.Animation.GraphBuilder.Node is expected. The first state added is the default state.
Subtract (a, b)
Node
a - b
Switch (condition, whenTrue, whenFalse)
Node
Select between two float values based on a bool .
SyncEventCondition (sourceState, syncEventIndex, trigger)
Node
True when the source state's current sync event index matches . Only meaningful as a state-machine transition condition.
TargetInfo (target, info, worldSpace)
Node
Extract a scalar from a target - an angle, distance, or delta orientation.
TargetOffset (target, translationOffset, rotationOffset, boneSpace, translation)
Node
Apply a rotation and translation offset to a target.
TargetParameter (name)
Node
Add a target control parameter - a transform in space, settable by name at runtime. Used as input to IK and warp nodes.
TargetPoint (target, worldSpace)
Node
Extract the translation of a target as a vector.
TargetSelector (target, clips, settings)
Node
TargetWarp (clip, target, settings)
Node
Warp an animation clip's root motion so it reaches a world-space , using target-warp events authored on the clip.
TimeCondition (sourceState, settings)
Node
TimeControlledClip (animation, time, settings)
Node
Play an animation whose playback time is driven directly by (normalized 0-1 across the clip) instead of advancing with the graph - e.g. scrubbing a full clip from a gameplay value. Ignores synchronization.
TransitionEventCondition (rule, markerId, settings)
Node
Tests sampled transition animation events against a permission rule, optionally filtering by a specific marker ID.
TwoBoneIK (child, effectorBone, target, settings)
Node
Analytical two bone IK - rotates the effector bone's two parents (e.g. shoulder and elbow) so the effector reaches the target, and aligns the effector to the target's rotation.
UnsetTarget ()
Node
Add a constant unset target - the "no target" value, useful as a switch or selector fallback.
Variation (seed)
VariationBuilder
Pick one of several pose nodes by weighted selection, seeded from a float parameter and evaluated once when the node starts playing - e.g. random clip variation on state entry, driven by a parameter fed a new value each time.
VectorCreate (x, y, z, baseVector)
Node
Build a vector from float components. Any omitted component falls back to the matching component of (or zero when it too is omitted).
VectorInfo (vector, info)
Node
Extract a scalar from a vector - a component, its length, or an angle.
VectorNegate (vector)
Node
Negate a vector.
VectorParameter (name)
Node
Add a vector control parameter, settable by name at runtime.
VelocityBlend (speed, clips)
Node
Play an animation scaled to move at a desired velocity, blending several clips by the speeds baked into their root motion - the runtime derives each clip's position on the axis from its average velocity.
VelocityScale (animation, desiredVelocity, looping)
Node
Play an animation scaled to move at a desired velocity, using the average root motion velocity baked into the clip - e.g. matching a walk cycle's playback to the actual movement speed so the feet never slide.
VirtualBoneMaskParameter (name, value)
Node
VirtualBoolParameter (name, value)
Node
Name a computed bool value as a virtual parameter. Unlike a control parameter it is not set externally - it evaluates each frame - but it can be reflected into referenced child graphs by name.
VirtualFloatParameter (name, value)
Node
VirtualIdParameter (name, value)
Node
VirtualTargetParameter (name, value)
Node
VirtualVectorParameter (name, value)
Node
ZeroPose ()
Node
A pose with every bone at identity - the "zero" pose, useful as an additive base.
people
Log in to reply
You can't reply if you're not logged in. That would be crazy.