The Keyframe Data Struct
When you define a keyframe struct for a track, you need to also define the data that will be associated with it. This is comprised of different channels, and each channel can be given a specific
type of data depending on what type of track you are setting the keyframe data for. These properties are:
- channel: This is the channel that the keyframe data should be applied to. It is a positive integer value starting at 0, and it's worth noting that when creating parameter tracks for "position" or "scale" keyframes,
then you need to use very specific channel values. These are: channel 0 is the X position or the X scale, channel 1 is the Y position or Y scale.
- spriteIndex: The index of the sprite asset to use for the track. This property is only available for tracks of the type seqtracktype_graphic and you can get or set it.
- soundIndex: The index of the audio asset to use for the track. This property is only available for tracks of the type seqtracktype_audio and you can get or set it.
- playbackMode: The playback mode for the sound. This property is only available for tracks of the type seqtracktype_audio and you can get or set it. The property should be one of the following constants:
| Constant |
Description |
Value |
| seqaudiokey_loop |
The sound will loop when played. |
0 |
| seqaudiokey_oneshot |
The sound will only play once then stop. |
1 |
- curve: This property requires an animation curve struct (see here for more information) and is only available for tracks of the type seqtracktype_real. If no curve struct
is used then the value for this property will be -1.
- value: This property is simply a value that is associated with the keyframe data channel, and is only available for tracks of the type seqtracktype_real when no curve struct
is supplied.
- colour: This property returns (or requires, if being set) an array for the colour value of the keyframe with the format [A, R, G, B]. This is only available for tracks of the type seqtracktype_colour.
Note that the values for each component should be expressed as between 0 and 1, where 0 corresponds to the HEX value #00 and 1 corresponds to the HEX value #FF (0 - 255 as shown in the colour picker for colour tracks in the Sequences Editor).
- sequence: This property will return (or requires, if being set) a sequence object struct and is only available for tracks of the type seqtracktype_sequence.
- objectIndex: This property will return (or requires, if being set) an object index and is only available for tracks of the type seqtracktype_instance.
- events: This property allows access to the events and broadcast messages associated with the keyframe data struct. You can get or set this property, and when getting it an
array of strings is returned, and when setting it an array of strings should be specified. For more information on events, please see the section Sequence Events And Moments. This
property is only available for tracks of the type seqtracktype_message.
- event: This property will return (or can be set to) the method associated with the keyframe data struct. If no method has been specified or you wish to remove
the method, then the property should be -1. This property is only available for tracks of the type seqtracktype_moment.