openvr

2.5.101last stable release 5 months ago
Complexity Score
Medium
Open Issues
36
Dependent Projects
2
Weekly Downloadsglobal
1,505

License

  • BSD-3-Clause
    • Yesattribution
    • Permissivelinking
    • Permissivedistribution
    • Permissivemodification
    • Nopatent grant
    • Yesprivate use
    • Permissivesublicensing
    • Notrademark grant

Downloads

Readme

pyopenvr

Unofficial python bindings for Valve’s OpenVR virtual reality SDK, located at https://github.com/ValveSoftware/openvr

DEPRECATION NOTICE

Our upstream SDK OpenVR is no longer being updated. Everyone is switching to OpenXR instead. We are working on similar bindings for OpenXR at https://github.com/cmbruns/pyopenxr

Installation

  • Install Python 3.5+ https://www.python.org/download/
  • Install HTC Vive SteamVR
  • pip install openvr OR download the installer at https://github.com/cmbruns/pyopenvr/releases

Use

import sys
import time
import openvr

openvr.init(openvr.VRApplication_Scene)
poses = []  # will be populated with proper type after first call
for i in range(100):
    poses, _ = openvr.VRCompositor().waitGetPoses(poses, None)
    hmd_pose = poses[openvr.k_unTrackedDeviceIndex_Hmd]
    print(hmd_pose.mDeviceToAbsoluteTracking)
    sys.stdout.flush()
    time.sleep(0.2)
openvr.shutdown()

For more advanced usage, consult the example at https://github.com/cmbruns/pyopenvr/blob/master/src/samples/glfw/hellovr_glfw.py, which is a complete faithful translation into python from the original C++ sample at https://github.com/ValveSoftware/openvr/tree/master/samples/hellovr_opengl

Dependencies

CVE IssuesActive
0
Scorecards Score
2.40
Test Coverage
No Data
Follows Semver
No
Github Stars
247
Dependenciestotal
19
DependenciesOutdated
0
DependenciesDeprecated
0
Threat Modelling
No
Repo Audits
No

Learn how to distribute openvr in your own private PyPI registry

pip install openvr
Processing...
Done

36 Releases

PyPI on Cloudsmith

Getting started with PyPI on Cloudsmith is fast and easy.