WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 08-01-2008, 07:02 AM
michaelrepucci michaelrepucci is offline
Member
 
Join Date: Jul 2008
Posts: 53
how to enable node and all children

I've created a number of on-the-fly objects (e.g., parent=viz.endlayer() and child=viz.endlayer() each with their own custom vertices), some of which I then link to each other with the command:

child.parent(parent)

I would then like to enable lighting for an object and all its children. I thought the command:

parent.enable(viz.LIGHTING)

would do this, but it didn't seem to work. So I tried:

parent.enable(viz.LIGHTING,'',viz.OP_TRAVERSE)
or
parent.enable(viz.LIGHTING,'',viz.OP_OVERRIDE)

but those also didn't work. I guess I misunderstand how to do this. Could someone please help?
Reply With Quote
  #2  
Old 08-01-2008, 11:06 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
The following should work:
Code:
parent.enable(viz.LIGHTING,op=viz.OP_ROOT|viz.OP_TRAVERSE)
This will perform the operation to include all children Vizard nodes. You can also place all the objects underneath a group node, which will automatically perform all operations on its childeren, without needing to specify the op mode.
Reply With Quote
  #3  
Old 08-01-2008, 11:47 AM
michaelrepucci michaelrepucci is offline
Member
 
Join Date: Jul 2008
Posts: 53
Thanks! That works wonders, and the default behavior you described when objects are collected under a group node explains a subtlety I didn't previously understand: that enable(viz.LIGHTING) was changing all children in some of my objects (i.e., those in a group), but not for others (i.e., those not in a group).

I thought I'd read the documentation pretty thoroughly but I didn't see anything covering group nodes - I learned about them through another forum post. I would have liked to see this documentation in the "Reference"->"3D models" section. Can I suggest that this be added, or if I overlooked the discussion on group nodes, can you point me towards it? Thanks again and in advance!
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


All times are GMT -7. The time now is 02:30 PM.


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