提交 c97101fe 编写于 作者: F Fernando Serrano

Added callback

上级 cea04d51
...@@ -190,7 +190,9 @@ ...@@ -190,7 +190,9 @@
var gltfExporter = new THREE.GLTFExporter(); var gltfExporter = new THREE.GLTFExporter();
// gltfExporter.parse(scene); // gltfExporter.parse(scene);
//console.log(JSON.stringify(gltfExporter.parse(scene), null, 2)); //console.log(JSON.stringify(gltfExporter.parse(scene), null, 2));
saveString( JSON.stringify(gltfExporter.parse(scene),null, 2), 'scene.gltf' ); gltfExporter.parse(scene, function(result){
saveString( JSON.stringify(result,null, 2), 'scene.gltf' );
});
// //
......
...@@ -608,7 +608,7 @@ THREE.GLTFExporter = function () {}; ...@@ -608,7 +608,7 @@ THREE.GLTFExporter = function () {};
THREE.GLTFExporter.prototype = { THREE.GLTFExporter.prototype = {
constructor: THREE.GLTFExporter, constructor: THREE.GLTFExporter,
parse: function ( input ) { parse: function ( input, onDone ) {
var outputJSON = { var outputJSON = {
/* /*
...@@ -939,10 +939,7 @@ THREE.GLTFExporter.prototype = { ...@@ -939,10 +939,7 @@ THREE.GLTFExporter.prototype = {
base64data = reader.result; base64data = reader.result;
outputJSON.buffers[0].uri = base64data; outputJSON.buffers[0].uri = base64data;
console.log(JSON.stringify(outputJSON, null, 2)); console.log(JSON.stringify(outputJSON, null, 2));
onDone(outputJSON);
} }
return outputJSON;
} }
}; };
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册