Character animation.
Blitz3D Forums/Blitz3D Programming/Character animation.
| ||
How are most people doing character animation in Blitz. I've got some pretty good character models but I would like to do animation blending. Is anyone doing else this? I really, don't want to animate every transition between anim sequences so any help is greatly appreciated. Thanks, Allan |
| ||
If you look up Animate in the help file, you'll see that it has a Transition field which allows you to specify an amount of time which it should take to transition from the current stance into your new animation. Animate entity,[,mode][,speed#][,sequence][,transition#] transition# (optional) - used to tween between an entities current position rotation and the first frame of animation. Defaults to 0. |
| ||
Hambone, Gabriel is absolutely correct, but incase you need some more detailed help here... I have found that the best method to cope with animating characters is based around a mesh which is skinned and rigged and ready to have animation sequences loaded and applied to it. You need to export the animations as separate files, with names which are easy to associate the animations with (just for good workflow). Global player=LoadAnimMesh("Mesh.b3d") ; Load the static mesh with bones in place Global QA_run=LoadAnimSeq(player,"Mesh_run.b3d") ; load sequence one Global QA_slide=LoadAnimSeq(player,"Mesh_halt.b3d") ; load stop running Global QA_fallbackwards = LoadAnimSeq (player,"Mesh_Fall_Backwards.b3d") ; load fall backwards Global QA_walk=LoadAnimSeq(player,"Mesh_walk.b3d") ; load sequence two Then you need to find the bone root - which will allow you to animate the character Global playeranim=FindChild(player,"Root_name") ; find the animatable root bone Then check for which anim you need and set a variable for which animation to use next. Then call that sequence, I also use animspeed and transitionspeed variables as follows: animspeed# = 1.0 transpeed = 10 (10 frames to transition between each animation sequence) Animate playeranim,1,animspeed,QA_run,transpeed Using this method allows tight control over exactly when and where your character animates and in what manner. Should you need to know or even set exactly when an animation frame is in motion, you can use: SetAnimTime AnimTime or SetAnimKey I think you may also need to be aware that if you use the animate command - everything is controlled automatically on UpdateWorld, so to use SetAnimKey you may need to keep that kind of 'constraint' in mind. You really just need to play with every command available to you in B3d to get an idea of the power you actually have. Hope that helps. IPete2. |
| ||
Awesome. Thanks. You guys are the best. |