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
447 stars 116 forks source link

FBX Files from Revit Conversion Problem #86

Closed DavidArayan closed 9 years ago

DavidArayan commented 9 years ago

Greetings,

I'm just testing some 3D Files (.FBX) Files with the .FBX Converter but they don't seem to be converting properly. These .FBX Models are exported from Revit.

The FBX Files seem to view properly using the Autodesk FBX Viewer.

I've hosted the .FBX Files and converted .G3DJ Files in dropbox below. Using the latest version of fbx_conv on Windows.

1) https://www.dropbox.com/s/rbrk9lrw74sljm7/Signs3.g3dj?dl=0 2) https://www.dropbox.com/s/c9ybqo28pn0uwl2/Signs4.g3dj?dl=0 3) https://www.dropbox.com/s/r0grqk57idkk8at/PCH_Signs3.fbx?dl=0 4) https://www.dropbox.com/s/9gmfocfywfbo4bt/PCH_Signs4.fbx?dl=0

Any help would be much appreciated!

xoppa commented 9 years ago

So the issue you're reporting is that "they don't seem to be converting properly"??? Please describe the actual issue.

DavidArayan commented 9 years ago

My apologies Xoppa, work here must be getting to me. I'll be more specific.

I've written a parser for the .G3DJ file format as per the spec in C# to be used in our framework. (its used in a visualization project).

Taking a look at Signs3.g3dj.

it generated the mesh data properly, great! towards the end of the file however, it generated two nodes that do not have any "parts" "nodepart" associated to it. ( (, "parts": [("nodepart" (, "nodepart")*)?])?)

The way I've created the parser, it requires some "nodepart"? to be pointing at mesh indices to generate the visual object for rendering. So the problem I'm having is that no "nodepart" is generated for any of the nodes as such, no object is rendered.

My Initial guess would be that since the "materials" section is empty, this causes the "nodepart" not to be generated because "meshpartid" and "materialid" both need to be present in the "nodepart"?? (just an initial guess).

This problem occurs for both .G3DB and .G3DJ export options from the converter. The same problem occurs on the Signs4.g3dj (linked above) and any other .FBX file exported from this application.

The FBX Files I've linked above can be viewed using the autodesk viewer. So I'm not sure if this is a converter problem or that the FBX files themselves have not been exported properly.

Any help would be much appreciated.

xoppa commented 9 years ago

Having empty nodes is perfectly fine. What is the actual issue you're reporting? Also, please include the fbx-conv console output.

DavidArayan commented 9 years ago

Greetings Xoppa, thank you for your prompt reply.

To answer your question, doesn't the File require the "parts" section to be generated. My problem is that the generated G3DJ file has no data that I can use for rendering except for Vertices and Indices. Doesn't the "parts" of the nodes require a pointer to the indices?

Unless that is not required, do I simply assume Position(0,0,0), Scale(1,1,1) and Quaterion(identity) for "mesh parts" not linked in the nodes section?

I've dumped the output from one of the conversions below.

fbx-conv-win32 -v -o G3DJ PCHSigns4.fbx INFO: FBX to G3Dx converter, version 0.01.0069 x32 , FBXSDK 2015.01 STATUS: Loading source file PROGRESS: Import FBX 100.00% 5947] Geometry WARNING: [3D View: {3D - narendra.datt}] Node uses RrSs mode, transformation might be incorrect WARNING: [S03 External pedestrain Direction West Block [26155855]] Node uses RrSs mode, transformation might be incorrect VERBOSE: [S03 External pedestrain Direction West Block [26155855][26155947] Geometry] polygons: 6064 (18192 indices), control points: 3164 STATUS: Converting source file STATUS: Closing source file VERBOSE: Listing model information: VERBOSE: ID : VERBOSE: Version : Hi=0, Lo=1 VERBOSE: Meshes : 1 (70968 vertices, 2 parts, 18192 indices) VERBOSE: Nodes : 2 root, 2 total, 0 parts VERBOSE: Materials : 0 (0 textures) STATUS: Exporting to G3DJ file: PCH_Signs4.g3dj STATUS: Closing exported file

xoppa commented 9 years ago

Thanks! Not sure how you managed to create a fbx like that (perhaps some weird texture mapping?). I've added a warning with fallback material. Should be fixed now.

DavidArayan commented 9 years ago

Thanks a bunch Xoppa! life saver, I just tested the new build on our end and everything works wonderfully.

Yes it seems CAD software exports fbx models in an odd way. You have been very helpful, thanks again!