This addresses T77137 VR: Python API for Controller Interaction.
This patch allows users to create custom OpenXR input / output actions via the Python API. It also adds basic VR controller visualization.
Changes are implemented at the GHOST, WM, and RNA / Python layers.
User-created actions can be used to execute a Python operator, retrieve state from a button or pose, or send a haptic pulse when performed during a VR session. Bindings for actions, using [[ https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#semantic-path-interaction-profiles | OpenXR paths ]] are entirely defined by the user to allow the API to extend to any hardware supported by OpenXR.
The "VR Scene Inspection" Python add-on has also been extended to use the new VR action functions. This way, users can create and customize actions via the add-on sidebar if they prefer.
{F8961077}
{F8961078}
{F8961079}
Visualization of VR controllers is first achieved by reading the state of a user-specified VR pose action. Then, custom drawing via the Python add-on (for screen visualization) as well as offscreen rendering from within Blender (for in-headset display) is performed to portray the controller axes. This basic visualization can later be replaced with more appropriate controller geometry.
{F8961129}
{F8961139}
{F8961140}
{F8961144}