WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 09-16-2010, 09:23 AM
migoloco migoloco is offline
Member
 
Join Date: Sep 2010
Posts: 5
Iterate through node3d children

Is there any way to obtain the list of childs from a node3d object?

I have been trying to use list = <node3d>.getChildren() to obtain such a list, as I need to attribute a value to each i in list.

On your documentation it clearly says that: "NOTE: This command does NOT return a list of the underlying scene graph nodes and does NOT create new Vizard node3d objects. It will only return existing node3d objects" ... but it never mentions how to actually do these things.

ideas?
Reply With Quote
  #2  
Old 09-16-2010, 05:37 PM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
The command <node3D>.getChildren() will return the list of children for an object that you have defined in the Vizard script. It will not return the list of sub-objects for that object as defined in the modeling software.

If you want to get a list with all sub-objects you could first get all the sub-object names and then use <node3D>getChild() to get the handles to the sub-objects passing in their names. This prints out all sub-object names:
Code:
model = viz.add('gallery.ive')

for name in model.getNodeNames():
	print name
Reply With Quote
  #3  
Old 09-22-2010, 04:43 PM
Renato Lima Renato Lima is offline
Member
 
Join Date: Sep 2010
Posts: 54
Thank you, this solved my problem. And this is my new code:

for name in world.getNodeNames():
abc = world.getChild(str(name))
abc.appearance(viz.DECAL)
Reply With Quote
Reply

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
node3d: vertices, faces jdoerr Vizard 3 09-02-2010 08:32 AM
How to move a text object and its children text objects as a whole knightgba Vizard 2 08-24-2010 11:21 AM
passing node3d to c++ jdoerr Plug-in development 1 04-23-2009 04:16 PM
how to enable node and all children michaelrepucci Vizard 2 08-01-2008 12:47 PM
Inheritence with node3d dan12345 Vizard 1 05-23-2008 07:14 PM


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


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