提交 70dbf954 编写于 作者: M Mr.doob

Updated JSONLoader to allow material-less data.

上级 12220727
...@@ -419,6 +419,12 @@ THREE.JSONLoader.prototype.parse = function ( json, texturePath ) { ...@@ -419,6 +419,12 @@ THREE.JSONLoader.prototype.parse = function ( json, texturePath ) {
}; };
if ( json.materials === undefined ) {
return { geometry: geometry };
} else {
var materials = this.initMaterials( json.materials, texturePath ); var materials = this.initMaterials( json.materials, texturePath );
if ( this.needsTangents( materials ) ) { if ( this.needsTangents( materials ) ) {
...@@ -427,9 +433,8 @@ THREE.JSONLoader.prototype.parse = function ( json, texturePath ) { ...@@ -427,9 +433,8 @@ THREE.JSONLoader.prototype.parse = function ( json, texturePath ) {
} }
return { return { geometry: geometry, materials: materials };
geometry: geometry,
materials: materials }
};
}; };
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册