Animation
Animation, component, subscription handler, data, parameters, and playback mode docs.
Last updated
Animation, component, subscription handler, data, parameters, and playback mode docs.
Last updated
Represents a scriptable Animation node.
Gets the frame count of the animation
Syntax[Sansar.Script.Interface] public GetFrameCount ()
Returns
Returns the total number of frames in the animation.
Remarks
RequirementsNamespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0
Gets the name of the animation
SyntaxReturns
Returns the name of the animation.
Remarks
RequirementsNamespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0
Gets the last applied parameters for the animation
SyntaxReturns
Returns the current parameters.
Remarks
RequirementsNamespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0
Gets whether or not the animation is paused.
SyntaxReturns
A bool value indicating the pause state.
Remarks
RequirementsNamespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0
Jump to frame. The animation will be set to the specified frame, and paused.
SyntaxParameters
frame
Frame to jump to.
Returns
Returns an internal event id.
Remarks
RequirementsNamespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0
Jump to frame. The animation will be set to the specified frame, and paused.
SyntaxParameters
frame
Frame to jump to.
handler
Handler to be called when the event completes.
Returns
Returns an internal event id.
Remarks
RequirementsNamespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0
Jump to frame. The animation will be set to the specified frame, and paused.
SyntaxParameters
frame
Frame to jump to.
handler
Handler to be called when the event completes.
Returns
Returns an internal event id.
Remarks
RequirementsNamespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0
Pauses the animation.
SyntaxReturns
Returns an internal event id.
Remarks
RequirementsNamespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0
Pauses the animation.
SyntaxParameters
handler
Handler to be called when the event completes.
Returns
Returns an internal event id.
Remarks
RequirementsNamespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0
Pauses the animation.
SyntaxParameters
handler
Handler to be called when the event completes.
Returns
Returns an internal event id.
Remarks
RequirementsNamespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0
Plays the animation. It will become the active animation for this object, and resume playing if it is paused.
SyntaxReturns
Returns an internal event id.
Remarks
RequirementsNamespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0
Plays the animation, without changing the current animation frame.
SyntaxParameters
handler
Handler to be called when the event completes.
Returns
Returns an internal event id.
Remarks
RequirementsNamespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0
Plays the animation and applies the provided parameters.
SyntaxParameters
parameters
Animation parameters to apply.
Returns
Returns an internal event id.
Remarks
RequirementsNamespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0
Plays the animation. It will become the active animation for this object, and resume playing if it is paused.
SyntaxParameters
handler
Handler to be called when the event completes.
Returns
Returns an internal event id.
Remarks
RequirementsNamespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0
Plays the animation and applies the provided parameters.
SyntaxParameters
parameters
Animation parameters to apply.
handler
Handler to be called when the event completes.
Returns
Returns an internal event id.
Remarks
RequirementsNamespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0
Plays the animation and applies the provided parameters.
SyntaxParameters
parameters
Animation parameters to apply.
handler
Handler to be called when the event completes.
Returns
Returns an internal event id.
Remarks
RequirementsNamespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0
Resets the animation. The animation is paused and reset to frame 0 (or the RangeStartFrame if clamping is enabled).
SyntaxReturns
Returns an internal event id.
Remarks
RequirementsNamespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0
Resets the animation. The animation is paused and reset to frame 0 (or the RangeStartFrame if clamping is enabled).
SyntaxParameters
handler
Handler to be called when the event completes.
Returns
Returns an internal event id.
Remarks
RequirementsNamespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0
Resets the animation and applies the provided parameters.
SyntaxParameters
parameters
Animation parameters to apply.
Returns
Returns an internal event id.
Remarks
RequirementsNamespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0
Resets the animation. The animation is paused and reset to frame 0 (or the RangeStartFrame if clamping is enabled).
SyntaxParameters
handler
Handler to be called when the event completes.
Returns
Returns an internal event id.
Remarks
RequirementsNamespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0
Resets the animation and applies the provided parameters.
SyntaxParameters
parameters
Animation parameters to apply.
handler
Handler to be called when the event completes.
Returns
Returns an internal event id.
Remarks
RequirementsNamespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0
Resets the animation and applies the provided parameters.
SyntaxParameters
parameters
Animation parameters to apply.
handler
Handler to be called when the event completes.
Returns
Returns an internal event id.
Remarks
RequirementsNamespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0
Sets the parameters for the animation. The parameters are applied immediately.
SyntaxParameters
parameters
Animation parameters to apply.
Returns
Returns an internal event id.
Remarks
RequirementsNamespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0
Sets the parameters for the animation. The parameters are applied immediately.
SyntaxParameters
parameters
Animation parameters to apply.
handler
Handler to be called when the event completes.
Returns
Returns an internal event id.
Remarks
RequirementsNamespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0
Sets the parameters for the animation. The parameters are applied immediately.
SyntaxParameters
parameters
Animation parameters to apply.
handler
Handler to be called when the event completes.
Returns
Returns an internal event id.
Remarks
RequirementsNamespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0
The AnimationComponent handles interactions with animations.
Retrieves the component id for this AnimationComponent.
SyntaxValue
The id.
Remarks
RequirementsNamespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0
Syntax
Remarks
RequirementsNamespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0
Gets the default scriptable animation.
SyntaxValue
An Animation object.
Remarks
RequirementsNamespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0
Enqueues an event for this component.
SyntaxParameters
internalId
Returns
The internal event id for the completion event.
Remarks
RequirementsNamespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0
Enqueues an event for this component.
SyntaxParameters
internalId
handler
Handler to be called when the event completes.
Returns
The internal event id for the completion event.
Remarks
RequirementsNamespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0
Enqueues an event for this component.
SyntaxParameters
internalId
handler
Handler to be called when the event completes.
Returns
The internal event id for the completion event.
Remarks
RequirementsNamespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0
Finds a scriptable animations by name.
SyntaxParameters
animationName
The name of the animation.
Returns
An Animation, or null if no animation was found with the correct name.
Remarks
RequirementsNamespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0
Gets the scriptable animations for this object.
SyntaxReturns
An IEnumarable collection of animation objects.
Remarks
RequirementsNamespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0
Lookup the event id for the named event.
SyntaxParameters
eventName
The name of the event to query.
Returns
The id of the named event or -1 if the name is not valid.
Remarks
RequirementsNamespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0
Get a Vector type variable from the animation by name
SyntaxParameters
variableName
The name of the animation variable
Returns
A Mono.Simd.Vector4f of the value of the named variable
Exceptions
Thrown when attempting to get a variable that doesn't exist or is of the wrong type
If variableName is null
Remarks
RequirementsNamespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0
Check this component for the existence of the named event.
SyntaxParameters
eventName
The name of the event to query.
Returns
true if the event exits.
Remarks
RequirementsNamespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0
This AnimationComponent name, as specified in the editor.
SyntaxValue
Remarks
RequirementsNamespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0
Asynchronously set the position for this object.
SyntaxParameters
position
The Mono.Simd.Vector4f position desired.
Returns
Returns an internal event id.
Remarks
RequirementsNamespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0
Asynchronously set the position for this object.
SyntaxParameters
position
The Mono.Simd.Vector4f position desired.
handler
Handler to be called when the event completes.
Returns
Returns an internal event id.
Remarks
RequirementsNamespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0
Asynchronously set the position for this object.
SyntaxParameters
position
The Mono.Simd.Vector4f position desired.
handler
Handler to be called when the event completes.
Returns
Returns an internal event id.
Remarks
RequirementsNamespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0
Subscribes to Animation Events.
SyntaxParameters
BehaviorName
The behavior name of the Animation. This name will match the subscribed event.
callback
Callback which is executed when the event completes.
persistent
Optional, set to false to unsubscribe after one event.
Remarks
RequirementsNamespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0
Subscribes to Animation Events.
SyntaxSee Also
Parameters
BehaviorName
The behavior name of the Animation. This name will match the subscribed event.
callback
Callback which is executed when the event completes.
persistent
Optional, set to false to unsubscribe after one event.
Returns
Remarks
RequirementsNamespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0
A string representation of this object.
SyntaxReturns
A string representation of this object.
Remarks
RequirementsNamespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0
Animation events.
Parameters
BehaviorName
The behavior name of the Animation. This name will match the subscribed event.
ComponentId
The id of the animation component.
Namespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0
Animation events.
The behavior name of the Animation. This name will match the subscribed event.
SyntaxValue
Remarks
RequirementsNamespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0
The id of the animation component.
SyntaxValue
Remarks
RequirementsNamespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0
A string representation of this object.
SyntaxReturns
A string representation of this object.
Remarks
RequirementsNamespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0
The AnimationParameters struct contains settings for playing animations.
[Sansar.Script.Interface] public struct AnimationParameters
Time in seconds taken to blend to this animation.
Syntax
Remarks
RequirementsNamespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0
If true, clamp the animation frames to the range specified by rangeStartFrame and rangeLength. If false, play the whole animation.
Syntax
Remarks
RequirementsNamespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0
Animation playback mode.
Syntax
Remarks
RequirementsNamespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0
Animation playback speed. Negative values will play the animation backwards.
Syntax
Remarks
RequirementsNamespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0
End frame to use when clamping animation range. This should always be greater or equal to the range start frame.
Syntax
Remarks
RequirementsNamespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0
Start frame to use when clamping animation range.
Syntax
Remarks
RequirementsNamespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0
Enumeration for the different animation playback modes
[Sansar.Script.Interface] public enum AnimationPlaybackMode
Loop
Loop indefinitely.
PingPong
Play indefinitely, alternating between forwards and backwards.
PlayOnce
Play once then stop.
Namespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0
[Sansar.Script.Interface] public GetName ()
[Sansar.Script.Interface] public IsPaused ()
[Sansar.Script.Interface] public JumpToFrame ( frame)
[Sansar.Script.Interface] public Pause ()
[Sansar.Script.Interface] public Play ()
[Sansar.Script.Interface] public Reset ()
[get: Sansar.Script.Interface] public DefaultAnimation { get; }
[Sansar.Script.Interface] public EnqueueEvent ( internalId)
The id of the animation event, may be looked up by name from
The id of the animation event, may be looked up by name from
The id of the animation event, may be looked up by name from
[Sansar.Script.Interface] public GetAnimation ( animationName)
[Sansar.Script.Interface] public GetEventId ( eventName)
[Sansar.Script.Interface] public GetVectorAnimationVariable ( variableName)
[Sansar.Script.Interface] public HasEvent ( eventName)
[get: Sansar.Script.Interface] public Name { get; }
[Sansar.Script.Interface] public SetPosition ( position)
[Sansar.Script.Interface] [System.Obsolete("Use subscription callbacks of type Action<Sansar.Simulation.AnimationData>", true)] public Subscribe ( BehaviorName, callback, persistent)
An that can be used to cancel the subscription.
[Sansar.Script.Interface] public override ToString ()
[Sansar.Script.Interface] [System.Obsolete("Use subscription callbacks of type Action<Sansar.Simulation.AnimationData>", false)] public delegate AnimationComponent.SubscriptionHandler ( BehaviorName, ComponentId)
[get: Sansar.Script.Interface] public BehaviorName { get; }
[Sansar.Script.Interface] public override ToString ()
[Sansar.Script.Interface] public BlendDuration
[Sansar.Script.Interface] public ClampToRange
[Sansar.Script.Interface] public PlaybackSpeed
[Sansar.Script.Interface] public RangeEndFrame
[Sansar.Script.Interface] public RangeStartFrame