When I export a model with embedded textures it loads fine in windows 3d viewer and elsewhere, but if I don’t embed the textures (embedImages set to false on the exporter) it fails to load… Apparently there is an error… I ran the file through the validator:
gltfObject = new THREE.Mesh( gltfGeometry, gltfMaterials );
// Instantiate a exporter
var exporter = new GLTFExporter();
// Parse the input and generate the glTF output
exporter.parse( gltfObject, function ( gltf ) {
//code that saves the parsed data to the file is here
}, { binary: (structure.formatType=='glb'?true:false), embedImages: structure.embedTextures } );
For more explanation, that is the code I am using to export my gltf and glb files… The only thing that causes the error in the file is when setting the embedImages to false. In the THREE documentation it says that you can set embedImages to false in order to prevent the images from being embedded into the file… but it isn’t working! Is this a bug with the GLTFExporter?
Okay, I’ve provided the jsfiddle that shows the issue. It works fine if it is embedded but it breaks if it isn’t embedded… I need to figure out how to get it to work without embedding the images, so hopefully someone has a solution.