Hi everyone, I am building my own 3d model editor with threejs.
I can create a new 3d object or import existing models in the type of gltf, obj, ifc, etc.
And I am going to save workspace in a json format or something else.
I tried with toJSON, gltf exporter but none of them was helpful.
How can I solve this problem?
What do you mean with ānot helpfulā? In general, the JSON format of three.js
is ideal for such a use case. It is also used by the three.js
editor.
Thanks for quick reply.
Here is what I did with toJSON and ObjectLoader.
//exporting
var sceneData = this.scene.toJSON();
//importing
var loader = new THREE.ObjectLoader();
loader.load(
āscene.jsonā,
function (scene) {
self.scene = scene;
},
function (xhr) {
console.log((xhr.loaded / xhr.total * 100) + ā% loadedā);
},
function (err) {
console.error(āAn error happenedā);
}
);
And I could get this result with unexpected error.
Origin object:
Loaded object:
Error:
Hi Zap, I am new to threejs myself and I am not a programerā¦ But I do have 20+ years of modeling experience in Maya, 3DSmax, ZBrush, and Blenderā¦ If you ever need a beta tester let me know! Good luck with Save and Loadā¦
Sure things.