When ctx.json.images[textureInfo.source].uri is undefined, glTF model can't load.
The 860 line in loadTexture function in glTFModel.js
function loadTexture(ctx, textureInfo) {
var texture = new xeogl.Texture(ctx.scene, {
src: ctx.basePath + ctx.json.images[textureInfo.source].uri,
flipY: !!textureInfo.flipY
});
ctx.model._addComponent(texture);
textureInfo._texture = texture;
}
This function load texture image from image file. But when the gltf model's texture is in buffers block embed in gltf file, the textures block hasn't uri property, so that code will cost 404 not found error.
I modify this code to
function loadTexture(ctx, textureInfo) {
var texture = new xeogl.Texture(ctx.scene, {
src: ctx.json.images[textureInfo.source].uri ? ctx.basePath + ctx.json.images[textureInfo.source].uri : undefined,
flipY: !!textureInfo.flipY
});
ctx.model._addComponent(texture);
textureInfo._texture = texture;
}
When ctx.json.images[textureInfo.source].uri is undefined, glTF model can't load.
The 860 line in loadTexture function in glTFModel.js
This function load texture image from image file. But when the gltf model's texture is in buffers block embed in gltf file, the textures block hasn't uri property, so that code will cost 404 not found error.
I modify this code to