When Created a pbrmaterial from node material error occurring in babylon js

Texturing is getting applied when we have used direct output to fragment output but when added pbrmetallicroughness error occurs in run time …

Link for material nodes


Uncaught TypeError: Cannot read property ‘getInputByName’ of undefined
at NodeMaterial._restoreConnections (nodeMaterial.js:1028)
at NodeMaterial._restoreConnections (nodeMaterial.js:1033)
at NodeMaterial.loadFromSerialization (nodeMaterial.js:1068)
at XMLHttpRequest.eval (nodeMaterial.js:1145)

It does work for me:


Yes but when i try to change texture dynamically using babylon js code getting the above error with br materials here is the code for that

 NodeMaterial.ParseFromSnippetAsync("JDC8BL", scene).then(nodeMaterial  => {
                let maskedblocks = nodeMaterial.getTextureBlocks();
                for(var i=0;i<maskedblocks.length-1;i++)
                        maskedblocks[i].texture =new Texture(Globals.CurrentTexture.hdimageurl,scene);
                    else if (maskedblocks[i].name ="BookMatchUV2")
                        maskedblocks[i].texture =new Texture(Globals.CurrentTexture.hdimageurl,scene);

You should use “==” and not “=” when testing maskedblocks[i].name.