OGRECave / blender2ogre

Blender exporter for the OGRE 3D engine
GNU Lesser General Public License v2.1
211 stars 69 forks source link

Skeleton is not exported correctly #142

Open vido89 opened 2 years ago

vido89 commented 2 years ago

After exporting my rig and animations with ogre exporter and importing them back with ogre importer in blender here is how my skeleton looks like

S

and here is blend file

vido89 commented 2 years ago

simplescreenrecorder-2022-06-06_15.48.20.mkv.zip

vido89 commented 2 years ago

I tried so see animation with ogre-meshviewer but it's mess like you can see it in video above

Derinzed commented 2 years ago

I am also experiencing this. have you found any solution?

sercero commented 2 years ago

Yes, sorry but the importing of skeleton rigs is very hit and miss.

The problem is that OGRE and Blender have very different ways of modelling a bone.

For example, in Blender bones have a head and a tail.

But in OGRE bones consist only of a position and a direction, so you have to assume that there is a chain of bones, otherwise you just can't know what is the length of a bone.

There is an alternative bone importing code, I don't know if I put it there.

It was me that integrated the importer into blender2ogre, it used to be a separate proyect.

When I did the testing I used the meshes that come with OGRE (the ninja, Sinbad and a fish).

The results were poor for all of them unfortunately, the funny thing is that you can fix one and break the other when programming the assumptions required to fill the missing information.

There is a thread where @darksylinc explains this in better detail.

Mostly the issue is that when you convert from Blender --> OGRE you have to take into account that information is lost.

OGRE meshes are tuned for best realtime performance, while Blender files have a lot of additional information.

sercero commented 2 years ago

One thing I can think of as a compromise solution is to put in the alternative code for bone importing and have an option to choose one or the other to see which one gives the best results.

Derinzed commented 2 years ago

Thanks for the reply. Does the export feature work correctly? I'm ok not being able to import the bones as long as I know that the exported bones are correct when loaded into my Ogre project

sercero commented 2 years ago

You can check the exported bones with OGRE Meshy, but they should be OK in general.

You could have trouble with special IK bones o other helper bones for rigging but the ones marked asdeformables should work OK.