Page MenuHome

VR Add-on: Default Actions, Controller Gizmos
ClosedPublic

Authored by Peter Kim (muxed-reality) on May 16 2021, 8:49 AM.

Details

Summary

This updates the VR Scene Inspection add-on with functionality for
loading and using default controller actions, including controller
poses and haptics.

Users can choose whether to use default actions during a session via
a toggle in the "VR Session" panel. In addition, for controller
bindings that require OpenXR extensions (Reverb G2, Cosmos, Huawei),
there is an "Action Maps" panel to enable/disable these bindings.
Bindings that require extensions are disabled by default since not
all OpenXR runtimes may support them, which will lead to an error
during action creation.

In addition, this adds a "Viewport Feedback" option to draw VR
controllers as viewport gizmos. The gizmos consist of axes for the
controller aim components, as well as a spherical outline for the
grip components.

Diff Detail

Repository
rBA Blender Add-ons
Branch
vr-default-actions-controller-gizmos
Build Status
Buildable 16330
Build 16330: arc lint + arc unit

Event Timeline

Peter Kim (muxed-reality) requested review of this revision.May 16 2021, 8:49 AM
Peter Kim (muxed-reality) created this revision.
Peter Kim (muxed-reality) changed the visibility from "Public (No Login Required)" to "All Users".
Peter Kim (muxed-reality) retitled this revision from VR: XR Action Creation and Controller Gizmo Visualization to VR Add-on: XR Action Creation and Controller Gizmo Visualization.May 16 2021, 8:57 AM
Peter Kim (muxed-reality) changed the visibility from "All Users" to "Public (No Login Required)".May 18 2021, 11:05 AM

I don't quite see the point in the action-map editing UI this adds. I thought all this would be handled via Python scripts now (like the default.py)? The way the UI looks, we wouldn't accept it for core features as it's not really following existing UI conventions well enough. For add-ons we usually allow more freedom, but I'd still prefer to do a better job at it. It also looks quite technical & scary too :) I rather avoid showing such complexity to regular users.

Besides this I don't think we need to do a lot of review. So I'm not gonna spend much time digging into details.

I would split up the main.py file some more. Could be something like this:

  • __init__.py
  • gui.py
  • operators.py
  • action_map.py
  • action_map_io.py
  • properties.py (for all the landmark properties and callbacks)
  • versioning.py
  • defaults.py
  • configs/default.py

Remove action map editing, split up main file

Also update based on discussion, master commits
(rBe844e9e8f3bb, rBd3d4be1db3a0, rBfb1822ddeb28).

Peter Kim (muxed-reality) retitled this revision from VR Add-on: XR Action Creation and Controller Gizmo Visualization to VR Add-on: Default Actions, Controller Gizmos.Aug 10 2021, 11:50 AM
Peter Kim (muxed-reality) edited the summary of this revision. (Show Details)

Add toggle for gamepad input

Again, just a rough review, but I think that's fine. Left two simple suggestions.
We don't have to expect issues with committing this before D10949: XR Controller Support Step 7: Controller Based Picking and D10950: XR Controller Support Step 8: Controller Based Transform, right? (Like accessing undefined properties.)

viewport_vr_preview/__init__.py
51–55

I'd just add a register() and unregister() function to the module, so you can just do gui.register() here. You can follow the new Pose Library add-on here, e.g. check pose_library/__init__.py and pose_library/gui.py

88–130

Any reason for keeping these here? I though they would go to properties.py.

This revision is now accepted and ready to land.Aug 27 2021, 12:25 PM

Move class/property registration to appropriate files

Also replace "undo/redo" default actions with "toggle shading"
(solid, material preview).

Remove unused classes list from __init__.py

Forgot to remove this in previous update.

Peter Kim (muxed-reality) marked 2 inline comments as done.Sep 1 2021, 11:03 AM

Again, just a rough review, but I think that's fine. Left two simple suggestions.
We don't have to expect issues with committing this before D10949: XR Controller Support Step 7: Controller Based Picking and D10950: XR Controller Support Step 8: Controller Based Transform, right? (Like accessing undefined properties.)

Yes, there won't be any issues since the only default actions at the moment are toggle solid/material preview (view3d.toggle_shading) as well as the actions for controller poses and haptics.
That being said, I think it's best to commit this after D11501: XR Controller Support Step 5: Navigation so we can add the default navigation actions.

viewport_vr_preview/__init__.py
51–55

Moved class/property registration to the different modules.

Peter Kim (muxed-reality) marked an inline comment as done.Sep 1 2021, 11:16 AM

Update based on master (committed D10944, D10948)

Also add navigation operators from D11501.

Add base scale property to landmarks

Similar to base pose location and angle, landmarks can have a reference
scale that the viewer can start the session at or return to during the
session.

This can only be edited in the UI for landmarks of type OBJECT and
CUSTOM (so not SCENE_CAMERA).