Forums » Your showcase, tips and tutorial discussions »
Info for handling Animations exported from Blender.
Added by Flapman almost 3 years ago
I wanted to post this info as a resource for the future.
I have been banging my head against the wall about this for so long my vision is blurry.
We were having trouble exporting animations from Blender into Direct X. It just would not work. It was driving me and our team members crazy.
We found a work around via the thread on Blender Artists that I started:
http://blenderartists.org/forum/showthread.php?t=149331
We exported the model from Blender in FBX format then downloaded a FBX converter from :
http://area.autodesk.com/index.php/forums/viewthread/22625/
We converted the FBX file to DirectX. The EXE automatically exported a Test.x file for us. Per the instructions and result below, we replaced all the material references in the DX file and minimized it as indicated in the following.
**********
Dear Flapman,
quadface has just replied to a thread you have subscribed to entitled - Help with exported model with animation to DirectX - in the Animation forum of Blender Artists Forums.
This thread is located at:
http://blenderartists.org/forum/showthread.php?t=149331&goto=newpost
Here is the message that Quadface posted:
*******
ok, Im not sort of a hacker, but I someway managed to get to the error.
The X format differs from the fbx, and the conversion from fbx to X doesnt help either.
forget about modifying by hand the fbx, just use the tool and open the test.x generated from the utility:
-Search for a field called "Material { x;x;x;x;; ....... ........" delete all until you find the next field. be careful not to delete other fields called "Material whatever{ ......"
-for example:
Material Mat1 {
1.0; 1.0; 1.0; 1.0;;
1.0;
1.0; 1.0; 1.0;;
0.0; 0.0; 0.0;;
TextureFilename { "xxx.png"; }
} // End of Material
^^^^
this should be the original material created from the fbx, just replace the xxx.png with the complete dir "textures/wahtever.png" (or jpg).
-save and test in the dx application, you should see the texture now.
All this is applicable to directx X format.
Victory!!![/color]
I figured I would play with the brackets and add one at a time in various places in the material statement that Quadface pointed out. I also removed the underscore and number from the texture file name. It worked. This is the final Material Statement.
Material {
1.0; 1.0; 1.0; 1.0;;
1.0;
1.0; 1.0; 1.0;;
0.0; 0.0; 0.0;;
TextureFilename { "texture.png"; }
}
// End of Material
}
****The last bracket fixed it!
I hope this helps anyone that might be having trouble getting their animations and textures to work in DX.
Best,
Flap