MeshButton3D mesh question

Hi

Please take a look at
https://playground.babylonjs.com/#C0SYBY

It is a normal behaviour?
Why we can’t get mesh property while addControl not complete? We determinate mesh in constructor.
I think it not correct, but im not sure.
Also _currentMesh internal property is setted to mesh.
But we not have any signals about have Object mesh property or not. Only many check’s?

This is because the 3D gui mesh is created based on the manager properties (it needs a lot of info flowing from it) like the hosting layer scene, metadata, etc…

Hence the delayed creation of the property value :wink:

2 Likes

Thank’s, i catch it.
Then, would be great have a ready callBack or Observer?
With async processes that ambiguity might be problem.

As example - panels have IColorable interface, and of cource use mesh from Controls3D, but how we can be sure, that interface ready to change materials and colors in that case?

How you think? Perhaps it will be possible in further? onReady callback maybe?

1 Like

It is a good idea…wanna do a PR to add it at Control level?

1 Like

I afraid just now i can’t do this because not sure that my level is enought for that.
But i will add it in TODO and going to try )

2 Likes