Class SceneAnimationPlayer
The scene animation playback actor.
Inherited Members
Assembly: FlaxEngine.dll
File: Engine/Animations/SceneAnimations/SceneAnimationPlayer.h
Syntax
public class SceneAnimationPlayer : public Actor, public IPostFxSettingsProvider
Fields
Animation
The scene animation to play.
Declaration
public AssetReference<SceneAnimation> Animation
Field Value
AssetReference<SceneAnimation>
|
CameraArtifacts
Loop
Determines whether the scene animation should loop when it finishes playing.
Declaration
public bool Loop = false
Field Value
bool
|
PlayOnStart
Determines whether the scene animation should auto play on game start.
Declaration
public bool PlayOnStart = false
Field Value
bool
|
PostFxMaterials
RandomStartTime
Determines whether the scene animation should randomize the start time on play begin.
Declaration
public bool RandomStartTime = false
Field Value
bool
|
RestoreStateOnStop
Determines whether the scene animation should restore initial state on playback stop. State is cached when animation track starts play after being stopped (not paused).
Declaration
public bool RestoreStateOnStop = false
Field Value
bool
|
Speed
The animation playback speed factor. Scales the timeline update delta time. Can be used to speed up or slow down the sequence.
Declaration
public float Speed = 1.0f
Field Value
float
|
StartTime
The animation start time. Can be used to skip part of the sequence on begin.
Declaration
public float StartTime = 0.0f
Field Value
float
|
UpdateMode
The animation update mode.
Declaration
public UpdateModes UpdateMode = UpdateModes::EveryUpdate
Field Value
UpdateModes
|
UsePrefabObjects
Determines whether the scene animation should automatically map prefab objects from scene animation into prefab instances. Useful for reusable animations to automatically link prefab objects.
Declaration
public bool UsePrefabObjects = false
Field Value
bool
|
UseTimeScale
Determines whether the scene animation should take into account the global game time scale for simulation updates.
Declaration
public bool UseTimeScale = true
Field Value
bool
|
Methods
BeginPlay(SceneBeginData* data)
Called when adding object to the game.
Declaration
protected virtual void BeginPlay(SceneBeginData* data) override
Parameters
SceneBeginData
data
The initialization data (e.g. used to collect joints to link after begin). |
Overrides
Blend(PostProcessSettings& other, float weight)
Blends the object settings to the given settings using given weight.
Declaration
public virtual void Blend(PostProcessSettings& other, float weight) override
Parameters
PostProcessSettings
other
The other settings to blend to. |
float
weight
The blending weight (normalized to 0-1 range). |
Overrides
Collect(RenderContext& renderContext)
Collects the settings for rendering of the specified task.
Declaration
public virtual void Collect(RenderContext& renderContext) override
Parameters
RenderContext
renderContext
The rendering context. |
Overrides
Deserialize(DeserializeStream& stream, ISerializeModifier* modifier)
Deserializes object from the input stream.
Declaration
public virtual void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override
Parameters
DeserializeStream
stream
The input stream. |
ISerializeModifier
modifier
The deserialization modifier object. Always valid. |
Overrides
EndPlay()
Called when removing object from the game.
Declaration
protected virtual void EndPlay() override
Overrides
GetEditorBox()
Gets actor bounding box (single actor, no children included) for editor tools.
Declaration
public virtual BoundingBox GetEditorBox() const override
Returns
BoundingBox
|
Overrides
GetTime()
Gets the current animation playback time position (seconds).
Declaration
public float GetTime() const
Returns
float
The animation playback time position (seconds). |
HasContentLoaded()
Returns true if actor has loaded content.
Declaration
public virtual bool HasContentLoaded() const override
Returns
bool
|
Overrides
IsPaused()
Gets the value that determines whether the scene animation is paused.
Declaration
public bool IsPaused() const
Returns
bool
|
IsPlaying()
Gets the value that determines whether the scene animation is playing.
Declaration
public bool IsPlaying() const
Returns
bool
|
IsStopped()
Gets the value that determines whether the scene animation is stopped.
Declaration
public bool IsStopped() const
Returns
bool
|
MapObject(const Guid& from, const Guid& to)
Adds an object mapping. The object from
represented by it's unique ID will be redirected to the specified to
. Can be used to reuse the same animation for different objects.
Declaration
public void MapObject(const Guid& from, const Guid& to)
Parameters
Guid
from
The source object from the scene animation asset to replace. |
Guid
to
The destination object to animate. |
MapTrack(const StringView& from, const Guid& to)
Adds an object mapping for the object track. The track name from
will be redirected to the specified object to
. Can be used to reuse the same animation for different objects.
Declaration
public void MapTrack(const StringView& from, const Guid& to)
Parameters
StringView
from
The source track name from the scene animation asset to replace. |
Guid
to
The destination object to animate. |
OnDisable()
Called when actor gets removed from game systems. Occurs on EndPlay event or when actor gets inactivated in hierarchy. Use this event to unregister object from other game system (eg. audio).
Declaration
protected virtual void OnDisable() override
Overrides
OnEnable()
Called when actor gets added to game systems. Occurs on BeginPlay event or when actor gets activated in hierarchy. Use this event to register object to other game system (eg. audio).
Declaration
protected virtual void OnEnable() override
Overrides
OnTransformChanged()
Called when actor transform gets changed.
Declaration
protected virtual void OnTransformChanged() override
Overrides
Pause()
Pauses the animation. Has no effect if animation is not playing.
Declaration
public void Pause()
Play()
Starts playing the animation. Has no effect if animation is already playing.
Declaration
public void Play()
Serialize(SerializeStream& stream, const void* otherObj)
Serializes object to the output stream compared to the values of the other object instance (eg. default class object). If other object is null then serialize all properties.
Declaration
public virtual void Serialize(SerializeStream& stream, const void* otherObj) override
Parameters
SerializeStream
stream
The output stream. |
void
otherObj
The instance of the object to compare with and serialize only the modified properties. If null, then serialize all properties. |
Overrides
SetTime(float value)
Sets the current animation playback time position (seconds).
Declaration
public void SetTime(float value)
Parameters
float
value
The value. |
Stop()
Stops playing the animation. Has no effect if animation is already stopped.
Declaration
public void Stop()
Tick(float dt)
Manually ticks the animation by performing the playback update with a given time delta.
Declaration
public void Tick(float dt)
Parameters
float
dt
The update delta time (in seconds). It does not get scaled by player Speed parameter. |