Adding Instructions and Rating GUI for SightLab VR

December 20, 2022

Sado Rabaudi

Please don’t forget to also watch our Tech Tip video giving you a full live demonstration on this topic.

Prompting participants with instructions once they put on their headset and presenting them with a selection/rating menu after key events is easy to do with SightLab VR. These are the steps you would use to make this happen. 

Default for desktop is left mouse button to confirm and continue, arrow keys to select, left mouse button to confirm.

Headset: trackpad left and right or thumbstick left and right to select and trigger to confirm.

To add instructions: 

Open the file by either using File-Open in Vizard or right clicking and choosing edit (if you’ve made Vizard the default python editor). 

Change INSTRUCTIONS_FLAG to “True” and add text that you want after INSTRUCTION_TEXT.

Now if you run your SightLab script the instructions will appear when the experiment starts. If a user is wearing a VR headset the instructions will appear in front of their vision on a black screen wherever they look. For desktop they will appear on the mirrored window. 

To clear the instructions and proceed, click the right trigger button on your controller or the left mouse button if using desktop mode. 

To add a rating: 

Open the file again and change the text for the rating question(s). If you want to add a second question set the flag RATING_QUESTION2 = True  (To see how to add more questions, see below).

Next, go into the “example_scripts” folder and copy over either (if using 3D models) or (if using 360 videos) to the root folder of SightLab, or you can copy and paste the code from either of these into your existing Sightlab script. 

This is basically importing the rating module and using yield rating.showRating() whenever you want this to appear in your experiment. 

Run either example to now have the rating available. This example code starts the rating GUI after 5 seconds when the experiment starts (once you press SPACEBAR). You can change this to be a different time by modifying the value or you can use different yield statements to trigger the rating GUI to show up. 

There are many options available to trigger an event. Here are just a few examples: 

  • Standard viztask commands, such as when a media file stops playing, an animation finishes or a button is pressed. 
  • Using proximity sensors with vizproximity.waitEnter (if you have a proximity sensor already setup, for more on proximity sensors see here
  • Using a grab event to be triggered when an object is grabbed. 
  • Creating a custom event, which can be when an object is focused on
  • And much more

Anytime you want the rating to show up just add the code: yield rating.showRating() inside your sightLabExperiment function (or any viztask function). 

To have the rating only show up once, just delete the second set of yield statements from the example. 

When you run the experiment now the rating will show up after the specified amount of time. Use the right hand trigger to proceed and the left and right trackpad or thumbstick to choose the answers. For the desktop use the left mouse button and arrow keys. 

After the rating is chosen you can run another trial or continue with the experiment session. 

The chosen values will also be saved in the tracking_data.txt file.

Note: you can add more questions by copying and pasting these two lines of code as many times as you want in the utils-rating or utils- rating360 module on line 97:

yield viztask.waitEvent('triggerPress')

statusText.message(‘your message here’)

By modifying these modules you can also adjust the amount of choices on line 9 after bestFeeling = 

To use 360 videos, just use the example file choice_Gui_360

After this is run you can view your analytics and data as usual. 

Stay Updated
Subscribe to our monthly Newsletter
Phone +1 (888) 841-3416
Fax +1 (866) 226-7529
813 Reddick St
Santa Barbara, CA 93103