When my own model was encountering problems I decided I would repeat the process using a stock mesh right out of the game, and I got the same results.
I use the following Blender addon to import the Ogre .mesh files from the Torchlight2 resource files.
https://code.google.com/p/torchlight-to-blender/
As you can see, the model imports just fine (the few oddly placed bones are location tags for the game engine).
However, when I go and immediately export the model using the Blender2Ogre addon and reopen it in Blender I get the following.
If you look closely you can see that all of the armature's bones have their heads in the right locations, but the tails have been rotated by ~90 degrees around an arbitrary axis. I opened up the Skeleton.xml files to see what was up.
Original (before)Code: Select all
<bone id="50" name="root"> <position x="-1.19209e-008" y="-0.00497141" z="3.57628e-008" /> <rotation angle="1.5708"> <axis x="-1" y="-0" z="-0" /> </rotation> </bone> <bone id="0" name="Bip01"> <position x="1.19209e-008" y="0.0121904" z="1.37682" /> <rotation angle="1.57079"> <axis x="-0" y="-0" z="-1" /> </rotation> </bone>
Note how the rotation axes have been transposed. I also tried exporting with the Torchlight-to-Blender addon and got the same results, only this time the entire armature was also rotated 90 degrees around a few axes!Exported (after)Code: Select all
<bone id="0" name="root" > <position x="-0.000000" y="-0.004971" z="0.000000" /> <rotation angle="3.141595" > <axis x="0.707107" y="0.707107" z="-0.000001" /> </rotation> </bone> <bone id="2" name="Bip01" > <position x="1.376820" y="-0.000000" z="0.012190" /> <rotation angle="1.570790" > <axis x="-1.000000" y="-0.000000" z="0.000000" /> </rotation> </bone>
The common elements for these workflows are Blender (v2.67b), the OgreXMLConverter tool (v1.7.2) the addons are dependent on, and the model itself after being loaded into or created from scratch in Blender.
Any idea what the problem is?