Sansar Docs
Ask or search…
K

Animation

Animation, component, subscription handler, data, parameters, and playback mode docs.

Animation Class

Represents a scriptable Animation node.

Syntax

Member Details

GetFrameCount Method

Gets the frame count of the animation

Syntax

[Sansar.Script.Interface] public int GetFrameCount ()
Returns
Returns the total number of frames in the animation.

Remarks

Requirements

Namespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0

GetName Method

Gets the name of the animation

Syntax

[Sansar.Script.Interface] public string GetName ()
Returns
Returns the name of the animation.

Remarks

Requirements

Namespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0

GetParameters Method

Gets the last applied parameters for the animation

Syntax

Returns
Returns the current parameters.

Remarks

Requirements

Namespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0

IsPaused Method

Gets whether or not the animation is paused.

Syntax

[Sansar.Script.Interface] public bool IsPaused ()
Returns
A bool value indicating the pause state.

Remarks

Requirements

Namespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0

JumpToFrame Method

Jump to frame. The animation will be set to the specified frame, and paused.

Syntax

[Sansar.Script.Interface] public void JumpToFrame (int frame)
Parameters
frame
Frame to jump to.
Returns
Returns an internal event id.

Remarks

Requirements

Namespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0

JumpToFrame Method

Jump to frame. The animation will be set to the specified frame, and paused.

Syntax

Parameters
frame
Frame to jump to.
handler
Handler to be called when the event completes.
Returns
Returns an internal event id.

Remarks

Requirements

Namespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0

JumpToFrame Method

Jump to frame. The animation will be set to the specified frame, and paused.

Syntax

Parameters
frame
Frame to jump to.
handler
Handler to be called when the event completes.
Returns
Returns an internal event id.

Remarks

Requirements

Namespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0

Pause Method

Pauses the animation.

Syntax

[Sansar.Script.Interface] public void Pause ()
Returns
Returns an internal event id.

Remarks

Requirements

Namespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0

Pause Method

Pauses the animation.

Syntax

Parameters
handler
Handler to be called when the event completes.
Returns
Returns an internal event id.

Remarks

Requirements

Namespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0

Pause Method

Pauses the animation.

Syntax

Parameters
handler
Handler to be called when the event completes.
Returns
Returns an internal event id.

Remarks

Requirements

Namespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0

Play Method

Plays the animation. It will become the active animation for this object, and resume playing if it is paused.

Syntax

[Sansar.Script.Interface] public void Play ()
Returns
Returns an internal event id.

Remarks

Requirements

Namespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0

Play Method

Plays the animation, without changing the current animation frame.

Syntax

Parameters
handler
Handler to be called when the event completes.
Returns
Returns an internal event id.

Remarks

Requirements

Namespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0

Play Method

Plays the animation and applies the provided parameters.

Syntax

Parameters
parameters
Animation parameters to apply.
Returns
Returns an internal event id.

Remarks

Requirements

Namespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0

Play Method

Plays the animation. It will become the active animation for this object, and resume playing if it is paused.

Syntax

Parameters
handler
Handler to be called when the event completes.
Returns
Returns an internal event id.

Remarks

Requirements

Namespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0

Play Method

Plays the animation and applies the provided parameters.

Syntax

Parameters
parameters
Animation parameters to apply.
handler
Handler to be called when the event completes.
Returns
Returns an internal event id.

Remarks

Requirements

Namespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0

Play Method

Plays the animation and applies the provided parameters.

Syntax

Parameters
parameters
Animation parameters to apply.
handler
Handler to be called when the event completes.
Returns
Returns an internal event id.

Remarks

Requirements

Namespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0

Reset Method

Resets the animation. The animation is paused and reset to frame 0 (or the RangeStartFrame if clamping is enabled).

Syntax

[Sansar.Script.Interface] public void Reset ()
Returns
Returns an internal event id.

Remarks

Requirements

Namespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0

Reset Method

Resets the animation. The animation is paused and reset to frame 0 (or the RangeStartFrame if clamping is enabled).

Syntax

Parameters
handler
Handler to be called when the event completes.
Returns
Returns an internal event id.

Remarks

Requirements

Namespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0

Reset Method

Resets the animation and applies the provided parameters.

Syntax

Parameters
parameters
Animation parameters to apply.
Returns
Returns an internal event id.

Remarks

Requirements

Namespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0

Reset Method

Resets the animation. The animation is paused and reset to frame 0 (or the RangeStartFrame if clamping is enabled).

Syntax

Parameters
handler
Handler to be called when the event completes.
Returns
Returns an internal event id.

Remarks

Requirements

Namespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0

Reset Method

Resets the animation and applies the provided parameters.

Syntax

Parameters
parameters
Animation parameters to apply.
handler
Handler to be called when the event completes.
Returns
Returns an internal event id.

Remarks

Requirements

Namespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0

Reset Method

Resets the animation and applies the provided parameters.

Syntax

Parameters
parameters
Animation parameters to apply.
handler
Handler to be called when the event completes.
Returns
Returns an internal event id.

Remarks

Requirements

Namespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0

SetParameters Method

Sets the parameters for the animation. The parameters are applied immediately.

Syntax

Parameters
parameters
Animation parameters to apply.
Returns
Returns an internal event id.

Remarks

Requirements

Namespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0

SetParameters Method

Sets the parameters for the animation. The parameters are applied immediately.

Syntax

Parameters
parameters
Animation parameters to apply.
handler
Handler to be called when the event completes.
Returns
Returns an internal event id.

Remarks

Requirements

Namespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0

SetParameters Method

Sets the parameters for the animation. The parameters are applied immediately.

Syntax

Parameters
parameters
Animation parameters to apply.
handler
Handler to be called when the event completes.
Returns
Returns an internal event id.

Remarks

Requirements

Namespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0


AnimationComponent Class

The AnimationComponent handles interactions with animations.

Syntax

Member Details

ComponentId Property

Retrieves the component id for this AnimationComponent.

Syntax

Value
The id.

Remarks

Requirements

Namespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0

ComponentType Field

Syntax

Remarks

Requirements

Namespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0

DefaultAnimation Property

Gets the default scriptable animation.

Syntax

[get: Sansar.Script.Interface] public Animation DefaultAnimation { get; }
Value
An Animation object.

Remarks

Requirements

Namespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0

EnqueueEvent Method

Enqueues an event for this component.

Syntax

[Sansar.Script.Interface] public void EnqueueEvent (int internalId)
Parameters
internalId
The id of the animation event, may be looked up by name from AnimationComponent.GetEventId(string)
Returns
The internal event id for the completion event.

Remarks

Requirements

Namespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0

EnqueueEvent Method

Enqueues an event for this component.

Syntax

Parameters
internalId
The id of the animation event, may be looked up by name from AnimationComponent.GetEventId(string)
handler
Handler to be called when the event completes.
Returns
The internal event id for the completion event.

Remarks

Requirements

Namespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0

EnqueueEvent Method

Enqueues an event for this component.

Syntax

Parameters
internalId
The id of the animation event, may be looked up by name from AnimationComponent.GetEventId(string)
handler
Handler to be called when the event completes.
Returns
The internal event id for the completion event.

Remarks

Requirements

Namespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0

GetAnimation Method

Finds a scriptable animations by name.

Syntax

[Sansar.Script.Interface] public Animation GetAnimation (string animationName)
Parameters
animationName
The name of the animation.
Returns
An Animation, or null if no animation was found with the correct name.

Remarks

Requirements

Namespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0

GetAnimations Method

Gets the scriptable animations for this object.

Syntax

Returns
An IEnumarable collection of animation objects.

Remarks

Requirements

Namespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0

GetEventId Method

Lookup the event id for the named event.

Syntax

[Sansar.Script.Interface] public int GetEventId (string eventName)
Parameters
eventName
The name of the event to query.
Returns
The id of the named event or -1 if the name is not valid.

Remarks

Requirements

Namespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0

GetVectorAnimationVariable Method

Get a Vector type variable from the animation by name

Syntax

[Sansar.Script.Interface] public Sansar.Vector GetVectorAnimationVariable (string variableName)
Parameters
variableName
The name of the animation variable
Returns
A Mono.Simd.Vector4f of the value of the named variable
Exceptions
Type
Reason
Thrown when attempting to get a variable that doesn't exist or is of the wrong type
If variableName is null

Remarks

Requirements

Namespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0

HasEvent Method

Check this component for the existence of the named event.

Syntax

[Sansar.Script.Interface] public bool HasEvent (string eventName)
Parameters
eventName
The name of the event to query.
Returns
true if the event exits.

Remarks

Requirements

Namespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0

Name Property

This AnimationComponent name, as specified in the editor.

Syntax

[get: Sansar.Script.Interface] public string Name { get; }
Value

Remarks

Requirements

Namespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0

SetPosition Method

Asynchronously set the position for this object.

Syntax

[Sansar.Script.Interface] public void SetPosition (Sansar.Vector position)
Parameters
position
The Mono.Simd.Vector4f position desired.
Returns
Returns an internal event id.

Remarks

Requirements

Namespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0

SetPosition Method

Asynchronously set the position for this object.

Syntax

Parameters
position
The Mono.Simd.Vector4f position desired.
handler
Handler to be called when the event completes.
Returns
Returns an internal event id.

Remarks

Requirements

Namespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0

SetPosition Method

Asynchronously set the position for this object.

Syntax

Parameters
position
The Mono.Simd.Vector4f position desired.
handler
Handler to be called when the event completes.
Returns
Returns an internal event id.

Remarks

Requirements

Namespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0

Subscribe Method

Subscribes to Animation Events.

Syntax

[Sansar.Script.Interface] [System.Obsolete("Use subscription callbacks of type Action<Sansar.Simulation.AnimationData>", true)] public void Subscribe (string BehaviorName, AnimationComponent.SubscriptionHandler callback, bool persistent)
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.

Remarks

Requirements

Namespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0

Subscribe Method

Subscribes to Animation Events.

Syntax

See 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
An Sansar.Script.IEventSubscription that can be used to cancel the subscription.

Remarks

Requirements

Namespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0

ToString Method

A string representation of this object.

Syntax

[Sansar.Script.Interface] public override string ToString ()
Returns
A string representation of this object.

Remarks

Requirements

Namespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0


AnimationComponent.SubscriptionHandler Delegate

Animation events.

Syntax

[Sansar.Script.Interface] [System.Obsolete("Use subscription callbacks of type Action<Sansar.Simulation.AnimationData>", false)] public delegate void AnimationComponent.SubscriptionHandler (string BehaviorName, Sansar.Script.ComponentId ComponentId)
Parameters
BehaviorName
The behavior name of the Animation. This name will match the subscribed event.
ComponentId
The id of the animation component.

Remarks

Requirements

Namespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0

AnimationData Class

Animation events.

Syntax

Member Details

BehaviorName Property

The behavior name of the Animation. This name will match the subscribed event.

Syntax

[get: Sansar.Script.Interface] public string BehaviorName { get; }
Value

Remarks

Requirements

Namespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0

ComponentId Property

The id of the animation component.

Syntax

Value

Remarks

Requirements

Namespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0

ToString Method

A string representation of this object.

Syntax

[Sansar.Script.Interface] public override string ToString ()
Returns
A string representation of this object.

Remarks

Requirements

Namespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0


AnimationParameters Struct

The AnimationParameters struct contains settings for playing animations.

Syntax

[Sansar.Script.Interface] public struct AnimationParameters

Member Details

BlendDuration Field

Time in seconds taken to blend to this animation.

Syntax

[Sansar.Script.Interface] public float BlendDuration

Remarks

Requirements

Namespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0

ClampToRange Field

If true, clamp the animation frames to the range specified by rangeStartFrame and rangeLength. If false, play the whole animation.

Syntax

[Sansar.Script.Interface] public bool ClampToRange

Remarks

Requirements

Namespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0

PlaybackMode Field

Animation playback mode.

Syntax

Remarks

Requirements

Namespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0

PlaybackSpeed Field

Animation playback speed. Negative values will play the animation backwards.

Syntax

[Sansar.Script.Interface] public float PlaybackSpeed

Remarks

Requirements

Namespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0

RangeEndFrame Field

End frame to use when clamping animation range. This should always be greater or equal to the range start frame.

Syntax

[Sansar.Script.Interface] public int RangeEndFrame

Remarks

Requirements

Namespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0

RangeStartFrame Field

Start frame to use when clamping animation range.

Syntax

[Sansar.Script.Interface] public int RangeStartFrame

Remarks

Requirements

Namespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0


AnimationPlaybackMode Enum

Enumeration for the different animation playback modes

Syntax

[Sansar.Script.Interface] public enum AnimationPlaybackMode

Remarks

Members

Member Name
Description
Loop
Loop indefinitely.
PingPong
Play indefinitely, alternating between forwards and backwards.
PlayOnce
Play once then stop.

Requirements

Namespace: Sansar.Simulation Assembly: Sansar.Simulation (in Sansar.Simulation.dll) Assembly Versions: 1.1.0.0