Animation

Animation Class

Represents a scriptable Animation node.

Syntax

[Sansar.Script.Interface]
public class Animation : Sansar.Script.InstanceInterface

Remarks

 

Requirements

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

Members

See Also: Inherited members from Sansar.Script.InstanceInterface.

Public Properties

[read-only]
 
IsValid bool . Whether or not this interface is valid. (Inherited from Sansar.Script.InstanceInterface.)

Public Methods

 
GetFrameCount () : int
Gets the frame count of the animation
 
GetName () : string
Gets the name of the animation
 
GetParameters () : AnimationParameters
Gets the last applied parameters for the animation
 
IsPaused () : bool
Gets whether or not the animation is paused.
 
JumpToFrame (int)
Jump to frame. The animation will be set to the specified frame, and paused.
 
JumpToFrame (int, Sansar.Script.ScriptBase.OperationComplete) : ulong
Jump to frame. The animation will be set to the specified frame, and paused.
 
JumpToFrame (int, Action<Sansar.Script.OperationCompleteEvent>)
Jump to frame. The animation will be set to the specified frame, and paused.
 
Pause ()
Pauses the animation.
 
Pause (Sansar.Script.ScriptBase.OperationComplete) : ulong
Pauses the animation.
 
Pause (Action<Sansar.Script.OperationCompleteEvent>)
Pauses the animation.
 
Play ()
Plays the animation. It will become the active animation for this object, and resume playing if it is paused.
 
Play (Sansar.Script.ScriptBase.OperationComplete) : ulong
Plays the animation, without changing the current animation frame.
 
Play (AnimationParameters)
Plays the animation and applies the provided parameters.
 
Play (Action<Sansar.Script.OperationCompleteEvent>)
Plays the animation. It will become the active animation for this object, and resume playing if it is paused.
 
Play (AnimationParameters, Sansar.Script.ScriptBase.OperationComplete) : ulong
Plays the animation and applies the provided parameters.
 
Play (AnimationParameters, Action<Sansar.Script.OperationCompleteEvent>)
Plays the animation and applies the provided parameters.
 
Reset ()
Resets the animation. The animation is paused and reset to frame 0 (or the RangeStartFrame if clamping is enabled).
 
Reset (Sansar.Script.ScriptBase.OperationComplete) : ulong
Resets the animation. The animation is paused and reset to frame 0 (or the RangeStartFrame if clamping is enabled).
 
Reset (AnimationParameters)
Resets the animation and applies the provided parameters.
 
Reset (Action<Sansar.Script.OperationCompleteEvent>)
Resets the animation. The animation is paused and reset to frame 0 (or the RangeStartFrame if clamping is enabled).
 
Reset (AnimationParameters, Sansar.Script.ScriptBase.OperationComplete) : ulong
Resets the animation and applies the provided parameters.
 
Reset (AnimationParameters, Action<Sansar.Script.OperationCompleteEvent>)
Resets the animation and applies the provided parameters.
 
SetParameters (AnimationParameters)
Sets the parameters for the animation. The parameters are applied immediately.
 
SetParameters (AnimationParameters, Sansar.Script.ScriptBase.OperationComplete) : ulong
Sets the parameters for the animation. The parameters are applied immediately.
 
SetParameters (AnimationParameters, Action<Sansar.Script.OperationCompleteEvent>)
Sets the parameters for the animation. The parameters are applied immediately.

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

[Sansar.Script.Interface]
public AnimationParameters GetParameters ()

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

[Sansar.Script.Interface]
[System.Obsolete("Deprecated. Use the Action<> overload", false)]
public ulong JumpToFrame (int frame, Sansar.Script.ScriptBase.OperationComplete handler)

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

[Sansar.Script.Interface]
public void JumpToFrame (int frame, Action<Sansar.Script.OperationCompleteEvent> handler)

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

[Sansar.Script.Interface]
[System.Obsolete("Deprecated. Use the Action<> overload", false)]
public ulong Pause (Sansar.Script.ScriptBase.OperationComplete handler)

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

[Sansar.Script.Interface]
public void Pause (Action<Sansar.Script.OperationCompleteEvent> handler)

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

If the animation has PlaybackMode.PlayOnce and has finished playing, this will have no effect, the animation will have to be reset with Reset() first. To block until the method returns pass this to Sansar.Script.ScriptBase.WaitFor(Func<Action<Sansar.Script.EventData>,System.Boolean,Sansar.Script.IEventSubscription>) in a coroutine.

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

[Sansar.Script.Interface]
[System.Obsolete("Deprecated. Use the Action<> overload", false)]
public ulong Play (Sansar.Script.ScriptBase.OperationComplete handler)

Parameters

handler
Handler to be called when the event completes.

Returns

Returns an internal event id.

Remarks

If the animation has PlaybackMode.PlayOnce and has finished playing, this will have no effect, the animation will have to be reset with Reset() first. To block until the method returns pass this to Sansar.Script.ScriptBase.WaitFor(Func<Action<Sansar.Script.EventData>,System.Boolean,Sansar.Script.IEventSubscription>) in a coroutine.

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

[Sansar.Script.Interface]
public void Play (AnimationParameters parameters)

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

[Sansar.Script.Interface]
public void Play (Action<Sansar.Script.OperationCompleteEvent> handler)

Parameters

handler
Handler to be called when the event completes.

Returns

Returns an internal event id.

Remarks

If the animation has PlaybackMode.PlayOnce and has finished playing, this will have no effect, the animation will have to be reset with Reset() first. To block until the method returns pass this to Sansar.Script.ScriptBase.WaitFor(Func<Action<Sansar.Script.EventData>,System.Boolean,Sansar.Script.IEventSubscription>) in a coroutine.

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

[Sansar.Script.Interface]
[System.Obsolete("Deprecated. Use the Action<> overload", false)]
public ulong Play (AnimationParameters parameters, Sansar.Script.ScriptBase.OperationComplete handler)

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

[Sansar.Script.Interface]
public void Play (AnimationParameters parameters, Action<Sansar.Script.OperationCompleteEvent> handler)

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

[Sansar.Script.Interface]
[System.Obsolete("Deprecated. Use the Action<> overload", false)]
public ulong Reset (Sansar.Script.ScriptBase.OperationComplete handler)

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

[Sansar.Script.Interface]
public void Reset (AnimationParameters parameters)

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

[Sansar.Script.Interface]
public void Reset (Action<Sansar.Script.OperationCompleteEvent> handler)

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

[Sansar.Script.Interface]
[System.Obsolete("Deprecated. Use the Action<> overload", false)]
public ulong Reset (AnimationParameters parameters, Sansar.Script.ScriptBase.OperationComplete handler)

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

[Sansar.Script.Interface]
public void Reset (AnimationParameters parameters, Action<Sansar.Script.OperationCompleteEvent> handler)

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

[Sansar.Script.Interface]
public void SetParameters (AnimationParameters parameters)

Parameters

parameters
Animation parameters to apply.

Returns

Returns an internal event id.

Remarks

The range start frame will be clamped to the length of the animation, and the range end frame will be clamped between the range start frame and the end of the animation. To block until the method returns pass this to Sansar.Script.ScriptBase.WaitFor(Func<Action<Sansar.Script.EventData>,System.Boolean,Sansar.Script.IEventSubscription>) in a coroutine.

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

[Sansar.Script.Interface]
[System.Obsolete("Deprecated. Use the Action<> overload", false)]
public ulong SetParameters (AnimationParameters parameters, Sansar.Script.ScriptBase.OperationComplete handler)

Parameters

parameters
Animation parameters to apply.
handler
Handler to be called when the event completes.

Returns

Returns an internal event id.

Remarks

The range start frame will be clamped to the length of the animation, and the range end frame will be clamped between the range start frame and the end of the animation. To block until the method returns pass this to Sansar.Script.ScriptBase.WaitFor(Func<Action<Sansar.Script.EventData>,System.Boolean,Sansar.Script.IEventSubscription>) in a coroutine.

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

[Sansar.Script.Interface]
public void SetParameters (AnimationParameters parameters, Action<Sansar.Script.OperationCompleteEvent> handler)

Parameters

parameters
Animation parameters to apply.
handler
Handler to be called when the event completes.

Returns

Returns an internal event id.

Remarks

The range start frame will be clamped to the length of the animation, and the range end frame will be clamped between the range start frame and the end of the animation. To block until the method returns pass this to Sansar.Script.ScriptBase.WaitFor(Func<Action<Sansar.Script.EventData>,System.Boolean,Sansar.Script.IEventSubscription>) in a coroutine.

Requirements

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


Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

0 Comments

Article is closed for comments.