Hi, in one project I mesh three materials (one color and two images png) to appy to a glb child object , the result is good but I can’t export it with GLTFExporter. The page simply stop to respond without any error code. Here is my code. Some ideas?
var addtxt = new THREE.TextureLoader().load('img/womaneye.png');
var addtxt2 = new THREE.TextureLoader().load( 'img/womanmouth.png');
addtxt.flipY = false;
addtxt2.flipY = false;
var material0 = new THREE.MeshPhongMaterial( {
color: parseInt('0x' + color.color),
shininess: 10,
visible: true
} );
var material1 = new THREE.MeshPhongMaterial( {
transparent: true,
map: addtxt,
shininess: 10,
visible: true
} );
var material2 = new THREE.MeshPhongMaterial( {
transparent: true,
map: addtxt2,
shininess: 10,
visible: true
} );
new_mtl = [ material0, material1, material2 ];
End with traverse add to specific glb children object:
function setMaterial(parent, type, mtl) {
parent.traverse(o => {
if (o.isMesh && o.nameID != null) {
if (o.nameID == “mychild” && type == “mychild”) {
let geometry = o.geometry;
geometry.clearGroups();
geometry.addGroup(0, Infinity, 0);
geometry.addGroup(0, Infinity, 1);
geometry.addGroup(0, Infinity, 2);
o.material = mtl;
}
}
});
}
The result is good but I can’t export it without the page stops responding. If I try to apply only one color or one texture I can export it. So I thing the problem is multi textures with addGroup and export them.