Code generated from material editor not working?

Hi,

I want to use the material at https://nme.babylonjs.com/#1E76JR#11 in my code

I know I can load from snippet, but I want everything to be inside my javascript code and no dependency on external files. So I found “Generate code” in the material editor. The used textures are extremely small so the shader is really very manageable.

I made a playground at Babylon.js Playground that is a very simple scene that uses this code to generate the material and build it.

The code I used from the “generate code” was perfectly the same as exported.

But I get an error: (Playground 8.32.0 (Webgl2))

TypeError: Cannot read properties of undefined (reading 'ownerBlock')
    at e.checkCompatibilityState (nodeMaterialBlockConnectionPoint.ts:554:44)
    at e.canConnectTo (nodeMaterialBlockConnectionPoint.ts:544:21)
    at e.connectTo (nodeMaterialBlockConnectionPoint.ts:614:41)
    at createScene (<anonymous>:456:13)
    at window.initFunction (<anonymous>:511:16)
    at async R._compileAndRunAsync (rendererComponent.tsx:447:17) 'Retrying if possible. If this error persists please notify the team.'


The error says → notify the team. So I wonder if something could be broken ?

I hope this is fixable? Maybe some kind of version mismatch ? I don’t know it’s over my head.

Kind regards,

Bart

this should work https://playground.babylonjs.com/#XL6X7L#1 and I ll push a fix for the generation code soon.

1 Like