DirectX Format Bones and Weights
-
- Posts: 6
- Joined: Thu Jan 12, 2017 6:51 pm
DirectX Format Bones and Weights
Hello
After importing my mesh with bones and weights (exported from Blender with default DirectX exporter), all the vertices of the mesh are just randomly placed somewhere. The problem occurs
only if the option "export skin weights" is enabled, and also just for the vertices who are added to a vertex group (It works for the rest of the mesh). Had someone this Problem before and knows how to solve it?
After importing my mesh with bones and weights (exported from Blender with default DirectX exporter), all the vertices of the mesh are just randomly placed somewhere. The problem occurs
only if the option "export skin weights" is enabled, and also just for the vertices who are added to a vertex group (It works for the rest of the mesh). Had someone this Problem before and knows how to solve it?
Re: DirectX Format Bones and Weights
You might want to use another exporter, they all have quirks, or even export to FBX and use one of several converters to .x
Re: DirectX Format Bones and Weights
Can you give us some example models to test? Optimally very tiny models (the less info the better) with blender files and exported .X files. But maybe just .X already allows us to see something. And always a good idea to compare with Microsoft's DXViewer to see if the export failed or if Irrlicht handles it wrong (DXViewer is a little harder to get these days maybe, it was part of older DX SDK's... I hope it can still be downloaded somehow).
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Re: DirectX Format Bones and Weights
STEP 1. Use Blender 2.4.9 (which you can get from Blender.org)..
Re: DirectX Format Bones and Weights
STEP 2: Save the following code as "DirectX8Exporter.py" in the your "C:\__BLENDER_2_4_9\.blender\scripts" directory..
Unzip the file: http://s000.tinyupload.com/?file_id=156 ... 9551768369
When "Export as DX" you should get something like this:
This is the only one that really works..
Unzip the file: http://s000.tinyupload.com/?file_id=156 ... 9551768369
When "Export as DX" you should get something like this:
This is the only one that really works..
-
- Posts: 6
- Joined: Thu Jan 12, 2017 6:51 pm
Re: DirectX Format Bones and Weights
@cuteAlien Ok here' s a test file, containing a plane and Three bones (1 is parented to the two other ones). Everyone of the two subbones are parented to one vertex for every bone.
@vectotrek
Thank you but how should I get the modell from Blender (I'm currently using 2.77) to 2.49?
Code: Select all
xof 0303txt 0032
template XSkinMeshHeader {
<3cf169ce-ff7c-44ab-93c0-f78f62d172e2>
WORD nMaxSkinWeightsPerVertex;
WORD nMaxSkinWeightsPerFace;
WORD nBones;
}
template SkinWeights {
<6f0d123b-bad2-4167-a0d0-80224f25fabb>
STRING transformNodeName;
DWORD nWeights;
array DWORD vertexIndices[nWeights];
array float weights[nWeights];
Matrix4x4 matrixOffset;
}
Frame Root {
FrameTransformMatrix {
1.000000, 0.000000, 0.000000, 0.000000,
0.000000,-0.000000, 1.000000, 0.000000,
0.000000, 1.000000, 0.000000, 0.000000,
0.000000, 0.000000, 0.000000, 1.000000;;
}
Frame Plane {
FrameTransformMatrix {
2.007890, 0.000000, 0.000000, 0.000000,
0.000000, 2.007890, 0.000000, 0.000000,
0.000000, 0.000000, 2.007890, 0.000000,
0.000000, 0.000000,-2.411880, 1.000000;;
}
Mesh { // Plane mesh
4;
-1.000000;-1.000000; 0.000000;,
1.000000;-1.000000; 0.000000;,
1.000000; 1.000000; 0.000000;,
-1.000000; 1.000000; 0.000000;;
1;
4;3,2,1,0;;
MeshNormals { // Plane normals
1;
0.000000; 0.000000; 1.000000;;
1;
4;0,0,0,0;;
} // End of Plane normals
XSkinMeshHeader {
1;
3;
3;
}
SkinWeights {
"Armature_b2";
1;
0;
1.000000;
2.007890, 0.000000, 0.000000, 0.000000,
0.000000, 0.000000,-2.007890, 0.000000,
0.000000, 2.007890, 0.000000, 0.000000,
0.000000,-0.950213, 1.254508, 1.000000;;
} // End of Armature_b2 skin weights
SkinWeights {
"Armature_b1";
1;
2;
1.000000;
2.007890, 0.000000, 0.000000, 0.000000,
0.000000, 0.000000,-2.007890, 0.000000,
0.000000, 2.007890, 0.000000, 0.000000,
0.000000,-1.936956,-1.893398, 1.000000;;
} // End of Armature_b1 skin weights
SkinWeights {
"Armature_Parent";
0;
2.007890, 0.000000, 0.000000, 0.000000,
0.000000, 0.000000,-2.007890, 0.000000,
0.000000, 2.007890, 0.000000, 0.000000,
0.000000,-2.411880, 0.000000, 1.000000;;
} // End of Armature_Parent skin weights
} // End of Plane mesh
} // End of Plane
} // End of Root
Thank you but how should I get the modell from Blender (I'm currently using 2.77) to 2.49?
Re: DirectX Format Bones and Weights
@thenamename: From Blender (later version), you export the armature and its animations to "*.BVH" Biovision motion capture format..
Then also from this later version Blender you "Save" the file with "LEGACY FORMAT" option ON..
Then in Blender 2.49 you open this Legacy File which has ALL WEIGHTS still intact..
You'll see that the bones remained but NO ANIMATION..
Delete the Armature and Import the "*.bvh" (correct scale etc)..
Parent the Armature to the Mesh..
You'll see that bone names and weights (vert groups) remain correct..
Now Export the "*.x" file from Blender 2.49..
I can tell you now that this is the only way you're going to get a working X file from any Blender..
None of the other versions work..
Let me know how you progress because I also like Character Animation..
Then also from this later version Blender you "Save" the file with "LEGACY FORMAT" option ON..
Then in Blender 2.49 you open this Legacy File which has ALL WEIGHTS still intact..
You'll see that the bones remained but NO ANIMATION..
Delete the Armature and Import the "*.bvh" (correct scale etc)..
Parent the Armature to the Mesh..
You'll see that bone names and weights (vert groups) remain correct..
Now Export the "*.x" file from Blender 2.49..
I can tell you now that this is the only way you're going to get a working X file from any Blender..
None of the other versions work..
Let me know how you progress because I also like Character Animation..
Re: DirectX Format Bones and Weights
Here is a proper X file I made this way, (also finalizing in Deep Exploration)..
http://s000.tinyupload.com/?file_id=502 ... 6663274863
http://s000.tinyupload.com/?file_id=502 ... 6663274863
Re: DirectX Format Bones and Weights
"Realtime Graphics Rant"
Here is a zipped pdf I wrote about some Character Animation stuff (old post re-uploaded)
that might be usefull..
Download:
http://s000.tinyupload.com/?file_id=074 ... 5977085304
Here is a zipped pdf I wrote about some Character Animation stuff (old post re-uploaded)
that might be usefull..
Download:
http://s000.tinyupload.com/?file_id=074 ... 5977085304
Re: DirectX Format Bones and Weights
@ thenamename: Thanks, didn't get to it this weekend (next also probably not yet as I already have planned to work on another bugfix there). But I'll test it soon.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
-
- Posts: 6
- Joined: Thu Jan 12, 2017 6:51 pm
Re: DirectX Format Bones and Weights
Thank you very much, it's working now!
-
- Posts: 6
- Joined: Thu Jan 12, 2017 6:51 pm
Re: DirectX Format Bones and Weights
One thing I forgot - Blender 2.49 does already include the DirectXExporter you mentioned above, so in case of feature visitors, you can just use the default exporter
in Blender 2.49
in Blender 2.49
Re: DirectX Format Bones and Weights
I would guess on a problem with newer Blender exporter. I tried your example above and also can't get it to show up with the Microsoft dxviewer.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm