How to use mesh.setEnabled(true) so it affects all children recursively?

Hello again,
I have multiple models in .babylon file exported from Blender which are loaded on background with setEnabled(false) property. If I need to add one of them to my scene, I create instance or clone and apply setEnabled(true) on to that instance/clone. The “model library” contains also some root meshes with children. But when I try to create clone of this disabled root mesh and call clonedRootMesh.setEnabled(true), only root mesh is visible (but not pickable, what also kind of irritates me). I can see via inspector that all children of root mesh are cloned also but disabled.

I searched forum for this and based on this and this topics I believe that rootMesh.setEnabled(true) should also affect children. So is this bug or am I missing something? Do I need to loop over all children and set them enabled and pickable manually? :slight_smile:

2 Likes

This is not true :). setEnabled is not recursive for performance reasons.

To achieve your goal you have multiple options:

5 Likes

I hope it’s clear in the document. Otherwise it’s really confusing