More B3D animation woes...

Community Forums/Developer Stations/More B3D animation woes...

Rage_Matrix(Posted 2004) [#1]
Hey there.

I've modelled my zombie, textured, skinning, boned and animated.
I've done a simple frame 0-100 frame idle animation. I've exported it using the latest version of B3D Pipeline making sure that the checkbox is ticked to export animation. I've then loaded it into Blitz3D and used this program to run the thing.

Const KEY_UP = 200
Const KEY_DOWN = 208
Const KEY_LEFT = 203
Const KEY_RIGHT = 205
Const KEY_A = 30
Const KEY_Z = 44


Graphics3D 800,600

SetBuffer BackBuffer()

font=LoadFont("Verdana",12,True)
SetFont font
Color 255,255,255

camera=CreateCamera()
CameraViewport camera,0,0,800,600
PositionEntity(camera, 0, 40, -5)
light = CreateLight()

zombie=LoadAnimMesh("zombie.b3d")
Animate(zombie, 1, 0.2)

PositionEntity zombie,0,0,40
ScaleEntity(zombie, 0.2, 0.2, 0.2)

While Not KeyHit(1)
If KeyDown(KEY_Z) Then
MoveEntity camera,0, -0.3, 0
End If
If KeyDown(KEY_A) Then
MoveEntity camera,0, 0.3, 0
End If
If KeyDown(KEY_LEFT) Then
TurnEntity camera,0, 1, 0
EndIf
If KeyDown(KEY_RIGHT) Then
TurnEntity camera,0, -1, 0
EndIf
If KeyDown(KEY_UP) Then
MoveEntity camera,0, 0, 0.3
End If
If KeyDown(KEY_DOWN) Then
MoveEntity camera,0, 0, -0.3
End If
UpdateWorld
RenderWorld
Text 1,1, "Zombie v25.0 Animation Test"
If (Animating(zombie)=True) Then
Text 1, 15, "B3D Model is ANIMATING"
Else
Text 1, 15, "B3D Model is STATIC"
End If
Text 1, 30, "Zombie X: " + Str(EntityX(zombie))
Text 1, 45, "Zombie Y: " + Str(EntityY(zombie))
Text 1, 60, "Zombie Z: " + Str(EntityZ(zombie))
Flip
Wend
End

Problem is, NOTHING HAPPENS! What am I doing wrong? The model loads successfully and looks fine and I'm pretty sure I don't need to use ExtractAnimSeq() as I've only got one animation at the moment.

If it helps, I'm using 3DS Max 4.2 and the bones were all done manually with HI Solvers as I don't have Character Studio.
The return from the Animating() function says true, but I'm not getting anything. I've had a look in the B3D Preview before exporting it to Max and its waaaay screwed up but at least its doing something. I get nothing at the moment, although it loads fine.
When I check the Export Bone Meshes option in B3D Pipeline and load into Blitz3D using the above, you can see the bones (as white meshes) animating fine. Its just that the actual model mesh does nothing.

Anyone help me out? I've got this desperate need to shriek "ITS ALIVE, ITS ALIVE! BWAHAHAAHAHAHAHA!!!" in an insane manner.

Thanks. :)


jhocking(Posted 2004) [#2]
I think the issue is how you rigged the character. I don't use B3D Pipeline so I don't know for sure, but I don't think it supports skeletal animation other than Character Studio.

By the way, 100 frames is a lot for an idle animation. Now that I think of it, maybe it is animating but you can't tell because it is so slow; try increasing the animation speed. In fact, now that I'm looking at your code, this seems very likely, because you have the animation speed DECREASED to .2

Oh, and your syntax for the Animate command is odd. I've never seen it done that way; the manual (and how I do it) is without parentheses, like:
Animate zombie,1


Big&(Posted 2004) [#3]
You will have to do a "findchild" for the name of your models skin.

So if the skin of the model in Max is called "Skin":

zombie=LoadAnimMesh("zombie.b3d")
zomanim=findchild(zombie,"Skin")
Animate(zomanim, 1, 0.2)

Hope this helps


Rage_Matrix(Posted 2004) [#4]
jhocking: This is my first animation, so its only a test really. Does it really matter how many frames you have for animation? Is there a size or memory disadvantage or something?

Big&: Thanks mate, your solution worked brilliantly. Thank you. :)