如何将Blender 2.8制作的FBX转换为g3db / g3dj文件?

时间:2019-10-08 02:53:49

标签: libgdx

我尝试使用libGDX FBX-Converter转换一个简单的多维数据集,但该多维数据集未显示在我的游戏应用程序中。

FBX文件是使用Blender 2.8创建的

另一方面,如果我使用Blender 2.76制作FBX文件,然后将其转换为g3dj文件,则显示成功。

有效的与无效的唯一区别是属性TEXCOORD0

这里有2个g3dj文件,一个是用Blender 2.76制作的,另一个是用Blender 2.8制作的

这是可行的,FBX是使用Blender 2.76创建的,然后转换为g3dj

{
    "version": [  0,   1], 
    "id": "", 
    "meshes": [
        {
            "attributes": ["POSITION", "NORMAL"], 
            "vertices": [
                -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,  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, -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,  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,  1.000000,  1.000000,  0.000000,  0.000000,  1.000000, 
                -1.000000, -1.000000,  1.000000,  0.000000,  0.000000,  1.000000
            ], 
            "parts": [
                {
                    "id": "Cube.002_part1", 
                    "type": "TRIANGLES", 
                    "indices": [
                          0,   1,   2,   2,   1,   3,   4,   5,   6,   6,   5,   7, 
                          8,   9,  10,  10,   9,  11,  12,  13,  14,  14,  13,  15, 
                         16,  17,  18,  17,  19,  18,  20,  21,  22,  21,  20,  23
                    ]
                }
            ]
        }
    ], 
    "materials": [
        {
            "id": "Material.005", 
            "ambient": [ 0.000000,  0.000000,  0.000000], 
            "diffuse": [ 0.800000,  0.800000,  0.800000], 
            "emissive": [ 0.800000,  0.800000,  0.800000], 
            "opacity":  1.000000, 
            "specular": [ 1.000000,  1.000000,  1.000000], 
            "shininess":  9.607843
        }
    ], 
    "nodes": [
        {
            "id": "Cube", 
            "rotation": [-0.707107, -0.000000,  0.000000,  0.707107], 
            "scale": [ 1.000000,  1.000000,  0.158538], 
            "parts": [
                {
                    "meshpartid": "Cube.002_part1", 
                    "materialid": "Material.005"
                }
            ]
        }
    ], 
    "animations": []
}

这是行不通的,FBX是使用Blender 2.8创建的,然后转换为g3dj

{
    "version": [  0,   1], 
    "id": "", 
    "meshes": [
        {
            "attributes": ["POSITION", "NORMAL", "TEXCOORD0"], 
            "vertices": [
                -1.000000,  1.000000,  1.000000, -1.000000,  0.000000,  0.000000,  0.625000,  0.750000, 
                -1.000000, -1.000000, -1.000000, -1.000000,  0.000000,  0.000000,  0.375000,  1.000000, 
                -1.000000, -1.000000,  1.000000, -1.000000,  0.000000,  0.000000,  0.625000,  1.000000, 
                -1.000000,  1.000000, -1.000000, -1.000000,  0.000000,  0.000000,  0.375000,  0.750000, 
                 1.000000,  1.000000,  1.000000,  0.000000,  1.000000,  0.000000,  0.625000,  0.500000, 
                -1.000000,  1.000000, -1.000000,  0.000000,  1.000000,  0.000000,  0.375000,  0.750000, 
                -1.000000,  1.000000,  1.000000,  0.000000,  1.000000,  0.000000,  0.625000,  0.750000, 
                 1.000000,  1.000000, -1.000000,  0.000000,  1.000000,  0.000000,  0.375000,  0.500000, 
                 1.000000, -1.000000,  1.000000,  1.000000,  0.000000,  0.000000,  0.625000,  0.250000, 
                 1.000000,  1.000000, -1.000000,  1.000000,  0.000000,  0.000000,  0.375000,  0.500000, 
                 1.000000,  1.000000,  1.000000,  1.000000,  0.000000,  0.000000,  0.625000,  0.500000, 
                 1.000000, -1.000000, -1.000000,  1.000000,  0.000000,  0.000000,  0.375000,  0.250000, 
                -1.000000, -1.000000,  1.000000,  0.000000, -1.000000,  0.000000,  0.625000,  0.000000, 
                 1.000000, -1.000000, -1.000000,  0.000000, -1.000000,  0.000000,  0.375000,  0.250000, 
                 1.000000, -1.000000,  1.000000,  0.000000, -1.000000,  0.000000,  0.625000,  0.250000, 
                -1.000000, -1.000000, -1.000000,  0.000000, -1.000000,  0.000000,  0.375000,  0.000000, 
                 1.000000, -1.000000, -1.000000,  0.000000,  0.000000, -1.000000,  0.375000,  0.250000, 
                -1.000000, -1.000000, -1.000000,  0.000000,  0.000000, -1.000000,  0.125000,  0.250000, 
                -1.000000,  1.000000, -1.000000,  0.000000,  0.000000, -1.000000,  0.125000,  0.500000, 
                 1.000000,  1.000000, -1.000000,  0.000000,  0.000000, -1.000000,  0.375000,  0.500000, 
                -1.000000,  1.000000,  1.000000,  0.000000,  0.000000,  1.000000,  0.875000,  0.500000, 
                -1.000000, -1.000000,  1.000000,  0.000000,  0.000000,  1.000000,  0.875000,  0.250000, 
                 1.000000,  1.000000,  1.000000,  0.000000,  0.000000,  1.000000,  0.625000,  0.500000, 
                 1.000000, -1.000000,  1.000000,  0.000000,  0.000000,  1.000000,  0.625000,  0.250000
            ], 
            "parts": [
                {
                    "id": "Cube.001_part1", 
                    "type": "TRIANGLES", 
                    "indices": [
                          0,   1,   2,   1,   0,   3,   4,   5,   6,   5,   4,   7, 
                          8,   9,  10,   9,   8,  11,  12,  13,  14,  13,  12,  15, 
                         16,  17,  18,  16,  18,  19,  20,  21,  22,  22,  21,  23
                    ]
                }
            ]
        }
    ], 
    "materials": [
        {
            "id": "Material.002", 
            "ambient": [ 0.050876,  0.050876,  0.050876], 
            "diffuse": [ 0.800000,  0.800000,  0.800000], 
            "emissive": [ 0.800000,  0.800000,  0.800000], 
            "opacity":  0.000000, 
            "specular": [ 0.800000,  0.800000,  0.800000], 
            "shininess":  25.000000
        }
    ], 
    "nodes": [
        {
            "id": "Cube", 
            "rotation": [-0.707107, -0.000000,  0.000000,  0.707107], 
            "scale": [ 1.000000,  1.000000,  0.081716], 
            "parts": [
                {
                    "meshpartid": "Cube.001_part1", 
                    "materialid": "Material.002", 
                    "uvMapping": [[]]
                }
            ]
        }
    ], 
    "animations": []
}

那么在Blender 2.8中有没有办法忽略此属性?甚至使libgdx将此属性考虑在内?

我在搅拌机2.8中使用扩散BSDF材料

0 个答案:

没有答案