Importing Sightlab into Your Existing Code

See also Code Attributes and Methods


Short summary of steps:

import sightlab_utils.sightlab as slfrom sightlab_utils.settings import *
#Set GUI to false to not see the GUI setup optionssightlab = sl.SightLab(gui = False)
env = vizfx.addChild('resources/environments/dojo2.osgb')sightlab.setEnvironment(env)
viztask.schedule(sightlab.runExperiment)

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