Animated Mesh wont use orginal sequence?

Blitz3D Forums/Blitz3D Beginners Area/Animated Mesh wont use orginal sequence?

YellBellzDotCom(Posted 2012) [#1]
I loaded an animated mesh with 4 frames. Its an human model in an idle pose.

I also loaded a walking animation sequence.

This is the code used to load the model and sequence.
;--------------Load Player------------------
ClearTextureFilters
play1 = LoadAnimMesh("media/models/character/player/man_idle 1-13-2012.b3d")
LoadAnimSeq(play1,"media/models/character/player/man_walk_forward.b3d" ) ;WalkAnimation	1
LoadAnimSeq(play1,"media/models/character/player/man_idle 1-13-2012.b3d" ) ;IdleAnimation	2


This is the code I use for making the character walk. Everything works fine, but when the character stops walking, hes supposed to go back to the idle stance. He does stop moving, but it stays in 1 of the frames from the walking animation. Real weird.
	If KeyDown(17) And KeyDown(30) ;wa
		RotateEntity play1,0,-135,0
		z#=-speed
		anState = 1
		dir = 5
	ElseIf KeyDown(17) And KeyDown(32) ;wd
		RotateEntity play1,0,135,0
		z#=-speed
		anState = 1
		dir = 6
	ElseIf KeyDown(31) And KeyDown(30);sa
		RotateEntity play1,0,-45,0
		z#=-speed
		anState = 1
		dir = 7
	ElseIf KeyDown(31) And KeyDown(32);sd
		RotateEntity play1,0,45,0
		z#=-speed
		anState = 1
		dir = 8
	ElseIf KeyDown(17);w
		RotateEntity play1,0,180,0
		z#=-speed
		anState = 1
		dir = 1
	ElseIf KeyDown(30);a
		RotateEntity play1,0,-90,0
		z#=-speed
		anState = 1
		dir = 2
	ElseIf KeyDown(31);s 
		RotateEntity play1,0,0,0
		z#=-speed
		anState = 1
		dir = 3
	ElseIf KeyDown(32);d
		RotateEntity play1,0,90,0
		z#=-speed
		anState = 1
		dir = 4
	Else
		anState = 0
	End If
	
	Select anState
		Case 0
			;no animation
			If AnimSeq(play1) <> 2 Then Animate play1,1,0,2
		Case 1
			;walk animation
			If AnimSeq(play1) <> 1 Then Animate play1,1,anSpeed,1
	End Select


I tried loadanimseq on the original mesh file I loaded so that I would have another idle sequence I could use, but that didn't work either. I have a text flag in game showing which animseq the mesh is in and it shows up properly, 0 when not moving, 1 when moving. The problem is, when the character is not moving, he is still in the last frame from the walking animation instead of switching to the idle animation which has the same pose in all 4 animations.

If anyone can lend a hand, that would be outstanding!

Thanks!

Last edited 2012

Last edited 2012


YellBellzDotCom(Posted 2012) [#2]
I believe something is wrong with the exported models. Trying to pinpoint it now. Using max8 and b3d pipeline.

If I unhide the bones, and select all in the b3d export window, the preview window shows the model animated correctly and the bones are visible.

After I use this exported model in a b3d model view program, just the bones are animating. I'm wondering if there is a problem with the skin modifier.

Last edited 2012


RemiD(Posted 2012) [#3]
First, you may want to test your code with this b3d animated models :
http://www.psionic3d.co.uk/?page_id=25

If a walk cycle with one of these models does not look as you want it to be, it means there is a probelm with your code.

When i animate a 3d character, usually i proceed in 2 steps :

First, the program checks the Player input and dertmines the CharacterState%

Second, the program moves, rotates, animates the CharacterMesh


YellBellzDotCom(Posted 2012) [#4]
Ok, I exported to b3d from max, checked out the heirarchy in fragmotion and noticed there were 2 animations in the file.

I messed around with exporting from max and importing to fragmotion while editing the model, skin, bones, etc and finally found out that if you have scene root checked in the b3d exporter of max, it will add the 2nd animation. Once I unchecked that, everything worked out great!

I hate stopping my programming hobby due to work, etc because I know I went through this years ago, lol.