So to recap what have i tried in all together.
X. format.
Exported mesh and animations. in mesh editor it didn't recognize seperate material parts and left the skinning weights out from head. this could be fixed with manually skinning the head part in mesh editor. Most workable but not something that anyone would like to do.
Collada. format.
Exported same mesh with same animations and used the same code.
This time everything worked in mesh editor but when i tried to add the character to the game. Nothing worked. The vertexes flexed in different directions and didnt really animate anything.
PSK. format
Exporter again the same mesh with same animations.
Everything worked in mesh editor and the character came intact all the way to the game. only thing was nothing was animated at all.
I have 64x max2009 and used the latest releases of exporters.
The collada exporter had some different settings than the one in the screenshot.
Tried also reskinning the mesh and doing it all again. same results.
Everytime i used biped skeleton. renamed it in Mesh editor.
I dont see how the bonestructure could affect if the same bones and meshes worked with x.format
Also don't understand how with psk and dae everything works up to mesh editor but in game gets weird.
in my code im using extended chr class. (Remember this worked fine with x format)
enemy.h
Code:
#pragma once
/*
This is the enemy class
*/
struct Enemy : Game::Chr // extend character class by defining a player class based on the character
{
void create(Game::ObjParams &obj);
void setAnim();
virtual Bool update(); // here we'll update the player (please note that this is a virtual method)
virtual void draw(); // extend drawing to disable head rendering in FPP mode
};
enemy.cpp
Code:
#include "stdafx.h"
#include "Enemy.h"
Bool Enemy::update()
{
// Actions
// set animations
if(Kb.bp(KB_1))
{
ragdollEnable (); // switch to ragdoll
}
else
{
cskel.animate(L"Anim/maid01/cooking.anim",Tm.time()); // animate with "cooking" 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 __super::update();
}
void Enemy::create(Game::ObjParams &obj)
{
__super::create(obj); // call default creation
sac.walk=&cskel.getSkelAnim("Anim/maid01/cooking.anim");
sac.stand=&cskel.getSkelAnim("Anim/maid01/cooking.anim");
}
void Enemy::draw()
{
__super::draw();
}