Anim8or Animation Question
Blitz3D Forums/Blitz3D Beginners Area/Anim8or Animation Question
| ||
I made a walking sequence with Anim8or. I first saved it as an anim8or (.an8) file and then exported it as a 3ds file. When I did: LoadAnimMesh("Player.3ds") and then did Animate player\entity,1,1,0,60 It said that this entity had no animation. I also tried LoadAnimSeq(player\entity,"Player.3ds") and that didn't work either. What am I doing wrong? I don't know whether the 3ds has the animation in it, even though I exported it in the animation mode. I also assume blitz can't read an8 files can it? |
| ||
Answered here. [jfk EO-11110] You should mention that Anim8or does not allow to export animated 3DS and therefor its animation features are useless for Blitz Coders. Instead you can use PaceMaker to create Bones Animations for .B3D Files. the light Version is also Free: www.freewebs.com/smiff/pacemaker.htm (Download URL at the page bottom) PaceMaker is one of the very few free Animation Tools. |
| ||
Everyone told me I should use Anim8or. ARRRR!!! Well, I'll download PaceMaker. |
| ||
Apparently, the download link has been temporarily removed so that they can make updates to PaceMaker. ARRR!!! Why can't they leave it up there? |
| ||
Grantyt3: Have you tried An8tob3d tool for this? |
| ||
What's that? I downloade gameSpaceLight anyways. Oh... Is that a conversion tool? Where do I get it? |
| ||
I downloaded An8tob3d and it worked for one file, but It won't work with the file I'm trying to convert. WHY!!! |
| ||
I don't know. I have not tested it myself yet. Its still early in development, beta. You should email the author and see if he can help. I think that Anim8tor could be a great tool for blitz if this is resolved. |
| ||
I just remade the file and it worked. |
| ||
I finally tried the B3D file I got out of An8tob3d and it doesn't say that it has no animation, but it just doesn't do the animation. I have Animate player\entity,1,1,0,60, and LoadAnimMesh but it doesn't work. |
| ||
The only thing I can think of is to make sure you have both the model and the animation files in the folder with your game, but you probly did that already. Oh ya also try using ExtractAnimSeq. I do it like this. ;globals ;ninja animation sequences Global Walk Global Stealth Global PunchSwipe Global Overhead Global Block Global ForwardKick Global Pickup Global Jump Global JumpNoHeight Global HightKill Global SideKick Global SpinAttack Global BackFlip Global Climb Global Death1 Global Death2 Global Idle1 Global Idle2 Global Idle3 player_mesh=Get_NinjaAnima(player_mesh) ;in the main loop If (Animating(player_mesh) <> True) Or (AnimSeq (player_mesh) <> PunchSwipe ) Animate player_mesh,3,.5,PunchSwipe EndIf Function Get_NinjaAnima(anim) anim=LoadAnimMesh("bot/PMKninja.b3d") Walk=ExtractAnimSeq(anim,1,14) Stealth=ExtractAnimSeq(anim,15,30) PunchSwipe=ExtractAnimSeq(anim,32,44) Overhead=ExtractAnimSeq(anim,60,68) Block=ExtractAnimSeq(anim,69,72) ForwardKick=ExtractAnimSeq(anim,73,85) Pickup=ExtractAnimSeq(anim,84,93) Jump=ExtractAnimSeq(anim,96,102) ;Jump2=AddAnimSeq(anim,98,100) JumpNoHeight=ExtractAnimSeq(anim,103,111) HightKill=ExtractAnimSeq(anim,112,125) SideKick=ExtractAnimSeq(anim,126,133) SpinAttack=ExtractAnimSeq(anim,134,145) BackFlip=ExtractAnimSeq(anim,146,158) Climb=ExtractAnimSeq(anim,159,165) Death1=ExtractAnimSeq(anim,166,173) Death2=ExtractAnimSeq(anim,174,182) Idle1=ExtractAnimSeq(anim,184,205) Idle2=ExtractAnimSeq(anim,206,250) Idle3=ExtractAnimSeq(anim,251,300) Return anim End Function Also make sure you are not stuck on the first frame of the animation. If you are in the main loop you do something like this... if mymodel is not animating already then animate him end if |
| ||
I tried the "if my model is not animation already then" thing, but it still doesn't work. I know the file has animation, because I opened it in another program and it animated. Hmmm... Could I have done something wrong in the Animate player\entity command? I had it say whether it was animating or not, and it returned 1, so it must be animating. Except that if I use AnimTime#(player\entity) it says it's not animating, so I don't know which one it is. Also, AnimLength says the proper amount of frames |
| ||
Very strange. I fixed it. I changed the sequence number from 0 to 1. It didn't work before, but now it does. |
| ||
Uh oh, more problems. I made a second sequence in the player file. I have the walking sequence, and the attack sequence. Right now, it treats them like one and does it at the same time. How do I seperate the two and do them at different times? |
| ||
Make them one long sequence, remember the start and finish frames of the sequence and use something like the function above. Stealth=ExtractAnimSeq(anim,15,30) PunchSwipe=ExtractAnimSeq(anim,32,44) Then you can do something like this... if keyhit(57)=true then If (Animating(player_mesh) <> True) Or (AnimSeq (player_mesh) <> PunchSwipe ) Animate player_mesh,3,.5,PunchSwipe endif else If (Animating(player_mesh) <> True) then Animate player_mesh,3,.5,Stealth endif endif If you have lots of diferent animations you should use a case select, and you could use trigers rather than keyhits of course. For your problem I think you could also use LoadAnimSeq ( entity,filename$ ). But you would do this before animating and give it a handle, and use it the same. |
| ||
I did what RiverRatt said, but it's doing what it did before where it only does the first frame of the animation while the key is down instead of cycling through the whole thing. How do I fix this? |
| ||
Okay. I fixed the one frame thing. This is what's going on: 1.He animates only when you push the key 2.He has two animation sequences : Global walkseq = ExtractAnimSeq(player\entity,0,60) ;Walk Sequence Global attackseq = ExtractAnimSeq(player\entity,61,80) ;Attack Sequence 3. I told him to only do the walk sequence (These are the two ways I tried : 1.Animate player\entity,1,1,0,60 2.Animate player\entity,1,1,walkseq 4. BUT, it does the entire animation with both the walk and attack put together. Must have done something wrong. Does anyone know my mistake? |
| ||
Okay, nevermind. I figured it out. I don't know what I did, but it works now. I gotta stop writing these posts because I always figure it out before anyone can write back. Sorry. |
| ||
Now this one I can't figure out. When I walk forward, it works, but when I walk backwards (and I have the exact same code) it only goes to the first frame of animation. Same with spacebar when you attack. |
| ||
It sounds like you are using keydown(). Try using keyhit() for your atack. I will be able to help better if you show the code. |
| ||
Very odd. I fixed the backwards walk, again I don't know how I fixed it, but I did. The attack is still doing the same thing. It is the same code as the walk sequences too. I think what it is doing is animating when you push the button, but it's all written in such a way that when I told it to stop animating if no button was being pushed, that it's stoping each frame and messing up the animation. |
| ||
Well what you need mabye is an idle animation, so its always animating, and when you do something go forward, back or attack, and when those are done return to idle. |
| ||
I was going to add that later once I got this working, but I guess that would fix the problems. |
| ||
Is there a function that tests if no keys are being pushed? |
| ||
Is there a function that tests if no keys are being pushed? Just maintain a flag that turns True if any key has been pressed, allowing you to manage idle animation. |
| ||
But when would I make it false. It would just stay true until I told it to be false, but I would have to make it false if no key was being pressed, which brings me back to my original problem of testing if no key is being pressed. |
| ||
But when would I make it false. Just before you test for any keyboard input. That way you don't have to "test for nothing" because "nothing" becomes normative. EDIT: Like this - see how you can do things based on no key having been pressed after the input routines. Graphics 640,480,0,2 SetBuffer BackBuffer() keyPress=False output$="Blah" x=320 While Not KeyDown(1) keyPress=False If KeyDown(203) keyPress=True x=x-1 If x<-150 Then x=639 output$="Coo, I'm going left!" EndIf If KeyDown(205) keyPress=True x=x+1 If x>639 Then x=-150 output$="Coo, I'm going right" EndIf If keyPress=False Then output$="Awww, I am idle :/" Text x,240,output$ Flip Cls Wend |
| ||
Oh duh, I'm an idiot... :) |