-
-
Notifications
You must be signed in to change notification settings - Fork 184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
xr.controller_grip_location_get pre_draw callback not working #1894
Comments
Hi, you can try to move pre_draw callback execution from KX_KetsjiEngine::RenderCameras to KX_Scene::RenderAfterCameraSetup and test. If it works for you, i'm ok to move it here. |
Hi, I've tried moving it to different zones inside KX_Scene::RenderAfterCameraSetup, but the problem is still there. Setting a location works, but reading it, doesn't. |
Doing some tests, seems like moving the object works, but reading the position of the controllers, could be happening before the scripts, and even if the navigation location changes, the controller position is not updated to the new navigation location until the next frame. I've printed the controller location, and the sphere location, and they're at the same position at the moment of running the script, for now it can be semi-fixed calculating the previous location of the navigation location - actual navigation location, then that vector can be added to the controller location, but the rotation still gets delayed, is less noticeable, but still there. I'm still trying to find when are updated the values for controllers are. I would appreciate if you have a hint on where or how to fix it correctly. |
You can look at KX_Scene, and search for "wm_xr" occurences. I haven't an XR device, and idk how to deal with that. You can try to move what is in KX_Scene... I won't be abled to review, but you can ask BluePrintRandom on discord to test what you did if you have a change proposal. |
Thanks, I've made that and moved the callback section after the xr part in KH_Scene, but as mentioned, it seems it read the transformations, then the callback move the navigation_location, and if I read the controller location, it didn't updates, and reads the location before the navigation location change. If I find something I'll go to the discord channel and ask BluePrintRandom as you suggested. Thanks again. |
Copying location from xr.controller_grip_location_get is not working as expected inside a pre_draw callback. There's always a noticeable 1 frame delay on moving objects. I've tried getting the location using bge and bpy, but the problem is still there.
The blend file contains a basic scene with a moving cube, and a sphere.
The navigation location works as expected and gets the position copied from the cube correctly, but the sphere should have the position copied from the left controller grip but the position gets delayed
Is there a way to correct this modifying only the python code inside the blend, or is this a bug?
CopyLocXR.zip
The text was updated successfully, but these errors were encountered: