Ogre Animation with obj file

Is it possible to use ogre bone animation on an obj file, without converting it?

If not, what could be done?

Why not just bring the OBJ into Blender and setup the animation there?

The OBJ format does not support bone animation (or any form of animation, for that matter). So you can’t magically import OBJ with animation.

Momoko_Fan said:
The OBJ format does not support bone animation (or any form of animation, for that matter). So you can't magically import OBJ with animation.

I think he's talking about applying a bone animation from an OGRE file to geometry from an OBJ object.

@DarkPhoenixX The only way I could think of automating this would be to have the same hierarchies and to reconstruct the mesh.. seems like a lot of work for something that's pretty simple in Blender

.Mhh, sounds difficult! :frowning:

It’s not like i hate blender, i hate the idea to create a bone skeleton for each model.

It would be nice, if i can use one default bone skeleton and apply it to an OBJ, like sbook mentioned. How about converting the OBJ on the flight inside jME?

Like was mentioned, you can’t generate a skeleton for an arbitrary model. You can share skeletons and animations with many models, but the verticies of every model must be bound to specific bones in that shared skeleton. You can’t generate this information automatically because every model is different, if you created the shared skeleton for a tall character, you can’t somehow determine the bone weights for a short character since their layouts are different.

If you want to share skeletons, you must take your shared skeleton and apply its bone influences to every model you have to make the skeleton work with all those models.

I’m not sure how well OGRE handles the trax editor in Maya, but you might be able to use the tool to work the animations over a number of models and then export them separately… Just a thought (I think I remember right that you use Maya, if not… My apologies!)

Ya, i know the problem with tall to small characters, but the characters i use have the same size.

It’s more about the clothing, face and small details.

I looked a bit inside ogre xml and I think it’s ok for my purpose.

So which programm should I choose, to create the Bones and to export the model? You have more experience than me x)

I guess Blender. Any good Ogre XML Skeleton Tutorials you want to recommend me?

Why would you want bones if you already have the .obj animation? .obj exports animations as frames of the model’s vertices in the animated positions, whereas bones gives the initial vertex positions of the model and uses the bones to tell jm3 how to transform the vertices over the animation. Its a tradeoff… either use heaps of memory to store all the vertex positions of the animation like stop frames, or use heaps of calculations to correctly position the vertices over time. Applying bones to all the .obj files would only increase memory useage. If you wish to extend an .obj animation using bones, you would only need to import the firts .obj file into Blender (eg) and create an armature for it.

Using obj meshes for Ogre bone animations can work, if you write a converter from normal meshes to ogremeshes, in addition you would need a facitlity which rewires bonebindings (mesh x should attach to bone y). it is doable if you have coding exp. if not, well,…

Skeleton sharing should be also possible to some extent (scaling by a small fraction up or down), I’m currently working on scaling for my implementation of a shared mesh/anim/skeleton model.

You cant use OBJ files for bone animation. It is impossible because OBJ does not contain bone-weight mappings for verticies, skeleton information, or animation data.

It is possible however to export an OBJ file for every frame of an animation, but then it is no longer bone-animation, it becomes vertex-animation.

Vertex-animation is more limited because it does not support attachments, animation blending, and some other features, it is also uses significantly more space.

Sorry this reply is so late after the initial questions but there is a solution to this, although the .obj specification doesnt support animations natively, by simply augmenting it with a seperate .anm file you can get brilliant albeit boneless animations.

Have a look at:- http://www.sanguinelabs.co.uk/expose/product.php?id=wastudio

This provides a very easy to use “animation maker” as well as the open-source model library (for OpenGL).

Note: It was developed as the obj file format is widely used yet difficult to animate… just as you stated.

None of the major modelling tools support this format. We will not add support for it.