def enable(): viz.MainWindow.setScene(SCENE) reset() global ambientAudio ambientAudio.volume(0.1) ambientAudio.loop(viz.ON) ambientAudio.play() viz.MainView.getHeadLight().disable() AvatarStories.enable() # Keypresses toggleBusLightsOnKeyPress.setEnabled(True) vizact.onkeydown("r", reset)
def load(sceneRef=viz.MainScene): global SCENE SCENE = sceneRef # TODO: Add scene params to all viz.add calls, etc in this module and submodules SCENE = viz.MainScene # TODO: Add scene params to all viz.add calls, etc in this module and submodules # add bus BUS_OBJ_SCALE = 0.0365 BUS_OSGB_SCALE = 35 curscale = BUS_OSGB_SCALE bus = vizfx.addChild("bus_obj/Bus_Final_Scene2.osgb", scene=SCENE) bus.setScale([curscale] * 3) # bus.emissive(1,1,1) # Makes it look like daytime # add bus ambient noise global ambientAudio ambientAudio = viz.addAudio("Audio/Bus Scene/BusAmbientNoise.wav") # add homeless avatars global avatars avatars = avatarconfigStories.initAvatars(SCENE) # nodes to be removed at the end of the bus scene global toRemove toRemove = getRemoveNodes(bus) # make exit sign a node for selection to allow for ending the scene. exit = bus.getChild("Plane007") exit.name = "exit" exit.done = False avatars.append(exit) # init Avatar Stories and narration AvatarStories.init(avatars, toRemove, ambientAudio, SCENE) # BusLighting.addLighting(SCENE) BusLighting.addStreetlights(SCENE) global toggleBusLightsOnKeyPress toggleBusLightsOnKeyPress = vizact.onkeydown("z", BusLighting.toggleBusLighting)
def disable(): AvatarStories.disable() toggleBusLightsOnKeyPress.setEnabled(False) ambientAudio.stop()