<vizact>.onpick

Perform an action when an object is picked.

 

<vizact>.onpick(
    node    
    func    
    *args    

)

 

node

The node3d object to handle


func

The function to call when the node3d object is picked with the left mouse button


*args

The arguments to pass to the function.


Remarks

This will call the specified function with the specified arguments whenever the specified object is picked. Picking an object involves left clicking on it.

Return Value

The pick event.

Example

PickAction = vizact.sequence(vizact.sizeTo([2,2,2],speed=16),vizact.sizeTo([1,1,1],speed=8))
for x in range(5):
    ball = viz.add('ball.wrl',pos=[x-2,1.8,7])
    vizact.onpick(ball,ball.runAction,PickAction)
viz.clearcolor(viz.GRAY)
viz.mouse(viz.OFF)