Skip to content

Basic setup vizard

Basic Scene Setup with Code

Start with creating a new folder

Create new Vizard script

Save into folder

Run with viz.go()

import viz
import vizfx

viz.go()

#Set environment
env = vizfx.addChild('piazza.osgb')

Set up with SightLab

import sightlab_utils.sightlab as sl
from sightlab_utils.settings import *

sightlab = sl.SightLab(gui = False, pid = False, fadequad = False)
sightlab.setStartText(' ')

env = vizfx.addChild('piazza.osgb')

viztask.schedule(sightlab.runExperiment)

Add this to run with the sightlab data collection and playback

import sightlab_utils.sightlab as sl
from sightlab_utils.settings import *

sightlab = sl.SightLab(gui = False, pid = True, fadequad = True) 
sightlab.setStartText('Press Spacebar to Start')

#Set environment
env = vizfx.addChild('piazza.osgb')
sightlab.setEnvironment(env)

#Schedule SightLab loop (note that yield is needed before start and end trial and events that trigger them)
def sightLabExperiment():
    yield viztask.waitEvent(EXPERIMENT_START)
    for trial in range(sightlab.getTrialCount()):
        yield viztask.waitKeyDown(' ')
        yield sightlab.startTrial()


        yield viztask.waitKeyDown(' ')
        yield sightlab.endTrial()

viztask.schedule(sightLabExperiment)    
viztask.schedule(sightlab.runExperiment)

Create a script and call it myScene_Replay.py and add this code to view a replay

from sightlab_utils import replay as Replay
from sightlab_utils.replay_settings import *

replay = Replay.SightLabReplay()
Was this page helpful?