Skip to content

Update environment_depth.rst with permissions info. Fix code typo.#424

Merged
m4gr3d merged 2 commits into
GodotVR:masterfrom
The-Cyber-Captain:patch-1
Jan 5, 2026
Merged

Update environment_depth.rst with permissions info. Fix code typo.#424
m4gr3d merged 2 commits into
GodotVR:masterfrom
The-Cyber-Captain:patch-1

Conversation

@The-Cyber-Captain
Copy link
Copy Markdown
Contributor

Picked up on a couple of typos discovered when I tried to actually follow the documented "Accessing the depth map on the CPU" example as a jumping off point for my project.

Clarified requirements for using Meta Environment Depth / OpenXRMetaEnvironmentDepthExtensionWrapper.start_environment_depth(); including necessary Android permissions.

With those in mind, veered away from the prior suggestion of triggering start_environment_depth() via the OpenXRInterface,session_began signal. As, surely, attempting to secure the permissions before the session has started will - at best - flood the logs with Condition "image_acquired" is true. Returning: true errors [<C++ Source> modules/openxr/openxr_api.cpp:175 @ acquire()]?

//sigh// The legacy of evolving Android permissions - with or without Godot! - is such a ballache! 😜

Picked up on a couple of typos discovered when following the Depth Map On CPU example.

Clarified Android permission requirements for OpenXRMetaEnvironmentDepthExtensionWrapper.start_environment_depth().
@m4gr3d m4gr3d requested review from devloglogan and dsnopek January 2, 2026 19:20
@m4gr3d m4gr3d added bug Something isn't working documentation Improvements or additions to documentation labels Jan 2, 2026
@m4gr3d m4gr3d added this to the 4.3.0 milestone Jan 2, 2026
Comment thread docs/manual/meta/environment_depth.rst Outdated
OpenXRMetaEnvironmentDepthExtensionWrapper.start_environment_depth()

This will only work if there is an active OpenXR session. You can connect to the ``OpenXRInterface.session_begun`` signal to run code right when the session starts.
This will only work if there is both an active OpenXR session, and relevant Android permissions have all been granted in advance of the call. Namely, explicitly, "dangerous" permission ``android.permission.CAMERA``, and runtime permission ``USE_SCENE``. The latter can be automatically requested via the extension settings, Project Settings > OpenXR > Extensions > Automatically Request Runtime Permissions, or explicitly in code like the camera one.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I know, the CAMERA permission isn't needed for the depth API to work. We aren't requesting it in the sample project, and it's always worked for me

I'll double check what happens when first granting USE_SCENE when I have a chance. Recommending folks to take a look at OS.request_permission() and MainLoop.on_request_permissions_result could certainly make sense!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeahhhh.... you can imagine my surprise at the

ERROR: Failed to create environment depth provider: XR_ERROR_NOT_PERMITTED_PASSTHROUGH_FB
(137) DEBUG: timer timed out

logs when trying to incorporate the Manual page example into my own test. I thought I was pretty thorough in eliminating the 'variables' before putting the PR in, but can now confirm CAMERA is not required.
Exhibit A & B:

ring_low_res.mp4

no_camera

I guess I did a boob somewhere with my Permissions boiler-plate; the ongoing saga of The-Captain vs OS.android perms and the Quest. 😉 (godotengine/godot#105364)

Let me see if I / we can come up with a suitable update to this page again when I'm finished with my project for the day. Thanks - as always - Snopek. [Open to suggestions!!! 😁 ]

Copy link
Copy Markdown
Contributor Author

@The-Cyber-Captain The-Cyber-Captain Jan 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahhhhhh. I think I know where my misconception came from; my permissions boilerplate, indeed. When I tweaked it so as not to ask for Camera - purely for diagnosis prior to this PR - an unexpected side-effect was that start_environment_depth() was called during the same frame the XR session fires up. If not deferred, or on a later frame... like naturally when user-intervention takes place... then this causes the app to bail out - which I mistook for lack of permissions.

All that aside... still don't know what to change the document to. 🤣
I think I'll just fix the typos and leave any talk of permission and service startup to the professionals.... BRB.

Just the typos. Opted not to amend or squash so the conversation can stay tracked for greater changes in future (new issue?)
Copy link
Copy Markdown
Collaborator

@m4gr3d m4gr3d left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you squash the commits together.

@The-Cyber-Captain
Copy link
Copy Markdown
Contributor Author

Last time I looked, not from the web UI; I was only updating some docs here. Though I also thought the official repo could be / had been set as squash-on-merge?

But no dramas. As soon as I'm at a dev-capable device online I'll pull a copy local and squash. Thanks.

@m4gr3d
Copy link
Copy Markdown
Collaborator

m4gr3d commented Jan 5, 2026

We can do squash-on-merge, just let us know which commit comment you'd like to go with.

@The-Cyber-Captain
Copy link
Copy Markdown
Contributor Author

a923303 looks clean enough for what it is don't you think? Please-thanks.

@m4gr3d m4gr3d merged commit 6b8b2e6 into GodotVR:master Jan 5, 2026
17 checks passed
@The-Cyber-Captain The-Cyber-Captain deleted the patch-1 branch January 8, 2026 22:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants