#1
|
|||
|
|||
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? |
#2
|
|||
|
|||
The following should work:
Code:
parent.enable(viz.LIGHTING,op=viz.OP_ROOT|viz.OP_TRAVERSE) |
#3
|
|||
|
|||
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! |
|
|