WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Thread Tools Rate Thread Display Modes
Old 10-11-2011, 12:20 PM
Enlil Enlil is offline
Join Date: May 2008
Posts: 61
<node3d>.getChildren() subtleties

I am trying to poll an object loaded from an ive file for it's children. The object always returns an empty list from getChildren(). However, if I use getChild('DVD') (one of the children), it returns a viznode. So I am wondering if there is some subtlety I am missing, possibly something to do with getChild searching deeper than immediate children?

So, the code looks something like:
obj = viz.add('ObjectsTest.ive')
print obj.getChildren()
(returns [])
print obj.getChild('DVD')
(returns viz.VizNode(35))
Reply With Quote
Old 10-11-2011, 04:27 PM
Jeff Jeff is offline
WorldViz Team Member
Join Date: Aug 2008
Posts: 2,465
The node3D.getChildren command will return a list of the immediate Vizard node3d objects that are below that node. It will not return a list of the underlying scene graph nodes.

When you use the node3D.getChild command a new node3d object is created.

You can use the <node3d>.getNodeNames command to retrieve a list of names of the scene graph nodes underneath the Vizard node:
model = viz.addChild('gallery.ive')

print 'Model contains the following scene graph nodes:'
for name in model.getNodeNames():
	print ' ',name
Reply With Quote
Old 10-11-2011, 05:26 PM
Enlil Enlil is offline
Join Date: May 2008
Posts: 61
Thanks, that was just what I was looking for!

Reply With Quote

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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

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

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