setToDefaultProceduralTexture
is indeed not what you want as it creates the default blocks for a procedural texture node material that are just added to the existing blocks: it is used by the NME itself to create the starting state when you click on “Reset to default”.
Regarding your problem, it seems first that you did not generate the code corresponding to your latest iteration in the NME, some blocks are missing. Also, the “xy” input of the VectorMerger
is named “xyIn” internally, so the generated code positiond.output.connectTo(PositionD.xy );
should be positiond.output.connectTo(PositionD.xyIn );
instead. Making those changes and adding nodeMaterial._mode = BABYLON.NodeMaterialModes.ProceduralTexture;
does work:
https://playground.babylonjs.com/#L8IJYI#3
Of course, you should not have to do those changes yourself (and updating a private property is not a solution, anyway).
Pinging @Deltakosh as I don’t really understand the code of VectorMergerBlock
(the inputs are registered as "xyz " and "xy " with a space in them and not as “xyzIn” / “xyIn”) and I’m not sure how to fix those problems…