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

G3DJ - Tag original bones? #56

Closed reduz closed 9 years ago

reduz commented 10 years ago

Some bones that were clearly bones in the original model are not tagged as such on the exported G3DJ. Even if they contain no skinning or animation, they are still helpful as visualization or attach points and force the importer to do guesswork that is not always possible either. Would it be possible somehow to include back this information in the converter?

xoppa commented 10 years ago

All nodes are converted, regardless they are used for skinning or animation. If fbx-conv omits a node, it should print a warning including the reason why it can't export the node. Obviously the node needs to be included in the fbx file, for fbx-conv to be able to convert it to g3dx. Make sure to use the latest (nightly) version and please provide an example to show this issue.

reduz commented 10 years ago

A simple example is opening the Knight.fbx scene in the samples folder of fbxconv.

The bones "global", "toe_ctrl_l", "ankle_r" and "finger_ctrl_r" are clearly bones by looking at the JSON file, but they are not referenced in any mesh part or animation track (probably because as I mentioned before, they have not any weight assigned or animation). As a result, it's impossible to tell if they are a bone or an object attached to a bone. For reference, collada has the "JOINT" tag to clearly mark what is a bone in this situation, but the exported JSON does not.

On Sun, Jul 13, 2014 at 12:18 PM, Xoppa notifications@github.com wrote:

All nodes are converted, regardless they are used for skinning or animation. If fbx-conv omits a node, it should print a warning including the reason why it can't export the node. Obviously the node needs to be included in the fbx file, for fbx-conv to be able to convert it to g3dx. Make sure to use the latest (nightly) version and please provide an example to show this issue.

— Reply to this email directly or view it on GitHub https://github.com/libgdx/fbx-conv/issues/56#issuecomment-48843314.

reduz commented 10 years ago

For context, the problem is not being able to reproduce the exported animation (there is enough information for that), but the exporter changing removing information of what is a bone and what is not, which makes higher level game logic that expects something specific to be a bone (ie, an attach point) more complex or impossible.

On Sun, Jul 13, 2014 at 12:24 PM, Juan Linietsky reduzio@gmail.com wrote:

A simple example is opening the Knight.fbx scene in the samples folder of fbxconv.

The bones "global", "toe_ctrl_l", "ankle_r" and "finger_ctrl_r" are clearly bones by looking at the JSON file, but they are not referenced in any mesh part or animation track (probably because as I mentioned before, they have not any weight assigned or animation). As a result, it's impossible to tell if they are a bone or an object attached to a bone. For reference, collada has the "JOINT" tag to clearly mark what is a bone in this situation, but the exported JSON does not.

On Sun, Jul 13, 2014 at 12:18 PM, Xoppa notifications@github.com wrote:

All nodes are converted, regardless they are used for skinning or animation. If fbx-conv omits a node, it should print a warning including the reason why it can't export the node. Obviously the node needs to be included in the fbx file, for fbx-conv to be able to convert it to g3dx. Make sure to use the latest (nightly) version and please provide an example to show this issue.

— Reply to this email directly or view it on GitHub https://github.com/libgdx/fbx-conv/issues/56#issuecomment-48843314.

xoppa commented 10 years ago

I understand. Currently that's not supported. It would be nice to allow (optionally) more information about nodes, including user-definable values (iirc the latest blender fbx-exporter supports that now also), in a next version. For now, most users currently use the name of the node to provide such information.

reduz commented 10 years ago

Ok, do you mind if I contribute this code for the current version, or should I better fork the Project? On Jul 13, 2014 12:48 PM, "Xoppa" notifications@github.com wrote:

I understand. Currently that's not supported. It would be nice to allow (optionally) more information about nodes, including user-definable values (iirc the latest blender fbx-exporter supports that now also), in a next version. For now, most users currently use the name of the node to provide such information.

— Reply to this email directly or view it on GitHub https://github.com/libgdx/fbx-conv/issues/56#issuecomment-48844043.

badlogic commented 10 years ago

We'd love contributions, but we can't say if we integrate it before we see the code itself. Worst case: you end up with a fork :) On Jul 13, 2014 6:00 PM, "reduz" notifications@github.com wrote:

Ok, do you mind if I contribute this code for the current version, or should I better fork the Project? On Jul 13, 2014 12:48 PM, "Xoppa" notifications@github.com wrote:

I understand. Currently that's not supported. It would be nice to allow (optionally) more information about nodes, including user-definable values (iirc the latest blender fbx-exporter supports that now also), in a next version. For now, most users currently use the name of the node to provide such information.

— Reply to this email directly or view it on GitHub https://github.com/libgdx/fbx-conv/issues/56#issuecomment-48844043.

— Reply to this email directly or view it on GitHub https://github.com/libgdx/fbx-conv/issues/56#issuecomment-48844327.

reduz commented 10 years ago

Allright, i just want to add an "isBone"=true to nodes that were originally bones. Just like collada does with the JOINT tag. Would that be acceptable? On Jul 13, 2014 1:03 PM, "Mario Zechner" notifications@github.com wrote:

We'd love contributions, but we can't say if we integrate it before we see the code itself. Worst case: you end up with a fork :) On Jul 13, 2014 6:00 PM, "reduz" notifications@github.com wrote:

Ok, do you mind if I contribute this code for the current version, or should I better fork the Project? On Jul 13, 2014 12:48 PM, "Xoppa" notifications@github.com wrote:

I understand. Currently that's not supported. It would be nice to allow (optionally) more information about nodes, including user-definable values (iirc the latest blender fbx-exporter supports that now also), in a next version. For now, most users currently use the name of the node to provide such information.

— Reply to this email directly or view it on GitHub https://github.com/libgdx/fbx-conv/issues/56#issuecomment-48844043.

— Reply to this email directly or view it on GitHub https://github.com/libgdx/fbx-conv/issues/56#issuecomment-48844327.

— Reply to this email directly or view it on GitHub https://github.com/libgdx/fbx-conv/issues/56#issuecomment-48844400.

xoppa commented 10 years ago

Sure, it could be. If you send a pull request we can have a look at it. Don't forget that the loader needs to be modified as well (and the node class). I'd like to see a practical real world use-case for this isBone property though. It feels a bit as if it might be a work-around instead of the best solution, but obviously that depends on which problem you're trying to solve.

xoppa commented 9 years ago

Closing this because of no activity.