BBMOD_Animation

Extends BBMOD_Resource

constructor

new BBMOD_Animation([_file[, _sha1]])

Description

An animation which can be played using BBMOD_AnimationPlayer.

Arguments

Name Type Description
_file String A "*.bbanim" animation file to load. If not specified, then an empty animation is created.
_sha1 String Expected SHA1 of the file. If the actual one does not match with this, then the model will not be loaded.

Properties

Name Description
Duration The duration of the animation (in tics).
IsLoaded If false then the animation has not been loaded yet.
TicsPerSecond Number of animation tics per second.
TransitionIn Duration of transition into this animation (in seconds). Must be a value greater or equal to 0!
TransitionOut Duration of transition out of this animation (in seconds). Must be a value greater or equal to 0!
VersionMajor The major version of the animation file.
VersionMinor The minor version of the animation file.

Methods

Name Description
add_event Adds a custom animation event.
create_transition Creates a new animation transition.
from_buffer Loads animation data from a buffer.
supports_attachments Checks whether the animation supports bone attachments.
supports_bone_transform Checks whether the animation supports bone transformation through code.
supports_transitions Checks whether the animation supports transitions.
to_buffer Writes animation data to a buffer.

Throws

Example

Following code loads an animation from a file Walk.bbanim:

try
{
    animWalk = new BBMOD_Animation("Walk.bbanim");
}
catch (_exception)
{
    // The animation failed to load!
}

You can also load animations from buffers like so:

var _buffer = buffer_load("Walk.anim");
try
{
    animWalk = new BBMOD_Animation().from_buffer(_buffer);
}
catch (_exception)
{
    // Failed to load an animation from the buffer!
}
buffer_delete(_buffer);
Do you find this page helpful?

Copyright © 2022, BlueBurn. Built on November 16, 2022 using GMDoc.