The scene parameter appears optional in the Javascript playgrounds in many creation functions for cameras, lights, material. This is then beginning to cause issues for the few (increasing?) people using Typescript as it is not set as an optional parameter.
Whilst it’s is clearly not shown as an optional parameter in the API docs to help avoid confusion should, where it is dealt with as optional in JavaScript, be made an optional parameter in the source code?
There is quite a few I think. Cameras , lights, and materials constructors at least.
It is already optional using BABYLON.MeshBuilder.Create… but not the now depreciated BABYLON.Mesh.Create… so they could be left as those using Typescript are unlikely to use these.
Yep, the scene variable should be optional. It’s a case in different classes. @Deltakosh , let me know if you are going to take care of it, otherwise i’ll jump in.
Hi! I am moving my very first steps in Babylon.js and I’ve just found that sometimes the scene parameter is mandatory and sometimes is optional. For example:
const light = new HemisphericLight('h-light', new Vector3(1, 1, 0), scene); // mandatory
const box = MeshBuilder.CreateBox('box', {}, scene); // optional
Can you help me understand the reasoning behind this?