# Sandbox.Animation.GraphBuilder

Provides the ability to generate [Sandbox.Animation.Graph](/api/Sandbox.Animation.Graph)s at runtime.
A new instance of this class is available at [Sandbox.Animation.Graph.Builder](/api/Sandbox.Animation.Graph/Builder).

## Examples

```csharp
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 );
```

- Kind: class
- Namespace: `Sandbox.Animation`
- Assembly: `Sandbox.Engine`
- Modifiers: sealed

## Constructors

- [`GraphBuilder`](/api/Sandbox.Animation.GraphBuilder/.ctor)

## Properties

- [`Skeleton`](/api/Sandbox.Animation.GraphBuilder/Skeleton): Resource path of the skeleton the graph's clips are authored against. A graph without one can't bind its clips, so nothing it plays will pose the model. This is a path rather than a [Sandbox.Animation.Skeleton](/api/Sandbox.Animation.Skeleton) because graphs are often built off the main thread, where resources can't be loaded.

## Methods

- [`Abs`](/api/Sandbox.Animation.GraphBuilder/Abs): The absolute value of `input`.
- [`Add`](/api/Sandbox.Animation.GraphBuilder/Add): a + b
- [`AddControlParameter`](/api/Sandbox.Animation.GraphBuilder/AddControlParameter): Add a control parameter of any kind, settable by name at runtime. Prefer the typed helpers ([Sandbox.Animation.GraphBuilder.FloatParameter](/api/Sandbox.Animation.GraphBuilder/FloatParameter), [Sandbox.Animation.GraphBuilder.BoolParameter](/api/Sandbox.Animation.GraphBuilder/BoolParameter) and friends).
- [`AimAt`](/api/Sandbox.Animation.GraphBuilder/AimAt)
- [`And`](/api/Sandbox.Animation.GraphBuilder/And): True when all conditions are true.
- [`AngleMath`](/api/Sandbox.Animation.GraphBuilder/AngleMath): Normalize an angle (in degrees) with the given `operation`.
- [`BindVirtualParameter`](/api/Sandbox.Animation.GraphBuilder/BindVirtualParameter): Bind an existing node as a named virtual parameter.
- [`Blend`](/api/Sandbox.Animation.GraphBuilder/Blend): Blend between two nodes. A weight of 0 plays `source`, 1 plays `target`.
- [`BlendSpace`](/api/Sandbox.Animation.GraphBuilder/BlendSpace): 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`](/api/Sandbox.Animation.GraphBuilder/BlendSpace2D): 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`](/api/Sandbox.Animation.GraphBuilder/BoneMask): One of the skeleton's authored bone masks, by name.
- [`BoneMaskBlend`](/api/Sandbox.Animation.GraphBuilder/BoneMaskBlend): Blend between two bone masks. A weight of 0 uses `source`, 1 uses `target`.
- [`BoneMaskSelector`](/api/Sandbox.Animation.GraphBuilder/BoneMaskSelector)
- [`BoneMaskSwitch`](/api/Sandbox.Animation.GraphBuilder/BoneMaskSwitch): Select between two bone masks based on a bool `condition`, optionally blending when it changes.
- [`BoneTarget`](/api/Sandbox.Animation.GraphBuilder/BoneTarget): Add a constant target that refers to a character bone rather than a fixed transform.
- [`BoolParameter`](/api/Sandbox.Animation.GraphBuilder/BoolParameter): Add a bool control parameter, settable by name at runtime.
- [`Cached`](/api/Sandbox.Animation.GraphBuilder/Cached): Latch a value from `source` - 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`](/api/Sandbox.Animation.GraphBuilder/Ceiling): The smallest integer not less than `input`.
- [`Clamp`](/api/Sandbox.Animation.GraphBuilder/Clamp): Clamp `input` to [`min`, `max`].
- [`Clip`](/api/Sandbox.Animation.GraphBuilder/Clip): Play an animation clip, by resource path.
- [`ClipSelector`](/api/Sandbox.Animation.GraphBuilder/ClipSelector)
- [`ClipVariation`](/api/Sandbox.Animation.GraphBuilder/ClipVariation)
- [`Compare`](/api/Sandbox.Animation.GraphBuilder/Compare): True when `input` compares against `comparand` using `comparison`.
- [`Compile`](/api/Sandbox.SandboxToolExtensions/Compile)
- [`Constant`](/api/Sandbox.Animation.GraphBuilder/Constant): Add a constant float value.
- [`ConstantId`](/api/Sandbox.Animation.GraphBuilder/ConstantId): Add a constant ID (tag) value, matched by name against events, selectors and comparisons.
- [`ConstantTarget`](/api/Sandbox.Animation.GraphBuilder/ConstantTarget): Add a constant, always-set target holding a fixed position and rotation.
- [`Create`](/api/Sandbox.Animation.GraphBuilder/Create): Creates an animation graph with `root` producing the final pose.
- [`CurrentSyncEvent`](/api/Sandbox.Animation.GraphBuilder/CurrentSyncEvent): 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`](/api/Sandbox.Animation.GraphBuilder/CurrentSyncEventId): The ID of the source state's current sync event. Only meaningful as a state-machine transition condition.
- [`Curve`](/api/Sandbox.Animation.GraphBuilder/Curve)
- [`CurveEvent`](/api/Sandbox.Animation.GraphBuilder/CurveEvent): Samples the curve from float curve events on the currently playing animations, returning the curve value at the event's current percentage-through.
- [`Divide`](/api/Sandbox.Animation.GraphBuilder/Divide): a / b
- [`DurationScale`](/api/Sandbox.Animation.GraphBuilder/DurationScale): 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`](/api/Sandbox.Animation.GraphBuilder/Ease): Ease towards `input` over time whenever it changes, smoothing out sudden value jumps.
- [`ExternalGraphSlot`](/api/Sandbox.Animation.GraphBuilder/ExternalGraphSlot): An empty child-graph slot filled at runtime by native integration using `slotName`. Plays `fallback` (or nothing) while empty.
- [`ExternalPose`](/api/Sandbox.Animation.GraphBuilder/ExternalPose): A pose slot filled by native integration before evaluation. Managed runtime pose assignment is not currently exposed.
- [`FloatMath`](/api/Sandbox.Animation.GraphBuilder/FloatMath)
- [`FloatParameter`](/api/Sandbox.Animation.GraphBuilder/FloatParameter): Add a float control parameter, settable by name at runtime. Provide `min` < `max` to describe a bounded range for tools.
- [`FloatSelector`](/api/Sandbox.Animation.GraphBuilder/FloatSelector)
- [`Floor`](/api/Sandbox.Animation.GraphBuilder/Floor): The largest integer not greater than `input`.
- [`FootIK`](/api/Sandbox.Animation.GraphBuilder/FootIK): 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`](/api/Sandbox.Animation.GraphBuilder/FootstepCondition): True while the currently sampled animations are in the given [Sandbox.Animation.GraphBuilder.FootPhase](/api/Sandbox.Animation.GraphBuilder.FootPhase) - e.g. gate a transition so it's only taken when a specific foot is planted.
- [`FootstepEventId`](/api/Sandbox.Animation.GraphBuilder/FootstepEventId): The sync event ID carried by the highest-priority sampled foot event.
- [`FootstepPercentage`](/api/Sandbox.Animation.GraphBuilder/FootstepPercentage): The percentage (0-1) through the currently sampled foot event of the given [Sandbox.Animation.GraphBuilder.FootPhase](/api/Sandbox.Animation.GraphBuilder.FootPhase), or -1 when none matches.
- [`Fraction`](/api/Sandbox.Animation.GraphBuilder/Fraction): The fractional part of `input`.
- [`GetResourceReferences`](/api/Sandbox.SandboxToolExtensions/GetResourceReferences)
- [`GraphEventCondition`](/api/Sandbox.Animation.GraphBuilder/GraphEventCondition)
- [`IdBasedClipSelector`](/api/Sandbox.Animation.GraphBuilder/IdBasedClipSelector)
- [`IdBasedSelector`](/api/Sandbox.Animation.GraphBuilder/IdBasedSelector)
- [`IdCompare`](/api/Sandbox.Animation.GraphBuilder/IdCompare)
- [`IdEvent`](/api/Sandbox.Animation.GraphBuilder/IdEvent): The ID of the highest-priority sampled ID animation event, or `defaultValue` when none qualifies.
- [`IdEventCondition`](/api/Sandbox.Animation.GraphBuilder/IdEventCondition)
- [`IdEventPercentage`](/api/Sandbox.Animation.GraphBuilder/IdEventPercentage): The percentage (0-1) through the sampled ID animation event matching `eventId`, or -1 when none is sampled.
- [`IdParameter`](/api/Sandbox.Animation.GraphBuilder/IdParameter): Add an ID (tag) control parameter, settable by name at runtime. IDs are matched by name against events, selectors and comparisons. Optionally list the `options` this parameter is expected to take, for tools.
- [`IdSelect`](/api/Sandbox.Animation.GraphBuilder/IdSelect)
- [`IdSwitch`](/api/Sandbox.Animation.GraphBuilder/IdSwitch): Select between two ID values based on a bool `condition`.
- [`IdToFloat`](/api/Sandbox.Animation.GraphBuilder/IdToFloat)
- [`InRange`](/api/Sandbox.Animation.GraphBuilder/InRange): True when `input` is within [`min`, `max`].
- [`IsExternalGraphSlotFilled`](/api/Sandbox.Animation.GraphBuilder/IsExternalGraphSlotFilled): True while the given [Sandbox.Animation.GraphBuilder.ExternalGraphSlot](/api/Sandbox.Animation.GraphBuilder/ExternalGraphSlot) has a child graph connected.
- [`IsTargetSet`](/api/Sandbox.Animation.GraphBuilder/IsTargetSet): True while the given target is set.
- [`Layers`](/api/Sandbox.Animation.GraphBuilder/Layers): 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](/api/Sandbox.Animation.GraphBuilder.Node) is expected.
- [`LookAt`](/api/Sandbox.Animation.GraphBuilder/LookAt)
- [`Modulo`](/api/Sandbox.Animation.GraphBuilder/Modulo): a modulo b
- [`Multiply`](/api/Sandbox.Animation.GraphBuilder/Multiply): a * b
- [`Negate`](/api/Sandbox.Animation.GraphBuilder/Negate): -input
- [`Not`](/api/Sandbox.Animation.GraphBuilder/Not): Invert a bool value.
- [`NullTarget`](/api/Sandbox.Animation.GraphBuilder/NullTarget)
- [`Or`](/api/Sandbox.Animation.GraphBuilder/Or): True when any condition is true.
- [`OrientationWarp`](/api/Sandbox.Animation.GraphBuilder/OrientationWarp): Redirect an animation clip's root-motion facing toward a character-space `target` - either a direction (a vector node) or an angle offset in degrees (a float node). Uses an orientation warp event on the clip.
- [`ParameterizedSelector`](/api/Sandbox.Animation.GraphBuilder/ParameterizedSelector)
- [`Passthrough`](/api/Sandbox.Animation.GraphBuilder/Passthrough): Pass a child pose through unchanged. Occasionally useful as an explicit graph node.
- [`Pose`](/api/Sandbox.Animation.GraphBuilder/Pose): Sample a single pose from an animation at a fixed time driven by `time`, 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`](/api/Sandbox.Animation.GraphBuilder/RandomFloat): Sample a uniform random value each time this node is initialized, holding it until shutdown.
- [`ReferencedGraph`](/api/Sandbox.Animation.GraphBuilder/ReferencedGraph): Embed another animation graph asset as a child graph. Its control parameters are reflected from this graph by matching name. Plays `fallback` (or nothing) while the child graph is unavailable.
- [`ReferencePose`](/api/Sandbox.Animation.GraphBuilder/ReferencePose): The skeleton's reference (bind) pose.
- [`Remap`](/api/Sandbox.Animation.GraphBuilder/Remap): Remap `input` from one range to another, clamped to the output range.
- [`RootMotionOverride`](/api/Sandbox.Animation.GraphBuilder/RootMotionOverride): 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`](/api/Sandbox.Animation.GraphBuilder/Scale): 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`](/api/Sandbox.Animation.GraphBuilder/Selector): 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`](/api/Sandbox.Animation.GraphBuilder/SpeedScale): Scale the playback speed of a node.
- [`Spring`](/api/Sandbox.Animation.GraphBuilder/Spring): Smoothly track `input` with a damped spring - useful for damping noisy inputs like velocity before they drive a blend space.
- [`StateCompletedCondition`](/api/Sandbox.Animation.GraphBuilder/StateCompletedCondition)
- [`StateMachine`](/api/Sandbox.Animation.GraphBuilder/StateMachine): Add a state machine. Add states wrapping pose nodes, wire them together with transitions, then use it anywhere a [Sandbox.Animation.GraphBuilder.Node](/api/Sandbox.Animation.GraphBuilder.Node) is expected. The first state added is the default state.
- [`Subtract`](/api/Sandbox.Animation.GraphBuilder/Subtract): a - b
- [`Switch`](/api/Sandbox.Animation.GraphBuilder/Switch): Select between two float values based on a bool `condition`.
- [`SyncEventCondition`](/api/Sandbox.Animation.GraphBuilder/SyncEventCondition): True when the source state's current sync event index matches `syncEventIndex`. Only meaningful as a state-machine transition condition.
- [`TargetInfo`](/api/Sandbox.Animation.GraphBuilder/TargetInfo): Extract a scalar from a target - an angle, distance, or delta orientation.
- [`TargetOffset`](/api/Sandbox.Animation.GraphBuilder/TargetOffset): Apply a rotation and translation offset to a target.
- [`TargetParameter`](/api/Sandbox.Animation.GraphBuilder/TargetParameter): Add a target control parameter - a transform in space, settable by name at runtime. Used as input to IK and warp nodes.
- [`TargetPoint`](/api/Sandbox.Animation.GraphBuilder/TargetPoint): Extract the translation of a target as a vector.
- [`TargetSelector`](/api/Sandbox.Animation.GraphBuilder/TargetSelector)
- [`TargetWarp`](/api/Sandbox.Animation.GraphBuilder/TargetWarp): Warp an animation clip's root motion so it reaches a world-space `target`, using target-warp events authored on the clip.
- [`TimeCondition`](/api/Sandbox.Animation.GraphBuilder/TimeCondition)
- [`TimeControlledClip`](/api/Sandbox.Animation.GraphBuilder/TimeControlledClip): Play an animation whose playback time is driven directly by `time` (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`](/api/Sandbox.Animation.GraphBuilder/TransitionEventCondition): Tests sampled transition animation events against a permission rule, optionally filtering by a specific marker ID.
- [`TriangulateBlendSpace`](/api/Sandbox.Animation.GraphBuilder/TriangulateBlendSpace)
- [`TwoBoneIK`](/api/Sandbox.Animation.GraphBuilder/TwoBoneIK): 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`](/api/Sandbox.Animation.GraphBuilder/UnsetTarget): Add a constant unset target - the "no target" value, useful as a switch or selector fallback.
- [`Variation`](/api/Sandbox.Animation.GraphBuilder/Variation): 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`](/api/Sandbox.Animation.GraphBuilder/VectorCreate): Build a vector from float components. Any omitted component falls back to the matching component of `baseVector` (or zero when it too is omitted).
- [`VectorInfo`](/api/Sandbox.Animation.GraphBuilder/VectorInfo): Extract a scalar from a vector - a component, its length, or an angle.
- [`VectorNegate`](/api/Sandbox.Animation.GraphBuilder/VectorNegate): Negate a vector.
- [`VectorParameter`](/api/Sandbox.Animation.GraphBuilder/VectorParameter): Add a vector control parameter, settable by name at runtime.
- [`VelocityBlend`](/api/Sandbox.Animation.GraphBuilder/VelocityBlend): 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`](/api/Sandbox.Animation.GraphBuilder/VelocityScale): 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`](/api/Sandbox.Animation.GraphBuilder/VirtualBoneMaskParameter)
- [`VirtualBoolParameter`](/api/Sandbox.Animation.GraphBuilder/VirtualBoolParameter): Name a computed bool value as a virtual parameter. Unlike a control parameter it is not set externally - it evaluates `value` each frame - but it can be reflected into referenced child graphs by name.
- [`VirtualFloatParameter`](/api/Sandbox.Animation.GraphBuilder/VirtualFloatParameter)
- [`VirtualIdParameter`](/api/Sandbox.Animation.GraphBuilder/VirtualIdParameter)
- [`VirtualTargetParameter`](/api/Sandbox.Animation.GraphBuilder/VirtualTargetParameter)
- [`VirtualVectorParameter`](/api/Sandbox.Animation.GraphBuilder/VirtualVectorParameter)
- [`ZeroPose`](/api/Sandbox.Animation.GraphBuilder/ZeroPose): A pose with every bone at identity - the "zero" pose, useful as an additive base.
