Mesh.isEnabled versus Mesh.isVisible

Hello everyone :wave:

Can someone please help me understand the difference between Mesh.isEnabled and Mesh.isVisible? Mesh.isVisible is pretty self explanatory, however I am not sure if it should be used in conjunction with Mesh.isEnabled. Both seem to update the visibility.

I created this babylon.js playground to help me improve my understanding:

From my observations, it seems like updating Mesh.isEnabled does not necessarily change the visibility of a Mesh or the value of Mesh.isEnabled.

Some similar questions:

  • What does it mean for a node mesh to be enabled?
  • How is being enabled different than being visible?

If disabled, it will block node and its children from rendering (not considered by scene), so it improves performance. From what I know this includes all kinds of stuff like matrix (position, scale, rotation), visibility etc., everything related to scene. That way the renderer can skip all the calculations and it will use less memory/storage.

While invisible meshes can still update its matrix (position, scale, rotation), so you can move them like as collision meshes. Which (the collision) will not be considered on disabled meshes.

Note: I never heard of isVisible-property for nodes.

3 Likes

Thank you @Takemura. This helps a lot :pray: