View Single Post
  #2  
Old 06-24-2013, 02:17 PM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
You could add the environment models to different scenes when the script loads and swap scenes in the droplist callback function:
Code:
import viz
import vizact
viz.go()

gallery = viz.addChild('gallery.osgb', scene=1)
dojo = viz.addChild('dojo.osgb',scene=2)

dropList = viz.addDropList(parent=viz.ORTHO,scale=[0.75]*3)
dropList.addItems(['Gallery','Dojo'])
viz.link(viz.MainWindow.RightTop, dropList, offset=[-150,-50,0])

def changeScene(e):
	if e.object.getItem(e.newSel) == 'Gallery':
		viz.scene(1)
	if e.object.getItem(e.newSel) == 'Dojo':
		viz.scene(2)

vizact.onlist(dropList,changeScene)
Reply With Quote