Defines animation sequence from frame range (splits long animation into named clips like walk/run/idle).
Takes entity (animated mesh entity handle), sequenceIndex (sequence ID 1-based, user-defined number like 1=walk 2=run 3=idle), startFrame/endFrame (frame range, converted to seconds using global FPS), speed (playback speed multiplier, 1.0 = normal, 2.0 = 2x fast, 0.5 = half speed).
Returns nothing.
3D Graphics
Parameters & Returns
Parameters
entityInt
sequenceIndexInt
startFrameInt
endFrameInt
speedDouble
Returns
Void
Quick Summary
Defines animation sequence from frame range (splits long animation into named clips like walk/run/idle).
Takes entity (animated mesh entity handle), sequenceIndex (sequence ID 1-based, user-defined number like 1=walk 2=run 3=idle), startFrame/endFrame (frame range, converted to seconds using global FPS), speed (playback speed multiplier, 1.0 = normal, 2.0 = 2x fast, 0.5 = half speed).
Returns nothing.
Technical Exegesis...
Defines animation sequence from frame range (splits long animation into named clips like walk/run/idle). Takes entity (animated mesh entity handle), sequenceIndex (sequence ID 1-based, user-defined number like 1=walk 2=run 3=idle), startFrame/endFrame (frame range, converted to seconds using global FPS), speed (playback speed multiplier, 1.0 = normal, 2.0 = 2x fast, 0.5 = half speed). Returns nothing.
Defines animation sequence from frame range (splits long animation into named clips like walk/run/idle). Takes entity (animated mesh entity handle), sequenceIndex (sequence ID 1-based, user-defined number like 1=walk 2=run 3=idle), startFrame/endFrame (frame range, converted to seconds using global FPS), speed (playback speed multiplier, 1.0 = normal, 2.0 = 2x fast, 0.5 = half speed). Returns nothing. Converts frames to time using g_animFPS (startTime = startFrame / fps, endTime = endFrame / fps), stores AnimSequence in entity.animatedMesh.sequences map (indexed by sequenceIndex, persistent until overwritten). Use to split long animations into clips (single GLB file with walk/run/jump frames, define sequences for each), organize animation library (named sequences easier than frame numbers, walk = seq 1, run = seq 2, etc.), or control playback speed per-sequence (walk speed 1.0, run speed 1.5 for faster running). Frame-to-time conversion: uses global FPS setting (set via b3dSetAnimFPS, default 24 FPS), frame numbers from animation authoring tool (Blender timeline frames, Maya frames, etc.), converted to seconds for engine playback (frame-based workflow -> time-based playback). Sequence indexing: 1-based like Blitz3D (sequence 1, 2, 3, etc., not 0-based), user-defined numbers (any positive integer, typically 1-10 for common animations), no limit on sequence count (map stores arbitrary indices, can define 100+ sequences). Use cases: (1) Character animations (seq 1 = idle frames 0-30, seq 2 = walk frames 30-60, seq 3 = run frames 60-90), (2) Combat animations (seq 10 = attack1 frames 100-120, seq 11 = attack2 frames 120-140), (3) Speed variations (seq 1 = walk speed 1.0, seq 4 = fast walk speed 1.5 same frames different speed), (4) Multiple characters (each character entity has own sequences, same file different frame ranges). Common patterns: setup = b3dSetAnimSeq(player, 1, 0, 30, 1.0) idle, b3dSetAnimSeq(player, 2, 30, 60, 1.2) walk, b3dSetAnimSeq(player, 3, 60, 90, 1.5) run; single animation = b3dSetAnimSeq(prop, 1, 0, 120, 1.0) entire animation as sequence 1. Typical sequences: idle (seq 1, looping, slow or speed 1.0), walk (seq 2, looping, speed 1.0-1.2), run (seq 3, looping, speed 1.3-1.8), jump (seq 4, once, speed 1.0), attack (seq 5-10, once or pingpong, speed 0.8-1.5). Speed multiplier: 1.0 = normal (plays at authored speed), <1.0 = slower (0.5 = half speed, 0.1 = very slow), >1.0 = faster (2.0 = double speed, 3.0 = triple), combined with animation speed (sequence speed x b3dAnimateSeq speed parameter = final playback speed). Sequence storage: stored in animMesh.sequences map (persistent, survives until entity destroyed or sequence overwritten), indexed by sequenceIndex (sequences[1] = idle, sequences[2] = walk, etc.), AnimSequence struct contains startTime/endTime/speed (float values, seconds and multiplier). Per-entity sequences: each animated mesh entity has own sequence library (player and enemy can have different sequences for same file), sequences don't transfer (loading new mesh doesn't copy sequences, must define again), sequences persist (once defined, remain until entity destroyed). Validation: only affects ENTITY_ANIMATED_MESH (non-animated entities ignored, static meshes no-op), silent if entity not found (invalid handle or wrong type, no error), accepts any sequence index (positive integers, no validation, user manages indices). Prints confirmation: stdout message shows sequence definition (debugging feedback, frame range and time conversion visible), useful for verifying FPS conversion (check if frames -> seconds correct for FPS setting). Related: b3dSetAnimFPS sets global FPS (affects frame-to-time conversion, set before defining sequences), b3dAnimateSeq plays sequence (uses sequenceIndex to look up and play defined sequence), b3dAnimate plays frame range (alternative, direct frame playback without defining sequences first), b3dLoadAnimMesh loads animated mesh (call first, then define sequences on loaded entity).