Vizard 7 » Command Index » Vizard objects » node3d » <node3d>.drawOrder
7.7

<node3d>.drawOrder

Set the order in which the object will be drawn

<node3d>.drawOrder(  
order  
node = ''  
bin = viz.BIN_OPAQUE  
op = viz.OP_DEFAULT  
)  
order
The draw order. A higher number means the object will be drawn later.
node = ''
Name of sub-node to apply changes to
bin = viz.BIN_OPAQUE
The draw order bin controls the ordering of objects with the same draw order. Can be one of the following values:

Bin modes

viz.BIN_OPAQUE

Place the object into the default opaque bin. Objects in this bin will be sorted by material.

viz.BIN_TRANSPARENT

Place the object into the depth-sorted draw order bin. This ensures correct ordering for objects with transparency.

viz.BIN_BACK_TO_FRONT

Objects in this bin will be rendered from furthest to closest to the camera.

viz.BIN_FRONT_TO_BACK

Objects in this bin will be rendered from closest to furthest to the camera.

viz.BIN_TRAVERSAL_ORDER

Objects in this bin will be rendered in the order they appear in the scene graph.

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

Use this command to force an object to be drawn after another object. The higher the order the latest it will be drawn. This command is useful when you have transparent objects and you want to force one object to be drawn last.

Return Value

None

Example

object1 = viz.add('model.wrl')
object2 = viz.add('model2.wrl')

#Force object2 to be drawn after object1 is drawn
object1.drawOrder(0)
object2.drawOrder(1)

See also

<node3d>.setOpaqueDrawOrder
<node3d>.setTransparentDrawOrder