Get motion controller name

Hi, I’m trying to get the name of currently used motion controllers, but GetMotionControllerData always returns invalid output with an empty name with OpenXR. Is there a reliable way to do this? Or maybe there’s a way to get valid controller data?

OpenXR doesn’t know what controllers are available until the runtime binds the interaction profiles for them. At least the SteamVR runtime doesn’t bind them until the session is focused, which only happens after the application has been running a few frames and the user has put on the headset and closed the dashboard.

There is an OpenXR event for when the profiles get bound, but I don’t think the plugin currently exposes it. I think the only way currently available is to poll GetMotionControllerData until the data is available.

1 Like

Is that how UMotionController knows what mesh to display?

Yes, the code that handles it is in OpenXRAssetManager.cpp. OpenXR is intentionally designed to give out as little information about the controllers as possible, so it’s limited to just querying the current interaction profile name.

1 Like