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 117 forks source link

Can't Import G3DB file converted from FBX #71

Closed ghost closed 10 years ago

ghost commented 10 years ago

I'm trying to convert the most basic blender model object (FBX) into a G3DB file and using it in-game, but I keep getting a NullPointerException.

Specs: Linux Ubuntu 14.04 64-bit fbx-conv v 0.01.0000 x64 (pre-release) Blender v2.69

Steps to reproduce:

And fileModel is null.

Output of "fbx-conv-lin64 file.fbx": INFO: FBX to G3Dx converter, version 0.01.0000 x64 (pre-release) STATUS: Loading source file PROGRESS: Import FBX 100.00%
WARNING: [Cube] Node uses RrSs mode, transformation might be incorrect STATUS: [shape(Cube)] Triangulating FbxMesh geometry VERBOSE: [shape(Cube)] polygons: 12 (36 indices), control points: 8 STATUS: Converting source file STATUS: Closing source file VERBOSE: Listing model information: VERBOSE: ID : VERBOSE: Version : Hi=0, Lo=1 VERBOSE: Meshes : 1 (144 vertices, 1 parts, 36 indices) VERBOSE: Nodes : 1 root, 1 total, 1 parts VERBOSE: Materials : 1 (0 textures) STATUS: Exporting to G3DB file: file.g3db STATUS: Closing exported file

Hope this helps.

ghost commented 10 years ago

This is the G3DJ file content:

{                                                                               
    "version": [  0,   1],                                                      
    "id": "",                                                                   
    "meshes": [                                                                 
        {                                                                       
            "attributes": ["POSITION", "NORMAL"],                               
            "vertices": [                                                       
                -1.000000, -1.000000, -1.000000,  0.000000,  0.000000, -1.000000,
                 1.000000,  1.000000, -1.000000,  0.000000,  0.000000, -1.000000,
                 1.000000, -1.000000, -1.000000,  0.000000,  0.000000, -1.000000,
                -1.000000,  1.000000, -1.000000,  0.000000,  0.000000, -1.000000,
                -1.000000,  1.000000,  1.000000,  0.000000,  0.000000,  1.000000,
                -1.000000, -1.000000,  1.000000,  0.000000,  0.000000,  1.000000,
                 1.000000,  0.999999,  1.000000,  0.000000,  0.000000,  1.000000,
                 0.999999, -1.000001,  1.000000,  0.000000,  0.000000,  1.000000,
                 1.000000,  0.999999,  1.000000,  1.000000, -0.000000,  0.000000,
                 1.000000, -1.000000, -1.000000,  1.000000, -0.000000,  0.000000,
                 1.000000,  1.000000, -1.000000,  1.000000, -0.000000,  0.000000,
                 0.999999, -1.000001,  1.000000,  1.000000, -0.000000,  0.000000,
                 0.999999, -1.000001,  1.000000, -0.000000, -1.000000, -0.000000,
                -1.000000, -1.000000, -1.000000, -0.000000, -1.000000, -0.000000,
                 1.000000, -1.000000, -1.000000, -0.000000, -1.000000, -0.000000,
                -1.000000, -1.000000,  1.000000, -0.000000, -1.000000, -0.000000,
                -1.000000,  1.000000,  1.000000, -1.000000,  0.000000, -0.000000,
                -1.000000, -1.000000, -1.000000, -1.000000,  0.000000, -0.000000,
                -1.000000, -1.000000,  1.000000, -1.000000,  0.000000, -0.000000,
                -1.000000,  1.000000, -1.000000, -1.000000,  0.000000, -0.000000,
                -1.000000,  1.000000,  1.000000,  0.000000,  1.000000,  0.000000,
                 1.000000,  0.999999,  1.000000,  0.000000,  1.000000,  0.000000,
                -1.000000,  1.000000, -1.000000,  0.000000,  1.000000,  0.000000,
                 1.000000,  1.000000, -1.000000,  0.000000,  1.000000,  0.000000
            ],                                                                  
            "parts": [                                                          
                {                                                               
                    "id": "shape1_part1",                                       
                    "type": "TRIANGLES",                                        
                    "indices": [                                                
                          0,   1,   2,   1,   0,   3,   4,   5,   6,   6,   5,   7,
                          8,   9,  10,   9,   8,  11,  12,  13,  14,  13,  12,  15,
                         16,  17,  18,  17,  16,  19,  20,  21,  22,  21,  23,  22
                    ]                                                           
                }                                                               
            ]                                                                   
        }                                                                       
    ],                                                                          
    "materials": [                                                              
        {                                                                       
            "id": "Material",                                                   
            "ambient": [ 1.000000,  1.000000,  1.000000],                       
            "diffuse": [ 0.800000,  0.800000,  0.800000],                       
            "emissive": [ 0.800000,  0.800000,  0.800000],                      
            "opacity":  1.000000                                                
        }                                                                       
    ],                                                                          
    "nodes": [                                                                  
        {                                                                       
            "id": "Cube",                                                       
            "rotation": [-0.707107,  0.000000,  0.000000,  0.707107],           
            "parts": [                                                          
                {                                                               
                    "meshpartid": "shape1_part1",                               
                    "materialid": "Material"                                    
                }                                                               
            ]                                                                   
        }                                                                       
    ],                                                                          
    "animations": [                                                             
        {                                                                       
            "id": "Default Take",                                               
            "bones": []                                                         
        }                                                                       
    ]                                                                           
}
xoppa commented 10 years ago

This is an issue tracker, please use the forums or irc to get help using the api. See https://github.com/libgdx/libgdx/wiki/Getting-help. Btw: you can't load G3DB/G3DJ files using ObjLoader.

ghost commented 10 years ago

Thank you.