ArcBasicDocs

help/commands/3d_examples

FindAnimSeq.abs

33 lines of ArcBasic. Words in colour that are commands link to their help page. To run it, download ArcBasic, open the file and press F5.

Download FindAnimSeq.absAll files in this folder

FindAnimSeq.abs
; 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