Vizard 8 » Command Index » Vizard objects » node3d » <node3d>.setCompositeAlpha
8.1

<node3d>.setCompositeAlpha

Set the composite alpha value

<node3d>.setCompositeAlpha(  
alpha  
node = ''  
op = viz.OP_DEFAULT  
)  
alpha
The alpha value between 0 and 1. 0 is transparent, 1 is opaque.
node = ''
Name of sub-node to apply changes to
op = viz.OP_DEFAULT
Can be viz.OP_DEFAULT to use the nodes default op mode or a combination of the following values:

Op modes

viz.OP_TRAVERSE

When performing an operation on a node, traverse the entire subgraph and process all subnodes as well. This is the default value.

viz.OP_OVERRIDE

When applying attributes, have them override attributes of subnodes.

viz.OP_ROOT

When performing an operation on the node, start at the root transform of the node, instead of the model. Processing the root will include all child Vizard nodes.

Remarks

Applying a composite alpha will render the node to a texture and composite the texture back onto the scene with the specified alpha value. This is useful when you want to fade a complex object with many sub-parts. It will retain the relative transparency of any sub-parts and prevent seeing occluded parts of the object through itself. The node is essentially treated as a single image layer, similar to a photo editing application.

Return Value

None

Example

model = viz.addChild('mini.osgx')
model.setCompositeAlpha(0.5)

See also

<node3d>.getCompositeAlpha
<vizact>.fadeCompositeTo
<node3d>.alpha