Page MenuHome

VR: "Basic VR Viewer" Add-on to expose VR features in the UI
ClosedPublic

Authored by Julian Eisel (Severin) on Mar 11 2020, 1:40 AM.

Details

Summary

This add-on adds a basic UI for managing VR to the sidebar, in a new "VR" tab.

To be committed after D7098. Requires either D7098 and it's parent patches, or the vr_scene_inspection branch to be checked out.

Features:

  • Buttons to control general VR session settings (e.g. toggle session, positional tracking)
  • Viewport drawing options:
    • Clipping values and overlay toggles
    • Full 3D View shading options
  • Landmarks - VR reference/base pose management:
    • Each landmark can use either the scene camera, a custom camera or entirely custom values.
    • Differentiates between active and selected landmarks. That way landmark settings can be changed without changing the current reference pose.
    • Stored per scene
  • Virtual camera gizmo (non-interactive) to show the current VR viewer position and rotation in regular 3D Views
  • Per 3D View feedback options:
    • Virtual camera gizmo
    • VR mirror (3D View follows VR view position and rotation)

Diff Detail

Repository
rBA Blender Add-ons
Branch
soc-2019-openxr
Build Status
Buildable 7083
Build 7083: arc lint + arc unit

Event Timeline

viewport_vr_preview.py
39

We may want to rename this to "VR Scene Inspection", don't mind really.

42

Needs updating.

Floor / Annotations / Clip and Positional Tracking seem quite different settings. I would put Positional Tracking right under Start VR Session, and move the others to another panel.

Is "Custom" landmark really needed, why not always uses camera objects? Setting up a location and angle without any visual indication seems hard, I'm not sure when you would use this. It could be copied from a camera, but then next users will want landmarks visualization and editing, and then to it seems simpler to just always use cameras.

For shading settings, it seems like you have to set them up blindly and then hope it looks good once you jump into VR, or switch back and forth to get the settings right? I'd expect them to be copied from the 3D viewport by default.

For the Viewport Feedback panel, name the options "Show VR Camera" and "Mirror VR Session"?

Floor / Annotations / Clip and Positional Tracking seem quite different settings. I would put Positional Tracking right under Start VR Session, and move the others to another panel.

An issue I saw with having the positional tracking toggle right under the session toggle was that it would make it easier to accidentally stop the session. But with a separator in-between it might be fine.

Is "Custom" landmark really needed, why not always uses camera objects? Setting up a location and angle without any visual indication seems hard, I'm not sure when you would use this. It could be copied from a camera, but then next users will want landmarks visualization and editing, and then to it seems simpler to just always use cameras.

I can imagine that they are useful in some cases. We were thinking about a "Set From Current Pose" button, but I'll leave these small things to others to implement. Commented out the code for custom landmarks for now.

For shading settings, it seems like you have to set them up blindly and then hope it looks good once you jump into VR, or switch back and forth to get the settings right? I'd expect them to be copied from the 3D viewport by default.

The VR view uses its own shading settings currently, they can also be changed during a running session. The use case of milestone one is that the VR experience is controlled by a different person than the one with the headset on, so this should be fine.
We do however plan to have an option to share shading options, we'd probably enable it by default. Added to the TODO list, T71347.

For the Viewport Feedback panel, name the options "Show VR Camera" and "Mirror VR Session"?

Done.

Julian Eisel (Severin) edited the summary of this revision. (Show Details)Mar 12 2020, 3:25 PM
  • Update VR add-on for naming changes in Python API
  • Some adjustments to panel layouts, + PEP8 cleanup
  • Disable code for custom landmark poses for now
  • Change UI name of addon, update versions

The VR view uses its own shading settings currently, they can also be changed during a running session. The use case of milestone one is that the VR experience is controlled by a different person than the one with the headset on, so this should be fine.

For that use case, I would expect the person controlling VR to set up the shading beforehand for the most part? And even if you do it with another person, it's still rather blind, it's just that the other person can tell you if it looks good?

I think the concept of there being shading settings specific to VR is problematic. There are different uses cases for artists working on a scene and someone demoing a scene to another person. We have per-viewport shading settings, and per-scene shading settings for those. I just don't see why it should matter if the demo is being done in VR or not.

If you want to set up a demo for someone, why not just change the scene render engine to Eevee or Workbench and set viewport to Rendered?

To me it seems like this would simplify the implementation and make it easier to set up.

Noting some basic Python stuff.

viewport_vr_preview.py
58

More Pythonic to say if not landmarks: (happens to be more efficient for RNA in some cases too).

486

Can be a staticmethod.

  • Update to use new 3D View Shading layout utilities
  • Add render-pass option to VR view shading settings
  • Cleanup: Line length
  • Hide toggle for world space lighting for now + update to naming changes
  • Update to RNA naming changes
  • Cleanup: Little Python style tweaks from review

All comments should be addressed by now and no bigger concerns were raised about the code. It's unclear from the last comment if Campbell did an in-depth review or just a brief check, and if he planed to have another look. This add-on is part of a 2.83 goal for which we go into BCon2 tomorrow. I'll have to use common sense and assume this is fine to commit. I think usually we aren't that strict about what we allow in the Add-ons repositories.

is it in the roadmap to expose the inputs in a generic way to python?

like 

import XRTools
headTransform = XRTools['Head'].matrix

This revision was not accepted when it landed; it landed in state Needs Review.Mar 17 2020, 9:44 PM
This revision was automatically updated to reflect the committed changes.