Change up axis when importing from blender

When I was using Blender 2.49b and the ogrexml exporter, it had the option to have the y-axis as the up axis, and everything imported as it was supposed to.



Now I am using Blender 2.57 and I have found the Blender Importer in JMP to be extremely useful since the object names in Blender carry over to JMP. But there is no option, or I am not seeing an option, to change the up axis to the y-axis. So I switched the z-axis and the y-axis in Blender and that worked fine. But when I needed to apply rotations to the y-axis in Blender, the rotations were applied to the z-axis in JME (as expected). So my model will look wrong either in Blender or JME, and I know there are better options out there.



So is there any way to fix the up-axis issue with the Blender Loader, or am I going to have to use something else for now until it’s added? I tried exporting as an .obj which had the option to “Rotate X90” which seemed to help, but the object names didn’t carry over (as witnessed in SceneComposer).



I guess my goal here is getting my JME scene to look exactly how it does in Blender.

You’re wrong. I can flip the y axis in OgreXmlExporter in blender 2.57 without problems.

He’s talking about the blender importer. I thought it already fixes to y-up… At any instance it should.

normen said:
He's talking about the blender importer. I thought it already fixes to y-up.. At any instance it should.


Ops! misunderstood :roll:.
normen said:
I thought it already fixes to y-up.. At any instance it should.

Well I am not sure why it doesn't work. Here is the scene looking from the top in Blender:

And this is when I look at it from the top in JME. It was hard to get the full scene because of the clipping:

I'll try to start a new Blender file and try to see if the problem occurs again and where.

EDIT: When I clear the rotations in Blender, it appears as it should in JME, so I'm thinking the issue is with rotations.

Well then instead of clearing them, apply them.



If you rotate an object in object mode in blender, this transformation is not applied to the mesh, so you won’t have it in JME.



So, make your rotation sin edit mode, or apply them before exporting (ctrl+A, Rotation, or visual transforms)

nehon said:
Well then instead of clearing them, apply them.

If you rotate an object in object mode in blender, this transformation is not applied to the mesh, so you won't have it in JME.

So, make your rotation sin edit mode, or apply them before exporting (ctrl+A, Rotation, or visual transforms)


Thank you, that works now. This is more of a Blender issue, but when I apply the rotation information, that information disappears from the "Object" panel in the "Properties" window. If I apply the location information, that information is lost too. Will making the changes in edit mode keep the numbers from disappearing? Thanks again.

The problem is in blender importer.

When there is no rotation it should be fine.

But with it, the result rotation doesn’t look as it should be.



I’m currently working on it, so I hope it will be solved soon.

OK it didn’t take long :slight_smile:



When you get the newest nightly build check your blend file and let me know if it is ok.



If not - then I’ll look further :wink:

1 Like
Kaelthas said:
OK it didn't take long :)

When you get the newest nightly build check your blend file and let me know if it is ok.

If not - then I'll look further ;)


The issue seems to have been resolved. Now I can edit in Object Mode and the location, rotation, and scaling information is present in Blender. Thanks!

Sorry to return again but I’ve noticed that while in Top view in Blender, with the positive y-axis pointing up, the import to JME has the positive z-axis pointing down (it should be pointing up). I can fix this by doing rootNode.rotate(0, FastMath.PI, 0) but then the x-axis coordinates are negative in Blender when they are positive in JME and vice versa.



Hopefully this should be easy to fix, and thanks again for helping.