cmbruns / pyopenxr Goto Github PK
View Code? Open in Web Editor NEWUnofficial python bindings for OpenXR access to VR and AR devices
License: Apache License 2.0
Unofficial python bindings for OpenXR access to VR and AR devices
License: Apache License 2.0
.make_array() is called on too many inappropriate objects.
It's not working, but it's getting close.
like for xr.ApplicationInfo(), so it can accept unicode strings
...to make room for a class called "Instance", for example. The low level opaque handle type should be "InstanceHandle"
I want to record the hmd and the controllers positions and rotations into a csv file while playing a steam-vr game , would it be possible at the current state of the library ? where should i start looking how to do that ?
GitHub notified me of the update to the README of pyopenvr. Since you're switching to OpenXR and I just happen to know that Blender (a Python-based free and open source 3D creation suite) has been working on integrating it as well. You might be able to reuse some code from that project:
https://wiki.blender.org/wiki/Source/Interface/XR
I don't know the current state of that project, but thought to just leave this pointer here ^-^
this was an ill considered hack.
A particular Type might have these three api names:
C: "uint32_t"
ctypes: "c_uint32"
python: "int"
This is the last major missing piece before we can begin trying to actually code things using pyopenxr
for example enumerate_intance_extension_properties(layer_name=None)
instead of CTypesPrimitiveType...
Keep simple uses as simple as possible via exceptions and reasonable defaults
with xr.System() as system:
pass
python -m build --sdist --wheel
twine upload --repository pypi dist/*
1.0.1901
at current HEADAttributes:
Methods:
so we can say "foo" in props
like XR_USE_GRAPHICS_API_OPENGL
and XR_USE_PLATFORM_WIN32
etc.
OpenXR has some logging functions. We should hook those up to the python logging system.
Such as XrSpaceVelocityFlags
See unit tests at https://github.com/KhronosGroup/OpenXR-Hpp/blob/master/tests/flags.cpp
... and maybe structs at the same time. This is a prerequisite to wrapping the raw C functions.
For eventual use in planned track_hmd.py
python -m build --sdist --wheel
twine upload --repository pypi dist/*
1.0.1901
at current HEADHi,
I am trying to get a headless session (without the compositor) with the XR_MND_headless extension.
I modified the example script a bit:
import time
import xr
available = xr.enumerate_instance_extension_properties()
required = [xr.MND_HEADLESS_EXTENSION_NAME]
for prop in required:
assert prop in available
with xr.Instance(application_name="track_headless", requested_extensions = required) as instance:
with xr.System(instance) as system:
with xr.Session(system) as session:
for _ in range(50):
print ("entered loop")
session.poll_xr_events()
But it fails at system creation:
Info: All enumerated devices attached.
Info: Loaded drivers: HTCVive
Info: Adding tracked object T20 from HTC
Info: Device T20 has watchman FW version 1562916277 and FPGA version 538/10/2; named ' watchman'. Hardware id 0x110e0009
Info: Detected LH gen 2 system.
LOG in xrCreateInstance: Info: Adding lighthouse ch 1 (idx: 0, cnt: 1)
Instance created
createInfo->applicationInfo.applicationName: track_headless
createInfo->applicationInfo.applicationVersion: 0
createInfo->applicationInfo.engineName: pyopenvr
createInfo->applicationInfo.engineVersion: 1902
appinfo.detected.engine.name: (null)
appinfo.detected.engine.version: 0.0.0
quirks.disable_vulkan_format_depth_stencil: false
Info: OOTX not set for LH in channel 1; attaching ootx decoder using device T20
Info: LightcapMode (T20) 1 -> 2
Info: MPFIT stats for T20:
Info: seed runs 0 / 0
Info: error failures 0
Traceback (most recent call last):
File "/home/adi/xrwork/pyopenxr/examples/track_nohmd.py", line 10, in <module>
with xr.System(instance) as system:
File "/home/adi/.local/lib/python3.9/site-packages/xr/classes.py", line 115, in __init__
get_instance_proc_addr(
File "/home/adi/.local/lib/python3.9/site-packages/xr/functions.py", line 33, in get_instance_proc_addr
raise result
xr.exception.FunctionUnsupportedError: The requested function was not found or is otherwise unsupported.
And this is the part of the System class being the culprit:
self.pxrGetOpenGLGraphicsRequirementsKHR = ctypes.cast(
get_instance_proc_addr(
self.instance.handle,
"xrGetOpenGLGraphicsRequirementsKHR",
),
PFN_xrGetOpenGLGraphicsRequirementsKHR
)
... and message strings for XrResult
based exceptions.
This is not a full solution to #21 because there are no docstrings for the commands/functions in xr.xml. Where does that text come from?!
This might require some sort of custom file writing.
Once this project is minimally working, we should give the opportunity for relevant collaborators to join. For example:
@jherico
@risa2000
@lgbeno
@tomgoddard
@JoeLudwig
@jeremyselan
@gregpinero
@Ralith
@rpavlik
@artob
The standard header has no docstring comments. But it should be possible to pull documentation from the OpenXR-Registry project
...to formalize the de facto development process.
Contains code we would like the generator to eventually generate.
Remember do not combine whitespace changes with other changes tho
as described at #19 (comment)
Each xr module file should have correct arrangement of docstring, import, etc.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.