Vizard 7 » Command Index » Vizard objects » animationpath » <animationpath>.addEventAtControlPoint
7.6

<animationpath>.addEventAtControlPoint

Trigger event when control point is reached

<animationpath>.addEventAtControlPoint(  
name  
index  
)  
name
Name of the event. This can be any string which will be assigned to the name attribute of the viz.PATH_EVENT event object.
index
0-based index of the control point. Negative index can also be used to reference from end of list.

Remarks

This command will add an event to the path which will be triggered when the path reaches the specified control point index.

A viz.PATH_EVENT will be triggered with the specified event name and animation path.

Return Value

None

Example

# Create event at second control point
path.addEventAtControlPoint('second point', 1)

# Register callback when second point is reached
def onSecondPointReached():
    print('Second point reached')
vizact.onPathEvent(path, 'second point', onSecondPointReached)

See also

<animationpath>.addEventAtDistance
<animationpath>.addEventAtEnd
<animationpath>.addEventAtTime
<animationpath>.clearEvents
<animationpath>.removeEvent
<vizact>.onPathEvent
<viztask>.waitPathEvent
viz.PATH_EVENT