Class Animation
Index
Constructors
Properties
Accessors
Methods
Constructors
constructor
-
new Animation(
name: string,
targetProperty: string,
framePerSecond: number,
dataType: number,
loopMode?: number,
enableBlending?: boolean,
): AnimationInitializes the animation
Parameters
- name: string
Name of the animation
- targetProperty: string
Property to animate
- framePerSecond: number
The frames per second of the animation
- dataType: number
The data type of the animation
OptionalloopMode: numberThe loop mode of the animation
OptionalenableBlending: booleanSpecifies if blending should be enabled
Returns Animation
- name: string
Properties
blending Speed
Stores the blending speed of the animation
data Type
The data type of the animation
Optionalenable Blending
Specifies if blending should be enabled
frame Per Second
The frames per second of the animation
Optionalloop Mode
The loop mode of the animation
name
Name of the animation
snippet Id
Snippet ID if the animation was created from the snippet server
target Property
Property to animate
target Property Path
Stores an array of target property paths
unique Id
Gets or sets the unique id of the animation (the uniqueness is solely among other animations)
StaticAllow Matrices Interpolation
Use matrix interpolation instead of using direct key value when animating matrices
StaticAllow Matrix Decompose For Interpolation
When matrix interpolation is enabled, this boolean forces the system to use Matrix.DecomposeLerp instead of Matrix.Lerp. Interpolation is more precise but slower
Static ReadonlyANIMATIONLOOPMODE_ CONSTANT
Constant Loop Mode
Static ReadonlyANIMATIONLOOPMODE_ CYCLE
Cycle Loop Mode
Static ReadonlyANIMATIONLOOPMODE_ RELATIVE
Relative Loop Mode
Static ReadonlyANIMATIONLOOPMODE_ RELATIVE_ FROM_ CURRENT
Relative Loop Mode (add to current value of animated object, unlike ANIMATIONLOOPMODE_RELATIVE)
Static ReadonlyANIMATIONLOOPMODE_ YOYO
Yoyo Loop Mode
Static ReadonlyANIMATIONTYPE_ COLOR3
Color3 animation type
Static ReadonlyANIMATIONTYPE_ COLOR4
Color3 animation type
Static ReadonlyANIMATIONTYPE_ FLOAT
Float animation type
Static ReadonlyANIMATIONTYPE_ MATRIX
Matrix animation type
Static ReadonlyANIMATIONTYPE_ QUATERNION
Quaternion animation type
Static ReadonlyANIMATIONTYPE_ SIZE
Size animation type
Static ReadonlyANIMATIONTYPE_ VECTOR2
Vector2 animation type
Static ReadonlyANIMATIONTYPE_ VECTOR3
Vector3 animation type
StaticInherit Original Value From Active Animations
When true, starting a new animation on a property that is already being animated will inherit the original value from the active animation instead of snapshotting the current (mid-animation) value. This prevents properties (e.g. morph target influence) from permanently sticking at intermediate values when animations overlap or interrupt each other.
StaticSnippet Url
Define the Url to load snippets
Accessors
has Running Runtime Animations
-
get hasRunningRuntimeAnimations(): boolean
Specifies if any of the runtime animations are currently running
Returns boolean
runtime Animations
-
Return the array of runtime animations currently using this animation
Returns RuntimeAnimation[]
Methods
add Event
clone
-
Makes a copy of the animation
Parameters
- cloneKeys: boolean = false
Whether to clone the keys or not (default is false, so the keys are not cloned). Note that the key array itself is always cloned (that is, a new array is created), but the individual keys inside the array are only cloned if this parameter is true.
Returns Animation
Cloned animation
- cloneKeys: boolean = false
color3 Interpolate Function
color3 Interpolate Function With Tangents
color4 Interpolate Function
color4 Interpolate Function With Tangents
create Key For Frame
-
Creates a key for the frame passed as a parameter and adds it to the animation IF a key doesn't already exist for that frame
Parameters
- frame: number
Frame number
Returns number
The key index if the key was added or the index of the pre existing key if the frame passed as parameter already has a corresponding key
- frame: number
create Range
-
Creates an animation range
Parameters
- name: string
Name of the animation range
- from: number
Starting frame of the animation range
- to: number
Ending frame of the animation
Returns void
- name: string
delete Range
-
Deletes an animation range by name
Parameters
- name: string
Name of the animation range to delete
- deleteFrames: boolean = true
Specifies if the key frames for the range should also be deleted (true) or not (false)
Returns void
- name: string
evaluate
-
Evaluate the animation value at a given frame
Parameters
- currentFrame: number
defines the frame where we want to evaluate the animation
Returns any
the animation value
- currentFrame: number
float Interpolate Function
-
Interpolates a scalar linearly
Parameters
- startValue: number
Start value of the animation curve
- endValue: number
End value of the animation curve
- gradient: number
Scalar amount to interpolate
Returns number
Interpolated scalar value
- startValue: number
float Interpolate Function With Tangents
-
floatInterpolateFunctionWithTangents(
startValue: number,
outTangent: number,
endValue: number,
inTangent: number,
gradient: number,
): numberInterpolates a scalar cubically
Parameters
- startValue: number
Start value of the animation curve
- outTangent: number
End tangent of the animation
- endValue: number
End value of the animation curve
- inTangent: number
Start tangent of the animation curve
- gradient: number
Scalar amount to interpolate
Returns number
Interpolated scalar value
- startValue: number
get Easing Function
-
Gets the easing function of the animation
Returns Nullable<IEasingFunction>
Easing function of the animation
get Events
get Highest Frame
-
Gets the highest frame of the animation
Returns number
Highest frame of the animation
get Keys
get Range
-
Gets the animation range by name, or null if not defined
Parameters
- name: string
Name of the animation range
Returns Nullable<AnimationRange>
Nullable animation range
- name: string
matrix Interpolate Function
quaternion Interpolate Function
-
quaternionInterpolateFunction(
startValue: Quaternion,
endValue: Quaternion,
gradient: number,
): QuaternionInterpolates a quaternion using a spherical linear interpolation
Parameters
- startValue: Quaternion
Start value of the animation curve
- endValue: Quaternion
End value of the animation curve
- gradient: number
Scalar amount to interpolate
Returns Quaternion
Interpolated quaternion value
- startValue: Quaternion
quaternion Interpolate Function With Tangents
-
quaternionInterpolateFunctionWithTangents(
startValue: Quaternion,
outTangent: Quaternion,
endValue: Quaternion,
inTangent: Quaternion,
gradient: number,
): QuaternionInterpolates a quaternion cubically
Parameters
- startValue: Quaternion
Start value of the animation curve
- outTangent: Quaternion
End tangent of the animation curve
- endValue: Quaternion
End value of the animation curve
- inTangent: Quaternion
Start tangent of the animation curve
- gradient: number
Scalar amount to interpolate
Returns Quaternion
Interpolated quaternion value
- startValue: Quaternion
remove Events
-
Remove all events found at the given frame
Parameters
- frame: number
The frame to remove events from
Returns void
- frame: number
serialize
-
Serializes the animation to an object
Returns any
Serialized object
set Easing Function
-
Sets the easing function of the animation
Parameters
- easingFunction: Nullable<IEasingFunction>
A custom mathematical formula for animation
Returns void
- easingFunction: Nullable<IEasingFunction>
set Keys
-
Sets the key frames of the animation
Parameters
- values: IAnimationKey[]
The animation key frames to set
- dontClone: boolean = false
Whether to clone the keys or not (default is false, so the array of keys is cloned)
- cloneKeys: boolean = false
Whether to clone the individual keys inside the array or not (default is false). If true, each key object inside the array will be cloned, and the fields that have a clone() method will be cloned by calling that method.
Returns void
- values: IAnimationKey[]
size Interpolate Function
to String
-
Converts the animation to a string
Parameters
OptionalfullDetails: booleansupport for multiple levels of logging within scene loading
Returns string
String form of the animation
Class used to store any kind of animation