Returns the currently playing animation sequence index.
Takes entity (animated mesh handle).
Returns sequence number (1-based for Blitz3D compatibility) or 0 if no animation playing.
3D Graphics
Parameters & Returns
Parameters
entityInt
Returns
Int
Quick Summary
Returns the currently playing animation sequence index.
Takes entity (animated mesh handle).
Returns sequence number (1-based for Blitz3D compatibility) or 0 if no animation playing.
Technical Exegesis...
Returns the currently playing animation sequence index. Takes entity (animated mesh handle). Returns sequence number (1-based for Blitz3D compatibility) or 0 if no animation playing. Validates entity exists and type is ENTITY_ANIMATED_MESH. Checks animatedMesh pointer exists. If currentSequenceIndex >= 0 (user-defined sequence active via b3dAnimate with custom range), returns currentSequenceIndex directly.
Returns the currently playing animation sequence index. Takes entity (animated mesh handle). Returns sequence number (1-based for Blitz3D compatibility) or 0 if no animation playing. Validates entity exists and type is ENTITY_ANIMATED_MESH. Checks animatedMesh pointer exists. If currentSequenceIndex >= 0 (user-defined sequence active via b3dAnimate with custom range), returns currentSequenceIndex directly. Otherwise, if currentAnimationIndex >= 0 (glTF animation active), returns currentAnimationIndex + 1 (converts 0-based C++ index to 1-based Blitz3D index for compatibility). Returns 0 if: invalid entity, entity not animated mesh, no animation set, animatedMesh pointer null.
This function identifies which animation is currently playing for state-machine logic. Sequence index from b3dAnimate call - specifies which animation to play from glTF file. GLB files can contain multiple animations (idle, walk, run, jump, attack). Sequence number corresponds to animation order in file. Zero means no animation active (stopped or never started). Use for: (1) State verification (If b3dAnimSeq(player) <> ANIM_WALK Then b3dAnimate(player, ..., firstFrame, lastFrame)), (2) Animation transitions (detect when to blend to next animation), (3) Debug display (show current animation name). Blitz3D compatibility: 1-based indexing matches classic Blitz3D behavior (first animation is sequence 1, not 0). User-defined sequences: b3dAnimate allows specifying custom frame ranges (firstFrame, lastFrame parameters) for sub-animations within single glTF animation - if used, returns user's sequence index instead of glTF animation index. Common workflow: define constants (ANIM_IDLE=1, ANIM_WALK=2, etc.), check b3dAnimSeq to verify correct animation playing. Alternative: store animation state in your own variables instead of querying. Return value distinguishes stopped (0) from first animation (1).