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.