How to highlight the whole model instead of children?

hello!.
I used outlinePasss to highlight the model when pointerMove, but it was not the result I wanted.
1716256385486
The effect I want is to make the model as a whole highlight non-children. Like this…

To achieve overall highlighting, you must obtain intersects[ 0 ]?.object?.parent to highlight the parent. However, there may be grandchildren under the children, so obtaining the parent cannot satisfy all requirements.

I use c4d to connect objects + delete merged layers, but it seems that the materials are not merged successfully. Triggering the pointerMove event can still filter out the children materials and trigger the highlighting of children.

When loading the model using GLTFLoader (or any other loader you’d be using), you can traverse the loaded scene and just assign the top-most element as the actual root:

new GLTFLoader().load(modelUrl, ({ scene }) => {
  scene.traverse(child => {
    child.userData.root = scene; // NOTE Now whenever you raycast against this submesh, you can obtain the top-most element via intersects[0].object.userData.root
  });
});

mjurczyk. Thank you for your very good idea for handle model data.But it doesn’t seem to be relevant to what I want.
The red box is my model root data.


I want to highlight the whole root data when the pointerMove, instead of highlighting any mesh in the children.