shriyam
24-08-2006 19:57:57
hi,
i'm relatively new to game dev. with ogre. we're importing meshes from half life to 3ds max and then using ofusion to get materials/ scene/ .mesh files for ogre.
when using oFusion sceneloader for loading the OSM file, only the skeleton gets animated and the mesh remains stationery...!
has anyone experienced this!?
i'd appreciate any suggestions/
thanks!
stickymango
25-08-2006 10:42:39
Hi,
Do you mean your skinned mesh remains static? If so I had this problem too because the OSM loader doesn't extract skeleton animation states for you, I added a test in the createEntities() function for a skeleton then extracted the attached animation/animationState for the skeleton passing it back to my update function.
Something like this:
// Check for skeleton animation and add to animation list
if ( pEntity->hasSkeleton() )
{
Skeleton *skel = pEntity->getSkeleton();
if ( skel )
{
Animation *anim = skel->getAnimation(0);
AnimationState *animState = pEntity->getAnimationState( anim->getName() );
if ( animState )
{
// Add to scene animation list
mAnims.push_back( animState );
}
}
}
Lioric
25-08-2006 16:53:59
As this is directly dependant on the users application, this is not part of the core loader process, but it should be implemented in the "onEntitiyLoaded" event that your application overrides, so you control how this behaves in your application
Lioric
26-08-2006 01:52:35
The file you sent to the support guys cant be reviewed as its not complete
The main animated object seems to be called "smdimport", you need to include this and the "smdimport.sekelton" file, but much better will be if you send the .max file not the .mesh files only
Have you tested with the comments above?
When you load the object in your application, is there any message in the ogre.log file about the skeleton load?
Is the skeleton file in the resource location paths?
When you get the AnimationState from the object, is there an exception or an assert produced?
shriyam
28-08-2006 00:13:00
As you mentioned:
the OSM loader doesn't extract skeleton animation states for you
I'm not using OSM Loader for the particular mesh, I use it to load the game map. All I do now is create the entity by specifying the mesh file and Im able to make it walk around playing the 'Walk' animation.
The problem now being, that when I export the mesh/ osm files from max, I'm getting just a single animation for the single mesh file exported! i.e. OSM file which Im assuming is supposed to have all the animations for a mesh file? and I can get and set animations states probing into this osm.
You can check the max file is at
http://www-scf.usc.edu/~bugga/boss.max and the max file for the map
http://www-scf.usc.edu/~bugga/office.max
Thank you for looking into this..
Lioric
28-08-2006 17:33:49
Skeletal animations are contained in the ".skeleton" files created (or in separated ".anim" files in the Pro version for single/group animations) with the same name as the .mesh file
To animate skeletal characters, you need the ".mesh" and the ".skeleton" files, when you load the mesh (i.e. when creating an entitiy) the skeleton file is loaded automatically, then you can get any exported animation with its name (as defined in the animation list) using the "getAnimationState" method of the entity, and enable it so it is played
I will download the file and review it
shriyam
31-08-2006 03:33:19
Im wondering if anyone found anything from the max files. I understand the problem little better now.
We downloaded certain objects (max files) for free from some website (like chairs/ table etc.).
These objects need to be scaled while placing on the map in 3ds max. Once scaled they look fine in Perspective view, but in the oFusion viewport I somehow lose the scaling factor and the object (say a chair) becomes really huge! And thats what happens if I export it and load it in Ogre. The map is messed up with such objects/
This is quite specific and I hope its something pretty minute that someone can point out.
Thank you
Lioric
31-08-2006 19:35:24
I reviewed your character scene (please next time send, or post test scenes that are ready to be tested, i had to create an animation for this character to test with)
In your specific scene, you need to hide any object but the character object, so you export just the animated character, this will result in a single .mesh, .skeleton, .material and a .osm files
You dont need to export the bone objects to mesh files, the bones are included in the .skeleton file
In the export dialog you will define the animations, in the animation list, each entry defines the start and end frames, its name and any other parameter that you might need
Your scene is correct, and exports correctly, the ".skeleton" file, as posted above, will contain all animations (in the CE version), then in your application you access those animations by its name, in the "entity->getAnimationState()" method, then you enable them or do what you need with the animation
You can refer to the skeleton animation demo that is part of the ogre sdk example aplications, you will see that is very easy to animate a skeletal character
I will review the other scene(s) later