new BBMOD_AnimationPlayer(_model[, _paused])
An animation player. Each instance of an animated model should have its own animation player.
||A model that the animation player animates.|
|Animation||The currently playing animation or
|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
|Model||A model that the animation player animates.|
|PlaybackSpeed||Controls animation playback speed. Must be a positive number!|
|Time||The current animation playback time.|
|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); animationPlayer.play(OResourceManager.animIdle, true); /// @desc Step event of OCharacter animationPlayer.update(delta_time); /// @desc Draw event of OCharacter bbmod_material_reset(); animationPlayer.render(); bbmod_material_reset();
Copyright © 2022, BlueBurn. Built on September 19, 2022 using GMDoc.