Title: Force Selection Mode in Isaac Sim 4.5.0 via Code & Detect Viewport-only Selection Events
Details:
Isaac Sim Version: 4.5.0
Operating System: Ubuntu 22.04
I was reviewing the Selection Modes documentation in Isaac Sim and wondered if the selection mode can be programmatically enforced instead of the user having to manually choose it from the UI.
In my extension, I want to restrict the user so they can only select the root prim of a model when clicking in the viewport. Is there a way to force this behavior through code?
I tried handling it using the selection_changed event, but ran into an issue:
- The event fires for selections made both in the viewport and the Stage window.
- I need this restriction to apply only when the user clicks in the viewport, not when selecting from the Stage window.
Is there any API or recommended approach to:
- Force a specific selection mode in Isaac Sim.
- Distinguish between selection events triggered from the viewport vs. the Stage window.
Any guidance or examples would be greatly appreciated.