DirectX Export Question

I’m very new to Blender but I’m curious how I can get my models to export with a correct ‘Up’ axis. Currently when I export and then import into my development environment within DirectX my model is lying on its side.

I’m fairly certain this is because in my environment ‘up’ is the Y axis and in Blender I notice its the Z axis. Withouth manually rotating all my models, isn’t there a way I can export with Y being up or some kind of .X file editing I could do?

Any help is much appreciated and a belated Hello to everyone, can’t wait to get in on Blender and the discussions!

-If I know which version you are using, can try
to rotate the world matrix in order to match with
your engine?

Ben

I’m using the most recent version of your Exporter available from some URL’s on this site.

Appreciate your hard work and help…

Okay I’ve found out that I’m using this script:

DirectX8Exporter235.py

In the script it says its version 1.0

Thanks!

-This is a version with the world matrix rotated on
x-axis for 90 degrees,in order to put y-axis instead
of z-axis.(it’s done in lines 50-59)I dont know if this
works for your engine,anyway I’ve put in the
above lines all matrices which rotates in all axis.

http://xoomer.virgilio.it/glabro1/DirectX8Exporter235-rotated.py

Ben

It looks like beta and I’m gonna guess gamma as well are undefined variables so its not executing properly.

Thanks though, something tells me this will work.

-Oops, that’s my fault I haven’t defined them.
Put before line 50(49) these two lines:

beta = 0
gamma = 0

beta and gamma are not used at the moment.I’ve
used them if you need to use other rotations

Ben

Hmmm… now it doesn’t know what m_x is =)

:expressionless: :expressionless: Line 61:

mat_flip = rot_x * mat_f

instead of:

mat_flip = m_x * mat_f

Alright, now its exporting and it seems close, the only problem is my model seems a lot skinnier along the X-axis. This is kind of funny cause I attempted to fiddle with your script and ended up with the same results. Do you know how to solve this?

Thanks again! :wink:

I’m having a problem trying to get it to export. I load the directx file into Ultimate unwrap and it doesn’t bring in the bones or the animations.

-There was a specific exporter wrote for Ultimate Unwrap.

http://xoomer.virgilio.it/glabro1/python233.html

-I dont’t know if it works with 2.36.Anyway try it and
let me know.I’ll try to modifie it.

Ben

It looks like its exporting the right thing, but when I load it into UU3d it loads an object with 1 material, 1 bone and nothing else. If you check your script I would be very grateful.

…I just had a go at trying an older version of Blender and the same thing happened. Maybe I’m doing something wrong. I select the mesh and then choose the exporter, I select export the object and it exports fine. It’s just that the importer doesn’t recognise things.

I also realised that I may need to use python rather than the usual .DLL. Nah, no dice.

I am using the demo version of Ultimate Unwrap though.

http://xoomer.virgilio.it/glabro1/DX8ExporterUU3D.py

This one seems to export well for UU3D.(I did a pair of tests)
I’m using the same demo version of UU3D.

Ben

I tried again and I still got the same results. I am using UU3d demo v1.17. I have the import plugin for DirectX in that program and I was very careful to follow the instructions for exporing the mesh. Again the resulting file looked like it would work but it didn’t.

I am going to try on another computer to see if it’s just my machine. although I don’t think this would be affecting things I am running it on a Windows PC with a Radeon 7200 card in it.

Okay I tried it on another machine and it still didn’t work. Bummer!
It’s not showing any error messages either. I don’t know what it is. Can I send you the .blend and the .x file and see if you can get it to go?

What I’ve been able to work out is that my exporter does not export the armatures, or the animations, and although it does export material data it is misplaced somewhat.

Any ideas?

-Maybe, I need to see what you are exporting.Is that correct
for the exporter?If you use this one:
http://xoomer.virgilio.it/glabro1/python236.html
it exports armature,animations(armature and IPO),materials
and UV textures.
Read this first:
http://xoomer.virgilio.it/glabro1/faq.html
Ben

Just so everyone knows…

The file I was trying to export had armatures that had DOTS in them, and like it says in your documentation, you shouldn’t export stuff if it has dots in it. I got rid of the dots and now it exports properly.

What I have found though is the last armature doesn’t export correctly and the orientation is distorted. I’m guessing this means you need to add a null bone so it will export properly.

I’ll tell you my results…

Ah! The mesh or the armature is inverted! So the left foot bone is affecting the right (inverted) foot mesh. Or vice versa. I’m not sure how to fix this.

Okay I’m back again trying to export stuff to Ultimate Unwrap. At the moment I have a blend file that exports coreectly EXCEPT the armature is upside down, so it animates really badly. But at least everything is exported.