WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #7  
Old 12-29-2012, 08:47 AM
asdf asdf is offline
Member
 
Join Date: Sep 2012
Posts: 6
Hi,
what is the best way to get the same state after importing a scene?

I made an example similar to "Tutorial: Hierarchical Models".
In the first run the level is exported, after that the EXPORT should be changed to False. The print output differs although I import the same level I just exported.

Additionally I'm not sure how to get a child Node.
I want to access one of the Nodes that are mentioned in the "print scene.getNodeNames()" in the line that is commented out, but don't know how.

Code:
import viz

viz.clearcolor(viz.SKYBLUE)
viz.MainView.setPosition([0,1.8,-10])

EXPORT = True

if(EXPORT):
	scene = viz.addGroup()

	viz.addChild('ground_grass.osgb', parent = scene)
	carousel = viz.addChild('carousel.wrl', parent = scene)
	pole1 = viz.addChild('pole.wrl',parent=carousel)
	pole1.setPosition([2.5,0,0])
	horse1 = viz.addChild('horse.wrl',parent=pole1)

	print scene.getNodeNames()
	print scene.getChildren()
	#print scene.getChild('???')

	scene.save('example.osgb')
else:
	scene = viz.add('example.osgb')

	print scene.getNodeNames()
	print scene.getChildren()

viz.go()
Reply With Quote
 


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
Vizard 4 Beta Testing farshizzo Announcements 0 02-01-2011 10:46 AM
Vizard 4 Beta Testing farshizzo Vizard 0 02-01-2011 10:46 AM
Vizard tech tip: Using the Python Imaging Library (PIL) Jeff Vizard 0 03-23-2009 11:13 AM
problem with exporting avatars and using them in Vizard VDong Vizard 2 02-23-2009 01:25 AM
Exporting from Maya to Vizard jfreeman Vizard 2 06-30-2005 02:14 PM


All times are GMT -7. The time now is 10:38 PM.


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