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?