Skip to content

ExtractAnimSeq

Narta Xaymar Dirks edited this page Oct 28, 2026 · 5 revisions
Blitz3D

ExtractAnimSeq

ExtractAnimSeq:Int32 entity:Int32, first_frame:Int32, last_frame:Int32, anim_seq:Int32=0
Parameter Mode Type Default Description
entity In Int32 required The animated entity.
first_frame In Int32 required First frame of the clip.
last_frame In Int32 required Last frame of the clip.
anim_seq In Int32 0 Sequence to take the frames from. Defaults to 0.

Returns: The number of the new sequence, or -1 if the entity has no animation.

Description

Cuts a range of frames out of an existing sequence and makes it a sequence of its own, which is how you split one long animation, as MD2 files and many exporters produce, into walk, run and idle clips that can each be played with Animate.

Examples

; Split a long animation into clips; the frame numbers come from your model.
Graphics3D 320, 240, 0, 2
SetBuffer BackBuffer()
camera = CreateCamera()
light = CreateLight()

hero = LoadAnimMesh("hero.b3d")
PositionEntity hero, 0, -1, 5

walk = ExtractAnimSeq(hero, 1, 30)
run = ExtractAnimSeq(hero, 31, 50)
Animate hero, 1, 1, walk

While Not KeyHit(1)
	If KeyHit(57) Then Animate hero, 1, 1, run
	UpdateWorld
	RenderWorld
	Flip
Wend

Related Commands

AddAnimSeq, AnimLength, AnimSeq, AnimTime, LoadAnimSeq, MD2AnimLength, MD2AnimTime, SetAnimKey

Home · Command Index



Differences
Language Features
BlitzBasic
Blitz3D
BlitzPlus

Clone this wiki locally