Problem exporting animation to .x

'Ello, I’ve been using Blender for several years now, and am just now trying to export an animated model to direct x. I can export a static textured model just fine using the default script in Blender 2.45, however the animation doesn’t seem to work. I looked at the example .blend files for the exporter which worked, but couldn’t see any key differences between them and mine.
I have a simple model with a texture, and a single armature parented to it, I made the armature one chain as it says to in the instructions but in the direct x model viewer there is no animation.

I’d be totally excited if someone could shed some light on this for me :slight_smile:

i have sam problem:( model is fine but with no animatons…only loc,rot,scale but no bones animation. I have armature parented to mesh, all vertices all in groups…but still no works…is there some way to bake bone animation to vertex animation???


Post a .blend and I’ll take a look.

Heres the .blend file, thanks for your time :slight_smile:

Or a direct link:

Thanks for the file, I’ll take a look and see if there is anything obvious. It’s been a while since I used the directX export (since the Blitz .b3d exporter was released) but I did have a pretty good handle on how to get it to work.

Much appreciated :slight_smile:

Hmmmm, drawing a blank on this at the moment :frowning: I tried numerous things but it still fails to export and open in mview.

There are problems with the mesh (vertex groups with no corresponding bone, duplicate vertices etc) but I have got the mesh to export.

The armature is a different matter. I’m still struggling to see why it wont work. It does appaer to be setup correctly as per instructions as you said, parent-child bones OK, names OK, roll angles etc but when I delete your mesh and attach a simple cube to a bone it still fails to open in mview. There must be something… staring me in the face… driving me crazy…

I’ll continue trying to get it to work.

Nice model and animation by the way.

Hm…curses his love-hate relationship with Blender :stuck_out_tongue:

Thanks so much for the continued help :slight_smile: I’ll keep trying as well, if I have any success I’ll let you know.

I really overuse that smiley face huh, I’ll have to switch it up at some point.

Lol and thank you for the comment, the texture could still use some work I think but it turned out alright. Tis for a game a friend of mine is working on.

Update: I just tried exporting one of the sample files which came with the exporter, and the animation didn’t work in that either.

So either the exporter is broken in the new version of blender, or there’s something really big that I’m missing >.>

I tried the exporter with 2.45 (official) and some of my files and it worked OK.

There is a strange bug in the exporter wherein you can only successfully export a file once in any Blender session. For example use the exporter to export the default cube, open in mview, the cube comes in OK. Export the cube again and this time mview will fail to open the file strange, very annoying but there you have it. You must shut Blender down an reopen before attempting to export a file again.

The “Apricot” game project (follow on from Peach) will look and the exporting pipeline from Blender to Game Engines so we can only hope this area (import/export) will be improved siginificantly, although the FBX format seems to be the format of choice at the moment.

I did manage to export your file to Blitz3D with animation with one error around the arrow area which I could propbably track down with a bit of effort.

I haven’t had much spare time this past couple of days so haven’t been able to investigate the armature any more (I have a couple of ideas though).

Hi there,

I’ve been struggling with exactly the same issues. In the end, in exasperation, I started getting my hands dirty and looking at the code for the default DirectX exporter (by Ben Omari). The basic issue is that it makes a considerable number of assumptions about how you’ve made your mesh, and gives you very little help in identifying which of those assumptions isn’t actually true.

I’ve done some work to try to clean up the source code a bit and to document some of these assumptions. I’ve put my updated version of the code here:

Hopefully, it’ll give you some error messages in the console that will tell you what the problem is. If not, I’ll see if I can write out a list of what you need to do.

Thanks Andy, I tried your version of the exporter, but it exported without any complaints. The model didn’t open in mview either.

Hmm, well, it actually seems to import fine into Irrlicht for me (though it’s teeny tiny) which implies that there’s nothing drastically wrong with the .X file. I know that the DirectX MeshViewer has some bugs in it - are you sure it’s not just struggling to find the texture file (which I don’t think you included on your MediaFire page) or something like that?

When you export, I’d make sure you do “Export all” and not “Export selected”.

Also, I don’t know how you’re intending to use your .X files, but if you’re writing a Direct3D app, then linking with the debug version of the library (d3dx9d.lib instead of d3dx9.lib) will give you more specific error messages when you try to load the file

I got it to work with a model!

I was using another model I had made and got the texture and animation loaded in mview perfectly. I still haven’t gotten the bow to export with it’s animation but this is progress.

There are a couple reasons why this one might not have been working, first of all it’s ME name was sphere.001 which is against the .x rules, and it’s OBJ name was mesh. I changed both to mesh. I also had a bunch of stuff in layer 2 that I used to make the UV map, so I deleted all of that until I had no objects except for the armature and the mesh.
I exported with normal settings, anim on, speed set to 15fps, flip z, and it worked.

I don’t see any of these problems in the bow model but hopefully I’ll come upon something >.<

Heres the related files so that you can see it working.
.Blend file:
.X file:

By the way, in case you are wondering, all the planes sticking out of the model are alpha mapped hair, which works in the game engine it’s for. Looks odd in mesh view though :stuck_out_tongue:

The .001 in the name shouldn’t actually cause a problem since the exporter substitutes all dots for _ (underscore).

I’ve run the Bow mesh through the Debug D3DX libraries, and it’s complaining because you have a mesh named “string”, which is a .X file reserved word. I’ll update my version of the exporter to alert people to this.

Hah! That was it! I changed the bone name ‘string’ and the vertex group ‘string’ to ‘pull’. The bow’s animation works now as well. The arrow looks odd at end of animation but that’s a problem on my side as I scaled it down a bunch to make it disappear and that seems to cause visual problems.

Much thanks everyone for your help :smiley: