Property [emissive] not included in blender export

I am assuming that you actually meant emissiveColor. In the 2.80 exporter, you need to have the emission Node twice. Once for the color, & again for the texture. It was an oversight not to put in white in when only a texture was found, in the case of emissive. The default for Albedo is white, while emissive is black.

The 2.93 exporter is starting dev very soon. This will be rectified there, as well as:

  • reading emissive from the principled node type
  • providing for overloading, so that the same node field can be used for both a color & a texture, though Blender itself will not actually perform it that way.

See, Enhancements for Blender 2.93 LTS for more.

What I would do for now is just execute a loop one time after all your loads have occurred, rather than edit JSON files by hand. Assuming you are doing SceneLoader.Append(s), you can do it in an executeWhenReady()

const canvas = document.getElementById("renderCanvas");
const engine = new BABYLON.Engine(canvas, true);
const scene = new BABYLON.Scene(engine);

BABYLON.SceneLoader.Append("./", "fileA.babylon", scene);
BABYLON.SceneLoader.Append("./", "fileB.babylon", scene);
scene.executeWhenReady(function () {
    for (const mat of scene.materials) {
        if (mat instanceof BABYLON.PBRMaterial || mat instanceof BABYLON.StandardMaterial) {
            if (mat.emissiveTexture && !mat.emissiveColor) mat.emissiveColor = BABYLON.Color3.White();
        } else if (mat instanceof BABYLON.MultiMaterial) {
            for (const sub of mat.subMaterials) {
                if (sub.emissiveTexture && !sub.emissiveColor) sub.emissiveColor = BABYLON.Color3.White();
            }
        }
    }
});
3 Likes