Extends BBMOD_Class
Implements Struct.BBMOD_IEventListener, Struct.BBMOD_IRenderable


new BBMOD_AnimationPlayer(_model[, _paused])


An animation player. Each instance of an animated model should have its own animation player.


Name Type Description
_model Struct.BBMOD_Model A model that the animation player animates.
_paused Bool If true then the animation player is created as paused. Defaults to false.


Name Description
Animation The currently playing animation.
AnimationLoops If true then BBMOD_AnimationPlayer.Animation loops.
Frameskip Number of frames (calls to BBMOD_AnimationPlayer.update) to skip. Defaults to 0 (frame skipping is disabled). Increasing the value increases performance. Use infinity to disable computing animation frames entirely.
Model A model that the animation player animates.
Paused If true, then the animation playback is paused.
PlaybackSpeed Controls animation playback speed. Must be a positive number!
Time The current animation playback time.


Name Description
change Starts playing an animation from its start, only if it is a different one that the last played animation.
get_node_transform Returns a transformation (dual quaternion) of a node, which can be used for example for attachments.
get_node_transform_from_frame Returns a transformation (dual quaternion) of a node from the last animation frame. This is useful if you want to add additional transformations onto an animated bone, instead of competely replacing it.
get_transform Returns an array of current transformations of all bones. This should be passed to a vertex shader.
play Starts playing an animation from its start.
render Enqueues the animated model for rendering.
set_node_position Overrides a position of a node.
set_node_rotation Overrides a rotation of a node.
submit Immediately submits the animated model for rendering.
update Updates the animation player. This should be called every frame in the step event.


Following code shows how to load models and animations in a resource manager object and then play animations in multiple instances of another object.

/// @desc Create event of OResourceManager
modCharacter = new BBMOD_Model("character.bbmod");
animIdle = new BBMOD_Animation("idle.bbanim");

/// @desc Create event of OCharacter
model = OResourceManager.modCharacter;
animationPlayer = new BBMOD_AnimationPlayer(model);, true);

/// @desc Step event of OCharacter

/// @desc Draw event of OCharacter

See also

BBMOD_Animation, BBMOD_EventListener, BBMOD_Model

Do you find this page helpful?

Copyright © 2022, BlueBurn. Built on May 18, 2022 using GMDoc.