About Store Forum Documentation Contact



Post Reply 
Animation Problem (Solved)
Author Message
kuklainteractive Offline
Member

Post: #1
Animation Problem (Solved)
Hi

I changed 01-Animation tutorial for own own project.

I will press space girl is run and I leave space button girl is idle animation. I modified 01-Animation Tutorial for use own model and animation. Girl is load well but if I press space animation not streaming onliy frezen run animation.

Please help me, wat is the wrong?

PS: Bekle.anim //Turkish mean idle
Kos.anim // Turkish mean run
IsKadini..mesh // Turkish mean businnes woman

/******************************************************************************/
#include "stdafx.h"
/******************************************************************************/
CSkeleton cskel;
/******************************************************************************/
void InitPre()
{
App.name("Animation");
App.flag=APP_MS_EXCLUSIVE;
Paks.add("../data/engine.pak");
D.ambientPower(0.1f);
}
/******************************************************************************/
Bool Init()
{
Cam.dist=2;
Cam.yaw =PI;

cskel.create(Skeletons("../data/obj/chr/kadin/IsKadini.skel"), 1.7f); // create controlled skeleton from skel file, with 1.7 meter height
return true;
}
/******************************************************************************/
void Shut()
{
}
/******************************************************************************/
Bool Update()
{
if(Kb.bp(KB_ESC))return false;
CamHandle(0.1f, 10, CAMH_ROT|CAMH_ZOOM);

// set animations
{
cskel.clear(); // clear controlled skeleton animation
if(Kb.b(KB_SPACE)) // when space pressed
{
cskel.animate(L"../data/obj/chr/kadin/kos.anim", Time.time()); // animate with "walk" animation and current time position
}
cskel.updateMatrix (MatrixIdentity); // update controlled skeleton animation matrixes
cskel.updateVelocities( ); // update controlled skeleton bone velocities (this is needed for Motion Blur effect)
}

return true;
}
/******************************************************************************/
void Render()
{
switch(Renderer())
{
case RM_PREPARE:
{
LightDir(Vec(0,0,-1), 1-D.ambientColor()).add(); // set light

Meshes("../data/obj/chr/kadin/IsKadini.mesh")->draw(cskel); // get mesh from cache and render it with controlled skeleton matrixes
}break;
}
}
void Draw()
{
Renderer(Render);

if(Kb.ctrl()) // when control pressed
{
if(Renderer.rebuildDepthNeededForDebugDrawing())Renderer.rebuildDepth();
SetMatrix(); // restore default matrix
cskel.draw(RED); // draw controlled skeleton
}

D.text(0, 0.8f, "Hold space to animate");
}
/******************************************************************************/


Please download and see my files.
(This post was last modified: 03-13-2012 05:07 PM by kuklainteractive.)
03-10-2012 01:02 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #2
RE: Animation Problem
You didn't attach the files.

Is the animation set in "looped" mode in Editor/Model Editor/Animation/Menu ?
does the animation play ok in the editor?
03-13-2012 01:49 PM
Find all posts by this user Quote this message in a reply
sivan Offline
Member

Post: #3
RE: Animation Problem (Solved)
hi,
I had the same problem, setting "looped" solved it, but it could be mentioned in the manual too that it should be applied for proper animation...
anyway, everything seems to work importing from Fragmotion by ms3d or b3d.
05-11-2012 02:09 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply