Hello @all, I am actually experiencing troubles with Babylon.js multimaterial. I try to mix a Material out of one and another texture. If I do so, the engine throws an error Message Back: “TypeError: undefined is not an object (evaluating ‘i.multiMaterials’)”. The error is caused by the Line of Code I try to implement the Mutlimaterial.
//Begin WhiteFacedGreenMat
basicMat = new BABYLON.StandardMaterial('mat', scene);
var texture = new BABYLON.Texture(
domainExtension + '/images/mytextures/textureBlank.png',
scene,
);
texture.scale = 1;
basicMat.bumpTexture = texture;
basicMat.diffusecolor = new BABYLON.Color3(0.5, 0.5, 0.5);
whitefaceBasisMat = new BABYLON.StandardMaterial('facewhiteBasisMat', scene);
var texture = new BABYLON.Texture(
domainExtension + '/images/mytextures/textureFace.png',
scene,
);
whitefaceBasisMat.bumpTexture = texture;
var multimat = new BABYLON.MultiMaterial("multi", scene);
multimat.subMaterials.push(basicMat);
multimat.subMaterials.push(whitefaceBasisMat);
whiteFacedmat = new BABYLON.StandardMaterial('whiteFacedmat', scene);
whiteFacedmat.material = multimat;
Hope someone could help me out with this ^^