Three.js使用Blender导出json文件U…

最近被这蛋疼的问题搞死:简单说就是Blender输出Three.js用文件的addon插件,其官网更新了,然后怎么也读取不了了,找了半天还以为是自己javascript程序的问题,结果发现旧的addon插件输出的js文件能用,而新的插件输出的json文件不能用。于是把旧版本插件文件给大家下载,顺带附带插件的Blender也提供下载了:

 

旧版本Three.js插件下载

安装了旧版本Three.js插件的Blender下载

 

其中2个版本的区别,old版本输出的是js文件,new版本输出的json文件:

Three.js使用Blender导出json文件Uncaught <wbr>TypeError问题,原因:新插件bug

从截图可以很清晰看到新版本加了很多功能,控制面板变长了。试着在Blender建立了一个默认的立方体,看了下输出的原文件,发觉差别也忒大了:

先是json文件:

{

    "uvs": [],

    "vertices": [1,-1,-1,1,-1,1,-1,-1,1,-1,-1,-1,1,1,-1,0.999999,1,1,-1,1,1,-1,1,-1],

    "normals": [0.577349,-0.577349,-0.577349,0.577349,-0.577349,0.577349,-0.577349,-0.577349,0.577349,-0.577349,-0.577349,-0.577349,0.577349,0.577349,-0.577349,-0.577349,0.577349,-0.577349,-0.577349,0.577349,0.577349,0.577349,0.577349,0.577349],

    "name": "CubeGeometry.1",

    "metadata": {

        "uvs": 0,

        "vertices": 8,

        "normals": 8,

        "generator": "io_three",

        "faces": 6,

        "type": "Geometry",

        "version": 3

    },

    "faces": [33,0,1,2,3,0,1,2,3,33,4,7,6,5,4,5,6,7,33,0,4,5,1,0,4,7,1,33,1,5,6,2,1,7,6,2,33,2,6,7,3,2,6,5,3,33,4,0,3,7,4,0,3,5]

}

然后是js文件(old版本Three.js的addon输出):

{

                   "metadata" :

                   {

                                     "formatVersion" : 3.1,

                                     "generatedBy"   : "Blender 2.7 Exporter",

                                     "vertices"      : 8,

                                     "faces"         : 6,

                                     "normals"       : 8,

                                     "colors"        : 0,

                                     "uvs"           : [],

                                     "materials"     : 1,

                                     "morphTargets"  : 0,

                                     "bones"         : 0

                   },

                   "scale" : 1.000000,

                   "materials" : [               {

                                     "DbgColor" : 15658734,

                                     "DbgIndex" : 0,

                                     "DbgName" : "Material",

                                     "blending" : "NormalBlending",

                                     "colorAmbient" : [0.6400000190734865, 0.6400000190734865, 0.6400000190734865],

                                     "colorDiffuse" : [0.6400000190734865, 0.6400000190734865, 0.6400000190734865],

                                     "colorEmissive" : [0.0, 0.0, 0.0],

                                     "colorSpecular" : [0.5, 0.5, 0.5],

                                     "depthTest" : true,

                                     "depthWrite" : true,

                                     "shading" : "Lambert",

                                     "specularCoef" : 50,

                                     "transparency" : 1.0,

                                     "transparent" : false,

                                     "vertexColors" : false

                   }],

                   "vertices" : [1,-1,-1,1,-1,1,-1,-1,1,-1,-1,-1,1,1,-1,0.999999,1,1,-1,1,1,-1,1,-1],

                   "morphTargets" : [],

                   "normals" : [0.577349,-0.577349,-0.577349,0.577349,-0.577349,0.577349,-0.577349,-0.577349,0.577349,-0.577349,-0.577349,-0.577349,0.577349,0.577349,-0.577349,-0.577349,0.577349,-0.577349,-0.577349,0.577349,0.577349,0.577349,0.577349,0.577349],

                   "colors" : [],

                   "uvs" : [],

                   "faces" : [35,0,1,2,3,0,0,1,2,3,35,4,7,6,5,0,4,5,6,7,35,0,4,5,1,0,0,4,7,1,35,1,5,6,2,0,1,7,6,2,35,2,6,7,3,0,2,6,5,3,35,4,0,3,7,0,4,0,3,5],

                   "bones" : [],

                   "skinIndices" : [],

                   "skinWeights" : [],

  "animations" : []

}

是时候该摆脱这问题了……话说编写Three.js的程序员你给我给力一点啊,我恨透这个bug了:

Three.js使用Blender导出json文件Uncaught <wbr>TypeError问题,原因:新插件bug

你可能感兴趣的:(Three.js使用Blender导出json文件U…)