MultiMaterial Observable

Hello

I noticed the Scene class has onNewXXXAddedObservable onXXXRemovedObservable for many properties which are conventionally added by imported like GLTF, e.g. materials, geometries, etc.

However I noticed BJS doesn’t have these observables for MultiMaterials. Can the BJS team add it in next release? I can’t think of a reason for omitting observables for it and should be super simple to add.

Scene.onNewMultiMaterialAddedObservable = new Observable();
Scene.onMultiMaterialRemovedObservable = new Observable();

It’s useful for us because our users can delete any property that they choose to import via GLTF, including multi materials. We track what is deleted with observables to decide whether a GLTF needs to be re-imported for loading an existing project. Having these observables for multimaterial would help mitigate the risk of dangling multimaterials that is missed out by our app’s tracker and so we end up needlessly re-importing unused GLTFs.

They should already raise the material event and this one you could check for the className being multiMaterial ???

In the Scene class, my expectation is for a MultiMaterial observable to notifyObservers in addMultiMaterial method. As you can see below, a material event is not raised.

In any case, materials and multimaterials are different, no? One is added to a materials array while another is added to multiMaterials array.

Ok I ll add the events in

Thanks seb :slight_smile: