I have been using the directX exporter which ships with Blender and it’s great.
I can successfully export static meshes without any problems.
I have even managed to export an DX file with animations (very simply cube with armature).
Got brave and decided to try exporting a more complicated mesh and bang the DirectXViewer simply dies on me.:eek:
I have followed all the instructions given by various people on vairous threads but alas I am unable to figure out why I can’t export this model with animation properly.
I woulid like to post a zip file containing the .Blend, 2 .X file exports (1 mesh only, 1 mesh with anim) and a BMP of the DirectXViewer error but I am not sure where I can post them to for download.
Desperately in need of help,
You could try uploading the zip to somewhere like here:
You have to register for an account, but it’s free - I signed up the other day,
Once you’ve verified your e-mail address you can upload and then link to it from here on the forums.
I must confess that after spending many hours on figuring out why certain animations work I have established the following (well its working for me now if in a round about fashion).
- Create mesh (in my case I imported the mesh from another .Blend minus the armature I build in the file.
- Export the mesh and check in DirectX Viewer
If all works continue.
- Create the armature
- Parent with CTRL+P
- Complete the weight painting
- Edit the vertices in the groups to ensure that all the verts are contained within a group associated with at least 1 bone
- Save the blend
- do some animation
- Ensure the end frame is set correctly - this seems to be very important
- Export and view with DX
- Save the blend file (I tend to save as a new version)
- Close Blender
- Reopen model in Blender
- Do some more animation
- export etc…
Dont know why but it seems that if you do any animation, export and then export again the .X file grows in size (kinda weird and I dont know why!).
Following these steps seems to work (well most of the time!).
Hope this helps others.
Thanks for figuring this out. I was never able to figure out why my animations didn’t work, and it was because not all vertices were part of a vertex group.
And I think I figured out why things get screwed when trying export a second time. Modify the .blender\scripts\DirectX8Exporter.py file like this:
Add this line at line #521:
bone_list = 
And add this line at line #791:
index_list = 
This seems to be working, but I haven’t tested it thouroughly.
I am very happy that other people are getting directX anims out of Blender
I will try the suggested fixes as soon as I get home.
If it all pans out maybe the scipt owner/author could implement it in the python script.
Additionally is there a script which will tell me which bone a vertex is assigned to and if there is a vertex which is not assiged to any bone?
or maybe something like the skin weight table in MAX?
That list helped me filter out my issues… Most apps are probably crashing for the same reason mine is. I am getting an exception from a directx dll when trying to make the loaded data ready for rendering.
This list took out all errors Just registered to say that your my saviour, after days of trying all kinds of options to get the anims working, the do now
Parenting is important, also each bone must be a child of another bone (except of course the master)
Start and end frames seem to make no difference here, it just exports all the frames in the action to the right of the frame line in the action editor.
The problem comes when trying to export multiple actions. It seems that only one action can be exported. So for now, all animations must be created together in one action, and then accessed by frame number in your code. Another thing to remember is to always bake your action, and use the baked action for export. Blender uses IPO curves to make the different motions of the armature appear “smooth”. This IPO data is NOT exported, therefore unbaked animations will appear incorrect. (linear). And thirdly, you MUST apply all scales and rotations (CTRL-A) to both armature AND mesh before exporting. If not, this can also cause weird things to happen to your mesh (easily fixed with a Ctrl-Z undo)
Not sure why you are having to close and reopen Blender, though. Somtimes, when exporting incorrectly, it can do some weird things to your mesh. A clear sign of this is when the center point changes colors (from pink to blue) I am not sure what causes this (I can’t seem to recreate it here) but a simple fix is to press Ctrl-Z after exporting. This will undo any changes made to your mesh or armature by the export. (This is very common for me when exporting to .md2)
It is an exporter made by a guy who got tired of the old blender exporter…
It’s a little different, but I see 1 bug…It only exports one of the objects…
It would be a good exporter, if it exported Halo with the meshes… (Is halo even in DirectX?)