Bug in code generation

Pressing “generate code” on the following texture workspace (directly from the webpage)

creates an error

react-dom.production.min.js:101 Uncaught TypeError: Cannot read properties of undefined (reading 'replace')
    at e._dumpCode (nodeMaterialBlock.ts:722:46)
    at e._dumpCode (nodeMaterialBlock.ts:768:50)
    at e._dumpCode (nodeMaterialBlock.ts:768:50)
    at t.generateCode (nodeMaterial.ts:1898:36)
    at Object.onClick (propertyTabComponent.tsx:548:134)
    at onClick (buttonLineComponent.tsx:20:51)
    at Object.Ye (react-dom.production.min.js:52:317)
    at Qe (react-dom.production.min.js:52:471)
    at react-dom.production.min.js:53:35
    at _r (react-dom.production.min.js:100:68)

The node material has an invalid multiply block, the one labelled “undefined”: this means that the name is undefined, which is why you get an error when generating the code.

I don’t know how this happened, but if you give the block a correct name, code generation will work.

2 Likes