libgdx / fbx-conv

Command line utility using the FBX SDK to convert FBX/Collada/Obj files to a custom text/binary format for static, keyframed and skinned meshes.
Apache License 2.0
448 stars 116 forks source link

fbx-conv generating G3DJ file that doesn't follow specification #40

Closed Dancovich closed 10 years ago

Dancovich commented 10 years ago

I'm just reading the G3DJ format on the specification page and something caught my attention.

I converted a file from FBX to G3DJ and the following section was on the file

... "parts": [ { "meshpartid": "shape1_part1", "materialid": "unnamed", "bones": [ { "node": "bone_1", "translation": [ 0.988038, 0.000000, 0.263477, 0.000000], "rotation": [ 0.500000, -0.500000, 0.500000, 0.500000], "scale": [ 1.000000, 1.000000, 1.000000, 0.000000] }, ...

but reading the 0.1 specification (and also 0.2) I was led to believe the "bones" section is only a list of nodeid's, the actual rotation, location and scale should be on the node referenced by the bones section (and indeed it is, and it have different values listed for those three attributes).

: { "meshpartid": <meshpartid>, "materialid": <materialid> (, "bones": [(<nodeid> (, <nodeid>)_)?])? (, "uvMapping": [(<uvmapping> (, <uvmapping>)_)?])? } The resulting file does open but doesn't animate (I can't right now attest that it "should" animate, as my code can be wrong). Anyway, here are the original FBX and G3DJ files for reference. FBX: http://pastebin.com/KAyTEFGa G3DJ: http://pastebin.com/Yras5nST
xoppa commented 10 years ago

Thanks, updated the specification. The transformation (translation, rotation, scale) for the bone is the bind pose (which doesn't necessarily have to match the current node transformation).

If you experience problems animating, consider asking on the forum or on irc (https://github.com/libgdx/libgdx/wiki/Getting-help) see also https://github.com/libgdx/libgdx/wiki/3D-animations-and-skinning

Dancovich commented 10 years ago

Thanks.

I'm writing a Blender exporter to G3DJ because the one I found was very outdated. FBX support in Blender is lacking some features like texture types (all textures are exported as diffuse). The code is here: https://github.com/Dancovich/libgdx_blender_g3d_exporter

I'm still writing it so some commits might not work.

I'm using the tutorials you provided to test animation. The code doesn't give any errors, it simply won't animate. I'll try and find some source code examples so I can just load my model in them.

Again, thanks for the response.