Procedural Texture Generated by Export

Using the playground from the documentation of procedural textures, I just pressed “Export Code” and tried to generate the same texture in the code:

However, this yields an error:
“Incompatible material mode”
and the texture silently fails.
Indeed, if you open the Node editor the mode is “Texture”. What does one need to do to get the mode back to “Procedural”? It may be helpful if that missing line is somehow included in the code, when exporting it.

I found the missing line by playing around:
nodeMaterial.mode = BABYLON.NodeMaterialModes.ProceduralTexture;
Seems to do the trick. Here is the playground:

1 Like

This PR will add the code for the “mode” property: