Guide

API

_r.load

_r.load( file, patch )

This return a BABYLON.AssetContainer.

_r.load(
    "file.gltf",
    [
        "/patches/patch1.patch",
        "/patches/patch2.patch",
    ]
).then(function (newAssets) {
    _r.select(newAssets).addToScene();
});

check _r.select methods to know how to manipulate new assets


_r.load.texture( file, patch )

This return a BABYLON.Texture.

_r.load.texture("texture.jpg").then(function(texture){
    myMaterial.albedotexture = texture;
});
_r.patch([{
    "materialName": {
        "lightmapTexture": _r.load.texture("lightmapName.jpg", {
            "vScale": -1,
            "coordinatesIndex": 1
        })
    }
}]);