Importing Sightlab into Your Existing Code
See also Code Attributes and Methods
Short summary of steps:
import the sightlab module and create an instance of SightLab
#Set GUI to false to not see the GUI setup optionssightlab = sl.SightLab(gui = False)
Let sightlab know what the environment model is (or provide a handle to it)
Schedule sightlab
To use the Replay you will need to manually copy over the SightLabVR_Replay.py file from the Projects- SampleProject folder
Example
import sightlab_utils.sightlab as slfrom sightlab_utils.settings import *#Setup SightLab Optionssightlab = sl.SightLab(gui = False)
#Setup Environmentenv = vizfx.addChild('resources/environment/dojo2.osgb')sightlab.setEnvironment(env)
#set number of trialssightlab.setTrialCount(3)
#add objects of interestbasketball = env.getChild('basketball')sightlab.addSceneObject('basketball',basketball,gaze = True, grab = True)
viztask.schedule(sightlab.runExperiment)
Note: Make sure to schedule the experiment function after you’ve initialized all the other objects in the scene
If needing to use your own vizconnect file or files use this code when creating the SightLab instance. Define the name for the vizconnect and then give the path. For multiple custom vizconnects, will need to create a dictionary first and give that dictionary after vizconnectconfig = )
sightlab = sl.SightLab(vizconnectconfig = ['Desktop','vizconnect_config_desktop_3d.py'])
If you wish to use a custom vizconnect file, you will need to integrate the eye_tracker tracker into the “trackers” section and the “postinit” section.
Questions, contact support@worldviz.com