Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#2377 closed enhancement (fixed)

Add command to assign VR buttons

Reported by: lucien.krapp@… Owned by: Tom Goddard
Priority: normal Milestone:
Component: VR Version:
Keywords: Cc: Elaine Meng
Blocked By: Blocking:
Notify when closed: Platform: all
Project: ChimeraX

Description

The following bug report has been submitted:
Platform:        Darwin-18.7.0-x86_64-i386-64bit
ChimeraX Version: 0.91 (2019-08-15)
Description
Add command to assign vr hand controller buttons.  Requested by Lucien Fabrice.

Log:
UCSF ChimeraX version: 0.91 (2019-08-15)  
© 2016-2019 Regents of the University of California. All rights reserved.  
How to cite UCSF ChimeraX  

> help help:contact.html




OpenGL version: 4.1 ATI-2.11.20
OpenGL renderer: AMD Radeon Pro 580 OpenGL Engine
OpenGL vendor: ATI Technologies Inc.

Change History (3)

comment:1 by Tom Goddard, 6 years ago

Component: UnassignedVR
Owner: set to Tom Goddard
Platform: all
Project: ChimeraX
Reporter: changed from goddard@… to lucien.krapp@…
Status: newassigned
Type: defectenhancement

From: Krapp Lucien Fabrice <>
Subject: [chimerax-users] Open days EPFL - ChimeraX VR
Date: September 5, 2019 at 1:35:16 AM PDT
To: "chimerax-users@…" <chimerax-users@…>

Hello,

We are creating some small VR demos in ChimeraX for the EPFL open days in a few weeks (https://www.epfl.ch/campus/events/celebration-en/portes-ouvertes/). It is an event to show to a broader audience what the university is doing.

The demos consists of small proteins up to density maps of bacteriophage with a few simple animations and menus to interact with the structures. Everything is almost done, I'm currently trying to fix the last issue but I didn't find a solution in the documentation. For two of the demos we would like the user to move a selection in VR with one of the VR controller right out of the box without having to go in the VR menu and click on the "move selected" button. I was able to make it work on Linux by loading the session though the remote API with the right part selected but it doesn't seem to work on Windows. The log shows a status change when clicking on the button "move selected" in VR but not the actual command to change the mode.

Do you know if there is a way to change the mode of the VR controller without having to manually go through the menu in VR ?

In the mean time, I will try different saved sessions and (remote) commands to try and solve the issue. If the demos are a success we will most likely make them available online so that anybody can try and improve them.

Thank you in advance for your help.

best,
Lucien

comment:2 by Tom Goddard, 6 years ago

Cc: Elaine Meng added
Resolution: fixed
Status: assignedclosed

I added the command "vr button" to assign VR hand controller buttons that will be in tonight's ChimeraX builds, for example,

vr button grip "rotate selected models" hand right

The general syntax is

vr button <button-name> <mouse-mode-name> [hand left|right]

The button-name can be trigger, grip, touchpad, menu, A, B, X, Y. Mouse mode names are as used with the mousemode command and are given by "usage mousemode" (select, select add, select subtract, select toggle, rotate, translate, zoom, rotate and select, translate selected models, rotate selected models, clip, clip rotate, identify object, pivot, none, map eraser, tug, minimize, bond rotation, swapaa, distance, zone, pick blobs, mark maximum, mark plane, mark surface, mark center, mark point, link markers, move markers, resize markers, delete markers, contour level, move planes, crop volume, windowing, label, move label, play map series).

Mouse mode names containing spaces need to be quoted.

If hand is not specified then the button is assigned on both hand controllers.

VR hand modes cannot be assigned until VR is started with "vr on". Trying to use "vr button" before starting VR will give an error message.

Currently clicking on a toolbar icon with hand controllers does not log this command. I don't have time right now to make that logging work.

Here's the Python declaration for this command

def vr_button(session, button, mode, hand = None):


Assign VR hand controller buttons

Parameters
----------
button : 'trigger', 'grip', 'touchpad', 'menu', 'A', 'B', 'X', 'Y'

Name of button to assign. Buttons A/B are for Oculus controllers and imply hand = 'right',
and X/Y imply hand = 'left'

mode : HandMode instance

VR hand mode to assign to button.

hand : 'left', 'right', None

Which hand controller to assign. If None then assign button on both hand controllers.
If button is A, B, X, or Y then hand is ignored since A/B implies right and X/Y implies left.


comment:3 by Tom Goddard, 6 years ago

Summary: ChimeraX bug report submissionAdd command to assign VR buttons
Note: See TracTickets for help on using tickets.