Modifying NME material user-defined input from within script

I’m loading an NME material via BABYLON.NodeMaterial.ParseFromSnippetAsync("MATERIAL", scene). The material has a collection of custom user-defined inputs that I would like to modify within the promise function, but struggling to find any documentation or examples on how to do this?

I had found some hints at nodeMaterial.metadata, but that’s returning as undefined for me?

The other way to do this was via nodeMaterial.getBlockByName(), is there a cleaner ay, or more “proper” way of modifying user-defined input values.

All help appreciated.

No, the right way to do it is to retrieve the block with getBlockByName or related functions and then modify the block properties.

Thank you, so the “user-defined” mode is just for the NME UI editor & Inspector panel for the material?

Thank you, so the “user-defined” mode is just for the NME UI editor & Inspector panel for the material?

Yes!

1 Like