CountAnimSeqs
Number of animation sequences of an entity.
CountAnimSeqs ( entity )
Parameters
- entity
- entity handle
Description
Returns the number of animation sequences an entity has, or 0 if it is not animated. Sequences are numbered from 0 to CountAnimSeqs(entity)-1.
The count includes sequences added with LoadAnimSeq, ExtractAnimSeq and AddAnimSeq.
Example
; Animation sequences by name (ArcBasic extensions); Space plays the next animation, Escape quitsGraphics3D 640,480SetBuffer BackBuffer()camera=CreateCamera()PositionEntity camera,0,.6,-2CameraClsColor camera,150,200,240light=CreateLight()RotateEntity light,45,30,0; a Kenney character (www.kenney.nl, CC0) with its animations built inhero=LoadAnimMesh("../../../media/kenney/mini-characters/character-knight.glb")TurnEntity hero,0,180,0; play the animation called "walk"Animate hero,1,.5,FindAnimSeq(hero,"walk")While Not KeyDown(1) If KeyHit(57) ; step through every animation the model has seq=(AnimSeq(hero)+1) Mod CountAnimSeqs(hero) Animate hero,1,.5,seq,6 EndIf UpdateWorld RenderWorld Text 0,0,"Animation "+AnimSeq(hero)+" of "+CountAnimSeqs(hero)+": "+AnimSeqName$(hero,AnimSeq(hero)) Text 0,15,"Space: next animation" FlipWendEnd
