NME code gen missing required params for Texture

PG Babylon.js Node Material Editor
File > Generate Code


// TextureBlock
var Texture = new BABYLON.TextureBlock("Texture");
Texture.texture = new BABYLON.Texture("https://www.babylonjs-playground.com/textures/BJS-logo_v3.png");


Texture.texture = new BABYLON.Texture(
   scene    // <<< add this 


Texture.texture = new BABYLON.Texture('...')

lint err, tsc err

This should work as by default it would use the last created scene on Engine. The main issue is we can not infer the name of the member holding on the scene in the case of generated code.

I ll check to be sure in TS that the scene is an optional input.

1 Like

Will be fixed in the next nightly, it should now be ok with ts

1 Like

codegen digests a factory maybe more practical, e.g.

function NodeMaterial_Foo(scene, engine, inspectableValuesMap) {
  var nodeMaterial = new NodeMaterial(..) 
  // .. 
  return nodeMaterial

Then we are able to create variations of Foo

var mat0 = NodeMaterial_Foo(scene, engine, config0) 
var mat1 = NodeMaterial_Foo(scene, engine, config1)