I'm creating a 3D-Frogger clone with Ogre and I'm using Blender 2.63 for the modelling and the animation. To export the .mesh I use the Blender2Ogre-Exporter from http://code.google.com/p/blender2ogre/. Now I'have the following 2 problems:
The animation doesn't look in Ogre as is it looks in Blender. This is the main problem.
I have to use "my_animation" to use the animation, and can only use one animation.
Can someone please have a look at the attached blender file and tell me, what I'm doing wrong. The most important thing is that the animation loos exactly the same in Blender and in Ogre. And the other thing is I would like to know how I can define multiple animations in the same .blend file and give apropiate names like "idle", "jump", etc.
I'm very new to both Blender and Ogre. I' ve searched a lot but I didn't find a working solution. Thank you very much for your help!
You do not have the required permissions to view the files attached to this post.
ok, again a problem of global rotation, translation and scaling in blender that is ignored by the exporter (you should get an error-message about that).
First go into the Action Editor and delete the keyframes for LocRotScale at the bottom. it won't change anything but will mess things up if you keep it while applying the transform in the next step. While you are there you can also delete the keyframes for Leg.L and Leg.R since blender can't find the bones anymore.... I guess you deleted these bones or renamed them.
Next step: go into Object Mode (!) and select your model (you might want to disable the auto-recording of keyframes) and press ctrl+a to open the apply-menu. Apply Location, Rotation and Scale of the model. (You need to re-open the menu each time). After that, select the Skeleton and apply everything to it, too.
After this your model should export fine with this animation.
If you want to export more than one animation and give them names you need to convert your actions to nla strips:
go to the nla-editor, choose an action and hit the 'snowflake'-button next to it. this will create an nla-strip based on the action. Note that blender will create a new nla-track for each new nla-strip. you can keep the strips in different tracks or move them into one and delete the others.
The exporter will export every nla-strip as an animation and give the animation the strip's name. One thing to pay attention to is, that nla-strips that are overlapping on the time-line will influence each other when exporting. The newest version of the exporter has an option to disable this influence.
Press the N key when mouse hovering over the 3D viewport to open the properties panel, and at the top of it look at "transformation".
Notice that armature and model have a different position and scale. That is the problem.
What I did: select armature, then
CTRL+A > Apply Location
CTRL+A > Apply Rotation & Scale
then select the frog mesh, and do the same thing.
Try exporting it now.
Hint: use OgreMeshy to preview your Ogre mesh. Very useful is the "show bones" feature, so you can verify whether the bones are properly aligned with the model.
Thank you very much for your answer. The advice with the NLA was very helpful. Unfortunately the animation still doesn't work. I made another one, where the frog only turns his head, but I had no luck. What do I have to select, when I add a keyframe with "I"? I have attached the actual state of the blender file to this post. Thank you again.
You do not have the required permissions to view the files attached to this post.
Thank you Waruck and duststorm.
I don't have OgreMeshy installed because it's linked against Ogre 1.8. I'm using the version 1.7.4-3 of Ogre (it comes with the Ubuntu 12.04 repository) Should I switch to Ogre 1.8?
I'll have to build it from the source. Could changing to the latest version be the solution?