How can I line trace on a nested component in a USD?

I’m trying to use line trace by channel to determine what a user has clicked on within a USD scene. If the USD file is “flat” with all my objects of interest at the root level then this works fine.

e.g. if the file looks like this:
/Obj1
/Obj2
/Obj3

and if the user clicks on Obj3 I get Obj3 reported

However, if the file has some logical nesting, then I only get the top-level actor

e.g. if the file looks like this:
/Group
/Group/Obj1
/Group/Obj2
/Group/Obj3

and if the user clicks on Obj3 then, when I do the line trace, I get an actor with a static mesh component that is called Group and contains the meshes for Obj1, Obj2 & Obj3.

Any ideas of how I can solve this? (One solution will be to pre-process the USD files and flatten them - but I’d rather not have to do that)

In your case where you have one actor, one static mesh component and your different objects as sections of a mesh then I do not think that is possible.

The line trace can tell you the actor, the component and the index of element selected.