Blender Exporter & Animation in OGRE?

The place for artists, modellers, level designers et al to discuss their approaches for creating content for OGRE.
Post Reply
ArtOfWarfare
Gnoblar
Posts: 20
Joined: Wed Apr 25, 2012 2:57 am

Blender Exporter & Animation in OGRE?

Post by ArtOfWarfare » Sat Jul 14, 2012 1:08 am

Hi, I have made a mesh for use in my OGRE app in Blender (2.63a.) I was able to successfully export it from Blender and have it display in my OGRE app. Now I'd like to add some named animations to my mesh. For example, in Intermediate Tutorial 1, the robot mesh has animations named "Idle" and "Walk". The tutorial says this about the named animations:
But wait...where did we get ‘idle’ from? How did this magic constant slip in there? Every mesh has their own set of Animations defined for them. In order to see all of the Animations for the particular mesh you are working on, you need to download the OgreMeshViewer and view the mesh from there.
That's lovely and all, but I'm making my own mesh, which means I need to animate it myself.

So, my question is, how can I add named animations to my mesh? Preferably, I'd like a solution that uses Blender 2.63a, OGRE 1.8, and Blender Exporter 2.0.2(?). Having names isn't strictly necessary, but I obviously need some way to tell my various animations apart from each other.

Guidance would be very much appreciated! Thanks!
0 x

User avatar
duststorm
Minaton
Posts: 921
Joined: Sat Jul 31, 2010 6:29 pm
Location: Belgium
Contact:

Re: Blender Exporter & Animation in OGRE?

Post by duststorm » Sat Jul 14, 2012 1:27 am

Named NLA tracks in blender are exported as animations. You don't need to do anything different than you would create an animation library for an armature, the regular blender way.
0 x
Developer @ MakeHuman.org

ArtOfWarfare
Gnoblar
Posts: 20
Joined: Wed Apr 25, 2012 2:57 am

Re: Blender Exporter & Animation in OGRE?

Post by ArtOfWarfare » Sat Jul 14, 2012 6:00 am

I tried and ended up getting this error from OGRE:
An exception has occurred: OGRE EXCEPTION(5:ItemIdentityException): Entity is not animated in Entity::getAnimationState at /Users/davidrogers/Documents/Ogre/ogre-v1-8/OgreMain/src/OgreEntity.cpp (line 700)
A little Google reveals that the issue has to do with the lack of a skeleton for my mesh. But, unless I'm misreading the page for the Blender 2.5 exporter, I can't actually get skeletons from the exporter.

What do I do now? Either...
- Is the exporter page just old? Does the current exporter manage skeletons if they're used?
- Can I make a skeleton some other way for Ogre?

I thought I had more questions then those two, but I guess that's all.

Thanks for the help so far!
0 x

User avatar
duststorm
Minaton
Posts: 921
Joined: Sat Jul 31, 2010 6:29 pm
Location: Belgium
Contact:

Re: Blender Exporter & Animation in OGRE?

Post by duststorm » Sat Jul 14, 2012 11:00 am

I have only used hartsantlers exporter for blender 2.5/2.6
It works with armature, just attach an armature modifier to your mesh to link it with an armature, export and tick the skeleton checkbox.

You can verify whether a skeleton is exporter because there should be a .skeleton file along with your exported mesh.
Also make sure to have a look at any error messages in the console. For example ogre has a bone limit of 64 bones, add any more to your model and the skeleton will not be exported (or you will only have a .skeleton.xml file that cannot be converted to .skeleton by OgreXMLConverter).
0 x
Developer @ MakeHuman.org

ArtOfWarfare
Gnoblar
Posts: 20
Joined: Wed Apr 25, 2012 2:57 am

Re: Blender Exporter & Animation in OGRE?

Post by ArtOfWarfare » Sat Jul 14, 2012 1:51 pm

duststorm wrote:I have only used hartsantlers exporter for blender 2.5/2.6
It works with armature, just attach an armature modifier to your mesh to link it with an armature, export and tick the skeleton checkbox.
I believe we're talking about the exact same exporter, given if you click on the link I gave in my OP, and then click on the link after "Thread with unofficial download" you end up at the page you just gave a link to...

Hm, I just realized that it does list .skeleton in User Preferences as something it's capable of exporting. I'll try to use a skeleton to animate my mesh now. I'll post back with results. Or just edit this one if I have results before anyone else posts, I guess.

Edit: And... everything works!

Except my frame rate looks pretty horrid... I'm not really sure...

Adding a log to my render loop... it looks like it's trying to draw 60 times a second but about 7 times a second it fails to? Or something.
0 x

devilvkws
Gnoblar
Posts: 2
Joined: Thu Jun 21, 2012 5:14 am

Re: Blender Exporter & Animation in OGRE?

Post by devilvkws » Mon Jul 30, 2012 10:59 am

Hi,

Just want to ask if your model have different parts that is control by a single skeleton (eg. body, helmet, weapon as separate mesh)? Or you only have 1 mesh with 1 skeleton?

I'm having some problem with multiple parts that is control by 1 skeleton inside blender. When I export them, those part become separate .mesh files and I have multiple skeleton files.

I'm trying to use "merge" to export all parts as 1 .mesh file, but the skeleton info is not exported. Does any one know how to solve this problem?

Thanks.
0 x

Demarii
Gnoblar
Posts: 18
Joined: Thu Jan 26, 2012 2:58 am
Location: Canada

Re: Blender Exporter & Animation in OGRE?

Post by Demarii » Tue Jul 31, 2012 7:32 pm

Disregard the multiple skeletons, they are exactly the same if in blender all sub-meshes are bound to the same skeleton. What you want to do is open up the XMLversion of each mesh and change the skeleton section to all point to the same skeleton file and then recompile those into binary format and just provide the one skeleton file and these will all animate together.
0 x

User avatar
dpakatheman
Gnoblar
Posts: 23
Joined: Tue Nov 13, 2007 10:33 pm
Contact:

Re: Blender Exporter & Animation in OGRE?

Post by dpakatheman » Tue Aug 14, 2012 9:50 pm

Might be worth giving my new FBX exporter a try. I've tested Blender-created FBX files, and they work. You can get a .SKELETON and .MESH file that way. (I do not believe morph info is output to the FBX file in the Blender exporter, but you can certainly get skeleton animations to work).

Here is some more info:
http://www.ogre3d.org/forums/viewtopic.php?f=8&t=71332
0 x

Post Reply