Vizard 7 » Command Index » Vizard modules » vizact » <vizact>.method.[name]


Create an action to call an arbitrary method with specified arguments

Arguments to pass to the function
Keyword arguments to pass to the function


The vizact.method interface allows creating actions to call any method of an object as an action. Simply replace [name] with the name of the method to call along with the arguments to pass.

This action supports <vizact>.mix parameters. When mix parameters are used, the specified function will be called until the mix parameter completes. This is useful for animating arbitrary commands.

Return Value

An action that can be applied to any <node3d> object


Example 1:
# Toggle visibility every 0.5 seconds
ToggleVisible = vizact.sequence( [vizact.waittime(0.5), vizact.method.visible(viz.TOGGLE)], viz.FOREVER)

Example 2:
import viz
import vizact

# Add 3D text
text = viz.addText3D('WorldViz',pos=(0,1.5,6),color=viz.ORANGE)

# Add spinning action on pool 1
text.addAction( vizact.spin(0,1,0,20), pool=1 )

# Create actions to animate thickness
thick = vizact.method.setThickness( vizact.mix(0.1, 1.0, time=1.0) )
thin = vizact.method.setThickness( vizact.mix(1.0, 0.1, time=1.0) )

# Cycle thick/thin actions on pool 2
text.addAction( vizact.sequence( thick, thin, viz.FOREVER ), pool = 2 )

See also