Channel

Channels are basically a container that maintain the state of a Curve or Track. Each Channel is associated to a scripting command that update the value of an existing variable. Attached to an Action, channels can be used to either control a single value, like fading the audio volume or can be used to animate a SkeletalMesh by controlling the bone's transformation of an entire Skeleton hierarchy.

Each channel can have a set of triggers that can be placed at various point in time. Theses triggers are called Actuators; when the playback time of the Channel hit the actuator time the OnActuator event will be called. Using this mechanism you can then add custom logic at various point in time during a Channel playback.

In example using actuators you could, in the case of a skeletal animation, place an actuator at the point in time where the foot of the character hit the floor. Subsequently, a Script or plugin can launch a ParticleSystem emitting dust to be launched at the location of the hit. Many more similar scenarios can be handled using actuators; always remember you have them your toolbox.

See Also

Static Variables


Name Description
action The Action reference pointer where the Channel resides.
type The type of variable the Channel controls.
value Current value evaluated by the Channel.
handler Container that handles the script(s) connected to the Channel.
track Track reference pointer in the event the Channel have been set to not use its default Curve.
playback_time The active playback time of the Channel.
code Scripting command used by the Channel to affect the value of an existing variable.
uid Internal unique id used by the system to identify the Channel.
curve Default Curve used by the Channel if it is not linked to a Track.
actuator_count The total amount of actuators connected to the active Channel.

Variables


Name Description
cycle_mode The current CycleMode set for the Channel.
name Name to identify the Channel within its parent Action.
state Active State of the Channel which determine if it is evaluating, paused, stopped etc.
flags Bit mask holding various Channel options and setting.
normalize Normalize the value evaluated by the Channel ranging from -1 to 1.
visible Show/hide the Channel when its parent Action is displayed in the editor.
mute When enabled the Channel continues to update but the variable it controls will not be updated.
locked Prevent the Channel key frames to be modified by the editor.
continuous Force the Channel variable to be updated even if the value evaluated haven't changed.
color A color to visually identify the Channel inside the editor.

Functions


Name Description
Play Start increasing the playback time and evaluating the Channel value.
Pause Pause the current Channel playback.
Stop Stop the Channel playback and reset its playback time back to 0.
Seek Manually set the Channel playback time.
Record Set the Channel State to kRecord allowing you to save the value of the variable connected to the channel over time.
GetPlaybackTime Return the current channel playback time.
GetDuration The total amount of time covered by the default Curve or Track the Channel is using.
AddActuator Create a new actuator to be triggered at specific point in time.
SortActuators Sort all the channel's actuators chronologically (based on their trigger time).
HaveActuator Get the actuator index for a specific playback time.
RemoveActuator Remove all actuators located at a specific playback time.
GetActuatorPlaybackTime Get the trigger time of an existing actuator.
IsActuatorEnabled Check if a specific actuator pointed by an index is enabled or disabled.
IsActuatorRecursive Check if a specific actuator is recursive or not.
SetActuatorPlaybackTime Modify the playback time of an existing actuator.
SetActuatorEnable Update the status of an existing actuator.
SetActuatorRecursive Change the recursion state of an existing actuator using its index as key.
ClearActuators Remove all existing actuators connected to the Channel.
SetTrack Force the Channel to use the Curve of an existing Track asset instead of its default one.
GetCurve Get the active Curve reference pointer used by the Channel.
SetCode The scripting command for the Channel to use to update an existing variable.

CycleMode


Determine the behavior of the Channel when the playback time pass the last frame.

  • kHold: Hold the value of last keyframe.
  • kLoop: Reset back the playback time to 0.
  • kMirror: Reverse the playback direction creating a ping pong effect.
  • kExtrapolate: Multiply the key frame value from the amount of cycles the Channel have been accumulating.
  • kStandBy: Maintain the Channel playback time if it pass the end of the associate Curve time range.

Example

-- Print the kMirror cycle mode value:
print( "The value of kMirror is " .. Channel.CycleMode.kMirror )

Events


Callbacks Description
OnUpdate Triggered every time the Channel gets re-evaluated.
OnActuator Called each time the playback time trigger an existing actuator.
OnPlay This callback gets called when the Channel received the signal to start playing.
OnResume Triggered if the Channel was paused and then start playing again.
OnPause Triggered when the Channel gets paused.
OnStop Called when the Channel received the stop signal.




NRG - API 2022.4.384543 - Fri Nov 4 2022
Copyright © 2022 nrgcore.com. All Rights Reserved. Terms of Service - Privacy Policy - EULA