View Single Post
  #1  
Old 12-03-2008, 10:40 AM
michaelrepucci michaelrepucci is offline
Member
 
Join Date: Jul 2008
Posts: 53
trouble changing subnode (child node) color, alpha, etc.

I'm having trouble setting various properties (e.g., color, alpha, ambient) for on-the-fly objects when they are the children (or subnodes) of other objects. For example

Code:
square = makeOTFSquare()
square.color(viz.RED)
works just fine, but

Code:
square = makeOTFSquare()
square2 = makeOTFSquare()
square2.setPosition(someOffset)
square2.parent(square)
square.color(viz.RED)
only changes the color of square, not square2. I tried changing the OpMode of the square node, either when setting the color, or globally via square.setOpMode, but none of the OpMode options changes this behavior.

Is there any easy way to do this, or will I have to loop over all the child (and grand-child, great-grand-child, etc.) nodes, changing each one individually?
Reply With Quote