Example without GUI

This is an example for running SightLab without the GUI. For additional atributes and methods see this page

import viz

import vizfx

from utils import sightlab

#Code to disable the GUI from showing (set to 1 if you want the GUI)

sightlab.is_GUI = 0

#Example showing how to set environment. Note that environment should be defined before objects of interest

env = vizfx.addChild("utils/resources/environment/dojo.osgb")


#set number of trials

sightlab.sceneConfigDict["trials"] = 1

#add objects of interest

basketball = env.getChild('basketball')

soccerball = env.getChild('soccerball')

sightlab.gazeObjectsDict = {'basketball':basketball,'soccerball':soccerball}

#Grab objects

sightlab.grabObjectsDict = {'basketball':basketball,'soccerball':soccerball}

#run sightlab experiment

import viztask


Note: Make sure to schedule the experiment function after you’ve initialized all the other objects in the scene