WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 06-20-2013, 03:19 PM
Daniel Daniel is offline
Member
 
Join Date: Jun 2013
Posts: 7
Droplist for different scenes

Hello

It is possible to create a droplist to visualize different scenes, like in the i-SpaceDemo.exe.

This mean that when i select Scene1 in the droplist the Scene1.osgb loads, and when I select Scene2 in the droplist the Scene2.osgb loads.

I am a little bit lost with this problem
Reply With Quote
  #2  
Old 06-24-2013, 03: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
  #3  
Old 06-26-2013, 03:41 PM
Daniel Daniel is offline
Member
 
Join Date: Jun 2013
Posts: 7
It works great but is there a limit in the number of scenes/droplist? Because only let me put around 6 or 7 scenes. The other 3 or 4 (I want to put 10 scenes) appear in the droplist but don't change the scene when i select it the droplist
Reply With Quote
  #4  
Old 06-27-2013, 10:54 AM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
You can use up to six scenes at one time. If you need more environments you can remove what's in one of those scenes and load a new environment there.
Reply With Quote
  #5  
Old 07-10-2013, 11:05 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
There is no limit to the number of scenes you can use. For historical reasons, Vizard creates six scenes at startup. However, you can create more scenes using the viz.addScene() command.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding Objects to all Scenes jassel41 Vizard 1 11-29-2010 03:35 AM
displaying random scenes etc cl113 Vizard 1 05-10-2009 06:14 PM
Arranging Scenes in Correct Order utepbereed Vizard 1 11-21-2008 10:19 AM
environment maps, scenes, and you! vadrian Vizard 1 01-12-2005 05:04 PM
switching between scenes david Vizard 4 07-01-2003 07:05 PM


All times are GMT -7. The time now is 08:24 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC