Setting Node Material Textures Dyanmically

This is probably an easy question, but let’s say I have a Node Material snippet I load as a JSON file.

 const nodeMaterial = new BABYLON.NodeMaterial("mat", scene);
    nodeMaterial.loadAsync("").then(() => {
        console.log(nodeMaterial.getBlockByName('Bump texture'));

What I want to be able to do is update the bump texture to a dynamic URL. Is there an example of this somewhere?

Yep, you can use:
nodeMaterial.getBlockByPredicate(input => === "The Name of your block").texture = myDynamicTexture

1 Like

Thanks, that works!