Optional scene parameter in JavaScript causes issues in Typescript

@RaananW @roland

This is a follow on from

https://forum.babylonjs.com/t/backwards-compatibility-broken-in-showworldaxis-example/27039/25

and related to Quest to create a Hologram with a JPEG! (how to? using Thin Instances, Matrix, Arrays) - #69 by JohnK

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?

1 Like

Which functions are we talking about? I’m happy to flag the parameter as optional

2 Likes

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.

1 Like

I’ll have a look

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.

2 Likes