Class Animation
Asset that contains an animation spline represented by a set of keyframes, each representing an endpoint of a linear curve.
Inherited Members
Assembly: FlaxEngine.dll
File: Engine/Content/Assets/Animation.h
Syntax
public class Animation : public BinaryAsset
Fields
Data
Events
The animation events (keyframes per named track).
Declaration
public Array<Pair<String, StepCurve<AnimEventData>>> Events
Field Value
Array<Pair<String, StepCurve<AnimEventData>>>
|
NestedAnims
The nested animations (animation per named track).
Declaration
public Array<Pair<String, NestedAnimData>> NestedAnims
Field Value
Array<Pair<String, NestedAnimData>>
|
Methods
getChunksToPreload()
Gets packed chunks indices to preload before asset loading action
Declaration
protected virtual AssetChunksFlag getChunksToPreload() const override
Returns
AssetChunksFlag
Chunks to load flags |
Overrides
GetDuration()
Gets the duration of the animation (in frames).
Declaration
public float GetDuration() const
Returns
float
|
GetFramesPerSecond()
Gets the amount of the animation frames per second.
Declaration
public float GetFramesPerSecond() const
Returns
float
|
GetInfo()
Gets the animation clip info.
Declaration
public InfoData GetInfo() const
Returns
InfoData
|
GetLength()
Gets the length of the animation (in seconds).
Declaration
public float GetLength() const
Returns
float
|
GetMemoryUsage()
Gets amount of CPU memory used by this resource (in bytes). It's a rough estimation. Memory may be fragmented, compressed or sub-allocated so the actual memory pressure from this resource may vary.
Declaration
public virtual uint64 GetMemoryUsage() const override
Returns
uint64
|
Overrides
GetReferences(Array<Guid>& assets, Array<String>& files)
Declaration
public void GetReferences(Array<Guid>& assets, Array<String>& files) const override
Parameters
Array<Guid>
assets
|
Array<String>
files
|
load()
Load data from the chunks
Declaration
protected virtual LoadResult load() override
Returns
LoadResult
Loading result |
Overrides
LoadTimeline(BytesContainer& result)
Gets the animation as serialized timeline data. Used to show it in Editor.
Declaration
public void LoadTimeline(BytesContainer& result) const
Parameters
BytesContainer
result
The output timeline data container. Empty if failed to load. |
OnScriptingDispose()
Save(const StringView& path=StringView::Empty)
Saves this asset to the file. Supported only in Editor.
Declaration
public virtual bool Save(const StringView& path=StringView::Empty) override
Parameters
StringView
path
The custom asset path to use for the saving. Use empty value to save this asset to its own storage location. Can be used to duplicate asset. Must be specified when saving virtual asset. |
Returns
bool
True when cannot save data, otherwise false. |
Overrides
SaveTimeline(BytesContainer& data)
Saves the serialized timeline data to the asset as animation.
This cannot be used by virtual assets.
Declaration
public bool SaveTimeline(BytesContainer& data)
Parameters
BytesContainer
data
The timeline data container. |
Returns
bool
|
unload(bool isReloading)
Unloads asset data
Declaration
protected virtual void unload(bool isReloading) override
Parameters
bool
isReloading
True if asset is reloading data, otherwise false. |