Undefined texture to load JSON material with MaterialLoader

Hello, I have an Object and a texture that come from an API to apply to my object. I’m using ObjectLoader to load the JSON object and everything works just fine.
Otherwise, to load the JSON texture/material, I’m using MaterialLoader and it gives a warning saying:

THREE.MaterialLoader: Undefined texture E0C0F117-56BD-4B63-983A-081E086FA617

This is the JSON file with the texture: https://jsonblob.com/4af185bb-aaa8-11e8-9316-331e2397d779
And I’ll leave my code here too:

import React from 'react';
const THREE = require('three');
const OrbitControls = require("three-orbit-controls")(require("three"));

const url = 'myUrlAPI';

export class ThreeScene extends React.Component {

constructor(props) {
    super(props);
    this.rootRef = React.createRef();
}

componentDidMount() {
    const { width, height, json, texture } = this.props; 

    //CREATE SCENE
    var scene = new THREE.Scene();

    //CAMERA
    var camera = new THREE.OrthographicCamera(window.innerWidth / - 2, window.innerWidth / 2, window.innerHeight / 2, window.innerHeight / - 2, 1, 2000);
    camera.position.set(0, 10, 200);
    scene.add(camera);

    //LIGHTS
    var light = new THREE.HemisphereLight(0xffffbb, 0x080820, 1);
    scene.add(light);

    //RENDERER
    var renderer = new THREE.WebGLRenderer({
        alpha: true
    });
    renderer.setSize(width, height);
    renderer.setClearColor(0x000000, 0);
    this.rootRef.current.appendChild(renderer.domElement);

    //OBJECT LOADER
    var loader = new THREE.ObjectLoader();
    loader.load(url + json, verLoad);

    function verLoad(obj) {
        obj.position.z = -10;
        scene.add(obj);
        obj.scale.set = (2, 1, 1);

        //TEXTURE
        var textureLoader = new THREE.MaterialLoader();

        textureLoader.load(
            url + texture, function (material) {
                obj.material = material;
            }
        );
    }

    //CONTROLS
    const controls = new OrbitControls(camera, renderer.domElement);
    controls.enableZoom = true;
    controls.maxDistance = 500;
    controls.minDistance = 100;
    controls.maxPolarAngle = Math.PI / 2;

    //ANIMATION
    function animate() {
        requestAnimationFrame(animate);
        renderer.render(scene, camera);
        controls.update();
    }
    animate();
}


render() {

    return (
        <div ref={this.rootRef} id="ImagemSofa"></div>
    )

}
}

Object json file: jsonObject.zip (3.5 MB)

Texture json file: jsonTexture.txt (3.5 MB)

Strange. No property (e.g. map or envMap) in your linked JSON file uses E0C0F117-56BD-4B63-983A-081E086FA617 in order to refer to a texture.

Maybe the warning is thrown when loading with ObjectLoader? It internally uses MaterialLoader for material parsing.

No, when I had just ObjectLoader, didn’t throw any error. Just when I tried to use MaterialLoader @Mugen87

Any chances to provide a live example for debugging?

Do you mean like the object itself?
https://jsonblob.com/ca0df027-ac42-11e8-b692-57bf823c50c9 see if this works

I don’t know why but your provided link takes ages to load :thinking: . I think it’s better if just upload the file to this forum and don’t use jsonblob.

Besides, I’ve actually meant you provide a real live demo of the application. This makes it easier for community members to investigate your problem.

There’s some sensitive information in the live demo, so I can’t post that here :confused: There’s no other solution?

Okay, then try to share the JSON-object as an attachment in this thread.

Already updated the question @Mugen87

Can you also share the file which you try to load with ObjectLoader? As far as I can see, the linked file json_object.txt just contains a material. But you should only load JSON with ObjectLoader that was generated via Object.toJSON().

Check the console output of this fiddle to see the intended JSON: https://jsfiddle.net/f2Lommf5/12724/

Sorry my mistake, see again

Um, it seems both files are identical.

What? You sure? See again

Okay, looks better now. Unfortunately, I could not find something unusual in the file. And it loads fine in the three.js editor.

Um, a live example would be really helpful in this case. If you can’t share your whole app, try to reproduce the problem in a reduced, isolated test case. This is probably the best way in order to make progress in this issue.

Can this a bug of r95 version of three.js?

Not sure. But posting a bug at github should only be done if you can clearly demonstrate an issue. A live example is the perfect tool for this.