Jump To Locations

Setting Up Jump-to-Locations in SightLab

Table of Contents

Introduction

The jump-to-locations feature in SightLab allows users to quickly teleport to predefined locations in a virtual environment. This guide will walk you through the setup and use of this feature. Note that built into SightLab are also the moving transport and arc teleport. See the controls page for the buttons used by default for those methods. 

Installation

Note: You don't need to copy both .py files, as they serve different purposes. Choose the one that best fits your needs.

Basic Setup

If integrating to your own script, add the following code:

# Import the jump_to_locations module

from sightlab_utils import jump_to_locations 


# Add a tablet device

tablet = vizfx.addChild('VR_Menu_Locations.osgb')

sightlab.addSceneObject('tablet', tablet, grab=True)


# After sightlab.startTrial() or yield viztask.waitEvent(TRIAL_START), add:

locations_dir = os.path.join(os.path.dirname(__file__), 'locations')

jtl = jump_to_locations.JumpToLocations(tablet_item=tablet, locations_dir=locations_dir, config=sightlab.getConfig())

jtl.setup_transport_node()

jtl.tablet.visible(viz.ON)

vizact.onkeydown('/', jtl.save_position)

Saving Locations

Note: In Desktop mode, use 'Q' and 'E' keys to rotate and save orientation, as mouse movement doesn't store rotation.

Configuring the Menu

For each button image (e.g., "button1_image"): a. Select the button. 

b. Double-click the texture on the right to open the texture selector. c. Click the folder icon to browse for your screenshots. 

d. Navigate to your project's "recordings" folder and select the corresponding screenshot.

Repeat for each button, then save the object.

Using Jump-to-Locations

Session Replay

After a session you can view the Session Replay and data files to see which areas a user was interested in.  See the Multi-User sections on how to run in Multi-User. 

Advanced Configuration

jtl = jump_to_locations.JumpToLocations(tablet_item=tablet, locations_dir=locations_dir, config=sightlab.getConfig(), number_of_buttons=5)

For adding new buttons you will need to scale and move the Main-VR_Menu object in Inspector (using the scale and move tools) to make room, then use Shift and the move tools to make copies of the original button images and button(number)_target objects (the targets are what is used for the sensor). Making sure to place them in the same hierarchy in the tree as the others. 

For more information on arc teleports see this page

For more information on transports in vizconnect see this page

Additionally, there is a "Jump To" functionality in vizconnect, see this page for more information on that. 

Note that the "reset" feature in SightLab may cause issues with the locations being misaligned