AddAttribute on CustomMaterial or PBRCustomMaterial using Typescript

When using typescript for our project, AddAttribute is not found as a valid property on instances of either the CustomMaterial or PBRCustomMaterial class. Are we missing an import statement? We currently:
import { PBRCustomMaterial, CustomMaterial } from ‘babylonjs-materials’;

and then:
let myCustomMat= new PBRCustomMaterial(“uvAdjustableMat”, scene);
myCustomMat.AddAttribute(“uvc”); //this is the error line. AddAttribute is shown as not a valid property

Make sure you use the preview version of 4.2, as it is new in 4.2.

Ahh yes, Thank you!!! That was it. This did the trick:

npm install babylonjs-materials@4.2.0-alpha.17

1 Like