Skip to content

API Documentation

Christopher Bruns edited this page Nov 17, 2016 · 7 revisions

At the moment the pyopenvr API is NOT well documentated.

pyopenvr is a wrapper around the C-language API, documented at: https://github.com/ValveSoftware/openvr/wiki/API-Documentation

pyopenvr functions DO have docstrings, so some API documentation can be discovered using python introspection. For example:

>>> import openvr
>>> dir(openvr)
>>> help(openvr)

In general,

  • The C++ namespace 'vr::' becomes python module 'openvr.'
  • C++ functions with prefix "VR_" lose the prefix
  • C++ function names that begin with a capital letter, begin with a lower case letter in python
  • C++ functions that take an error pointer argument, instead raise an exception in python if something goes wrong.

Thus the C++ function call

vr::IVRSystem * system = vr::VR_Init( peError, vr::VRApplication_Scene );

becomes python

system = openvr.init(openvr.VRApplication_Scene)

Clone this wiki locally