Get list of all children

When adding the loaded model to the scene, you can use the following code in order to traverse through the object hierarchy and push all descendants into an array:

const objects = [];

// in your onLoad() callback

model.traverse( ( child ) => {

    if ( child.isMesh ) objects.push( child );

} );

Change the if condition if you also want to add lines or point clouds.

1 Like