OpenXR API Reference and Unity OpenXR

I was looking for a way to load controller models via OpenXR, and came across the following API call in the OpenXR API reference page: xrLoadControllerModelMSFT where the runtime attempts to return a model for the currently connected controller devices, supplied through a key also retrieved with an API call.

I tried to call this via DLLImport, but I couldn’t be found, so I checked the UnityOpenXR.DLL file with the dumpbin tool and noticed it did not have a call exposed for: xrLoadControllerModelMSFT, and most of the OpenXR API calls are missing.
I checked Microsofts implementation of the OpenXR API thats in the MRTK toolkit, and I saw they exposed their own version of this method in their OpenXR runtime.

Are there any plans to expose more of the native OpenXR calls, or is there another way I can access some of the functions like xrLoadControllerModelMSFT without creating my own native library for OpenXR?

Also, does Unity not support OpenXR completely yet, or why does Unity not expose the OpenXR features/calls from the OpenXR API reference?

I cannot answer the technical questions, but you can check which controllers are used in script via XR Management and then change the model yourself

OpenXR works like OpenGL in the sense that you don’t have native functions floating around but you use xrGetInstanceProcAddr to get the function pointer. The xrGetInstanceProcAddr is available from
OpenXRFeature.xrGetInstanceProcAddr

I cannot really provide more details as I haven’t needed this so far, just thought this might nudge you in the right direction.

1 Like