el-dee / panda3d-openvr Goto Github PK
View Code? Open in Web Editor NEWOpenVR integration for Panda3D
License: BSD 3-Clause "New" or "Revised" License
OpenVR integration for Panda3D
License: BSD 3-Clause "New" or "Revised" License
Oculus's APIs are extremely complicated. I think that a Quest/Rift version could be helpful. The Quest version is what I'm working on right now (using this) and Rift using pyovr shouldn't be that different (since it's made by the same person). Thanks!
When trying to use actions with the Oculus Rift S controllers all data is either None/0 and has no device path. This can be demonstrated with the stock ralph sample. You can not walk around the environment. I also noticed stuttering with the compositor submit process when actions were enabled on the Rift S
While using render pipeline, Panda3D OpenVR runs into an issue where the scene where the sun and stuff can only be seen through the desktop window, and the objects can only be seen through the HMD.
I suspect that this may be caused by the Showbase initialized by Render Pipeline.
Then, upon changing the initialization from the standard way to the following:
from rpcore import RenderPipeline, PointLight
self.render_pipeline = RenderPipeline()
self.render_pipeline.pre_showbase_init()
ShowBase.__init__(self)
self.vr = P3DOpenVR()
self.vr.init()
self.render_pipeline.create(self)
I get
Traceback (most recent call last):
File "C:\Users\zurgE\AppData\Local\Programs\Python\Python37-32\lib\site-packages\p3dopenvr\p3dopenvr.py", line 319, in right_cb
self.submit_texture(openvr.Eye_Left, self.left_texture)
File "C:\Users\zurgE\AppData\Local\Programs\Python\Python37-32\lib\site-packages\p3dopenvr\p3dopenvr.py", line 309, in submit_texture
self.compositor.submit(eye, ovr_texture)
File "C:\Users\zurgE\AppData\Local\Programs\Python\Python37-32\lib\site-packages\openvr\__init__.py", line 4360, in submit
openvr.error_code.CompositorError.check_error_value(error)
File "C:\Users\zurgE\AppData\Local\Programs\Python\Python37-32\lib\site-packages\openvr\error_code\__init__.py", line 23, in check_error_value
raise error_class(error_value, message)
openvr.error_code.CompositorError_DoNotHaveFocus
Traceback (most recent call last):
File "C:/Users/zurgE/OneDrive/Documents/Panda3D Render Pipeline Test/main.py", line 93, in <module>
Application().run()
File "C:/Users/zurgE/OneDrive/Documents/Panda3D Render Pipeline Test/main.py", line 24, in __init__
self.render_pipeline.create(self)
File "./renderpipeline\rpcore\render_pipeline.py", line 168, in create
self.loading_screen.create()
File "./renderpipeline\rpcore\gui\loading_screen.py", line 65, in create
Globals.base.graphicsEngine.render_frame()
File "C:\Users\zurgE\AppData\Local\Programs\Python\Python37-32\lib\site-packages\p3dopenvr\p3dopenvr.py", line 319, in right_cb
self.submit_texture(openvr.Eye_Left, self.left_texture)
File "C:\Users\zurgE\AppData\Local\Programs\Python\Python37-32\lib\site-packages\p3dopenvr\p3dopenvr.py", line 309, in submit_texture
self.compositor.submit(eye, ovr_texture)
File "C:\Users\zurgE\AppData\Local\Programs\Python\Python37-32\lib\site-packages\openvr\__init__.py", line 4360, in submit
openvr.error_code.CompositorError.check_error_value(error)
File "C:\Users\zurgE\AppData\Local\Programs\Python\Python37-32\lib\site-packages\openvr\error_code\__init__.py", line 23, in check_error_value
raise error_class(error_value, message)
openvr.error_code.CompositorError_DoNotHaveFocus
This makes me suspicious that the loading screen is causing some problems.
I'll try with it removed later and I'll see if it fixes it.
EDIT: Removing the loading screen sadly didn't fix the problem.
Setup
Headset: HTC Vive
Controllers: Valve Index Knuckles
SteamVR Version: 1.15.16
Issue
Upon running my game, it seems to work fine, until the SteamVR Menu (revealed by pressing the System button [Wands/Knuckles] or the menu/hamburger button [Touch 1 and 2]) is opened, and the game crashes with:
Traceback (most recent call last):
File "C:\Users\zurgE\AppData\Local\Programs\Python\Python37-32\lib\site-packages\p3dopenvr\p3dopenvr.py", line 312, in left_cb
cbdata.upcall()
AssertionError: has_mat() at line 461 of c:\buildslave\sdk-windows-i386\build\built1.10\include\transformState.I
Traceback (most recent call last):
File "C:\Users\zurgE\AppData\Local\Programs\Python\Python37-32\lib\site-packages\p3dopenvr\p3dopenvr.py", line 317, in right_cb
cbdata.upcall()
File "C:\Users\zurgE\AppData\Local\Programs\Python\Python37-32\lib\site-packages\p3dopenvr\p3dopenvr.py", line 312, in left_cb
cbdata.upcall()
AssertionError: has_mat() at line 461 of c:\buildslave\sdk-windows-i386\build\built1.10\include\transformState.I
Traceback (most recent call last):
File "C:\Users\zurgE\AppData\Local\Programs\Python\Python37-32\lib\site-packages\direct\showbase\ShowBase.py", line 2020, in __igLoop
self.graphicsEngine.renderFrame()
File "C:\Users\zurgE\AppData\Local\Programs\Python\Python37-32\lib\site-packages\p3dopenvr\p3dopenvr.py", line 317, in right_cb
cbdata.upcall()
File "C:\Users\zurgE\AppData\Local\Programs\Python\Python37-32\lib\site-packages\p3dopenvr\p3dopenvr.py", line 312, in left_cb
cbdata.upcall()
AssertionError: has_mat() at line 461 of c:\buildslave\sdk-windows-i386\build\built1.10\include\transformState.I
Traceback (most recent call last):
File "C:\Users\zurgE\OneDrive\Documents\3D Python programs\firehawk_vr2.py", line 456, in <module>
App().run()
File "C:\Users\zurgE\AppData\Local\Programs\Python\Python37-32\lib\site-packages\direct\showbase\ShowBase.py", line 3152, in run
self.taskMgr.run()
File "C:\Users\zurgE\AppData\Local\Programs\Python\Python37-32\lib\site-packages\direct\task\Task.py", line 537, in run
self.step()
File "C:\Users\zurgE\AppData\Local\Programs\Python\Python37-32\lib\site-packages\direct\task\Task.py", line 491, in step
self.mgr.poll()
File "C:\Users\zurgE\AppData\Local\Programs\Python\Python37-32\lib\site-packages\direct\showbase\ShowBase.py", line 2020, in __igLoop
self.graphicsEngine.renderFrame()
File "C:\Users\zurgE\AppData\Local\Programs\Python\Python37-32\lib\site-packages\p3dopenvr\p3dopenvr.py", line 317, in right_cb
cbdata.upcall()
File "C:\Users\zurgE\AppData\Local\Programs\Python\Python37-32\lib\site-packages\p3dopenvr\p3dopenvr.py", line 312, in left_cb
cbdata.upcall()
AssertionError: has_mat() at line 461 of c:\buildslave\sdk-windows-i386\build\built1.10\include\transformState.I
In theory, this could be caught and removed(?) once the latest release with error handling is out (by pass
ing on the error, which would most likely cause a freeze/further crashing sadly). It appears to by caused by the game not pausing when the universal menu is opened.
Interestingly enough, when this happens, the game doesn't actually run again until you reboot SteamVR, which would not be great in a production environment!
The currently available standard for OpenXR gives extra versatility to VR applications by allowing for almost any VR system to be supported by a single app. This would be an incredibly helpful feature to add. Thanks!
I recently upgraded to a Vive, and since my RTX 2060 doesn't have multiple HDMI ports, I chose to plug it into my 1050 Ti, except upon re-running my code, it spat out openvr.error_code.CompositorError_TextureIsOnWrongDevice
, I would like to be able to catch this (and other OpenVR related errors) and display an error box like so:
def on_compositor_error(error):
if error == openvr.error_code.CompositorError_TextureIsOnWrongDevice:
messagebox.showerror('An error occured','An error occurred:\nHMD is not connected to the correct device')
else:
messagebox.showerror('An error occured','An unknown error occured')
Would this be possible? Thanks in advance.
Hello,
While trying to use this, I get an Unable to read VR Path Registry
error.
This maybe because I am using Ursina Engine, but since it's based on Panda3D and that other P3D tools work, I doubt it's that.
How can I fix this ? I have tried making the file empty, but no appealing changes.
Full error :
File "C:\Users\***\Downloads\zuiahzgutzgyahz.py", line 8, in <module>
r.init()
File "C:\Users\***\AppData\Local\Programs\Python\Python38\lib\site-packages\p3dopenvr\p3dopenvr.py", line 159, in init
self.vr_system = openvr.init(openvr.VRApplication_Scene)
File "C:\Users\***\AppData\Local\Programs\Python\Python38\lib\site-packages\openvr\__init__.py", line 7170, in init
initInternal2(applicationType, pStartupInfo)
File "C:\Users\***\AppData\Local\Programs\Python\Python38\lib\site-packages\openvr\__init__.py", line 7302, in initInternal2
openvr.error_code.InitError.check_error_value(error.value)
File "C:\Users\***\AppData\Local\Programs\Python\Python38\lib\site-packages\openvr\error_code\__init__.py", line 23, in check_error_value
raise error_class(error_value, message)
openvr.error_code.InitError_Init_PathRegistryNotFound
Unable to read VR Path Registry from C:\Users\***\AppData\Local\openvr\openvrpaths.vrpath
Thanks
Same thing as in my other issue...
from pyopenvr github:
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
I was working on this and couldn't figure out how to do hand presence. I figured it would be helpful if you could add a hand presence tutorial.
Thanks in advance.
I was working on some code, and it appears that on the demo found in minimal the Right Eye is lagging while the left isn't. What could be causing this? Thanks in advance.
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.