Blender export bone alignment problem

The place for artists, modellers, level designers et al to discuss their approaches for creating content for OGRE.
Post Reply
Nu11u5
Gnoblar
Posts: 8
Joined: Sun Jul 21, 2013 12:28 am

Blender export bone alignment problem

Post by Nu11u5 »

I am very new to Blender and working with Ogre files, and I've been trying to learn a few things modeling and rigging a new model for the game Torchlight2. I've run into a problem, though, with the armature and bones becoming misaligned after export. I've done some research and have yet to find reports or solutions regarding anything like what I am getting.

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).

Image

However, when I go and immediately export the model using the Blender2Ogre addon and reopen it in Blender I get the following.

Image

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>
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>
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!

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?
Last edited by Nu11u5 on Sun Jul 21, 2013 11:37 pm, edited 2 times in total.
Nu11u5
Gnoblar
Posts: 8
Joined: Sun Jul 21, 2013 12:28 am

Re: Blender export bone alignment problem

Post by Nu11u5 »

And one more note, I have already tried applying any local transforms to the model before exporting (I couldn't find any that existed but applied them anyway).
Nu11u5
Gnoblar
Posts: 8
Joined: Sun Jul 21, 2013 12:28 am

Re: Blender export bone alignment problem

Post by Nu11u5 »

This is what I get when I export an animation (as seen in Blender, the Torchlight Mesh Viewer, and Ogre Meshy). Note how the deformation no longer aligns with the bones, and that the bones are now pointing different directions.

Blender 2.6 - Correct
Image


Torchlight Mesh Viewer - Wrong
Image


Ogre Meshy - Wrong
Image
Post Reply