Returns the duration of the current animation sequence in milliseconds.
Takes entity (animated mesh handle).
Returns animation length in milliseconds (integer) or 0 if no animation active.
3D Graphics
Parameters & Returns
Parameters
entityInt
Returns
Int
Quick Summary
Returns the duration of the current animation sequence in milliseconds.
Takes entity (animated mesh handle).
Returns animation length in milliseconds (integer) or 0 if no animation active.
Technical Exegesis...
Returns the duration of the current animation sequence in milliseconds. Takes entity (animated mesh handle). Returns animation length in milliseconds (integer) or 0 if no animation active. Validates entity exists and type is ENTITY_ANIMATED_MESH. Checks animatedMesh pointer exists. Gets currentAnimationIndex from AnimatedMesh3D structure. If animation index valid (0 to animations.size()-1), returns animations[index].duration * 1000.
Returns the duration of the current animation sequence in milliseconds. Takes entity (animated mesh handle). Returns animation length in milliseconds (integer) or 0 if no animation active. Validates entity exists and type is ENTITY_ANIMATED_MESH. Checks animatedMesh pointer exists. Gets currentAnimationIndex from AnimatedMesh3D structure. If animation index valid (0 to animations.size()-1), returns animations[index].duration * 1000.0 converted to integer (duration stored as seconds float, returned as milliseconds). Returns 0 if: invalid entity, entity not animated mesh, no animation set (currentAnimationIndex < 0), animatedMesh pointer null.
This function queries animation metadata for timing/synchronization. Animation duration from glTF file (embedded in .glb loaded with b3dLoadAnimMesh). Use for: (1) Progress bars (currentTime / totalLength), (2) Event scheduling (play sound at 50% through animation), (3) Loop detection (if animTime >= animLength, reset), (4) Animation blending (start transition N milliseconds before end). Millisecond precision sufficient for game logic (not frame-accurate). Common pattern: length = b3dAnimLength(character), If b3dAnimTime(character) >= length - 500 Then TriggerFootstepSound(). Duration constant for animation - safe to cache (doesn't change unless b3dAnimate switches animation). Different sequences may have different durations. Use with b3dAnimSeq to identify which animation currently playing. Zero return ambiguous (could mean no animation or genuinely zero-length). Check b3dAnimating to distinguish. Alternative: b3dAnimTime returns current playback position, b3dSetAnimTime sets position. Frame count not exposed - glTF stores keyframes at arbitrary timestamps, not fixed frame rate.