Vizard 7 » Command Index » Vizard modules » vizact » <vizact>.call
7.6

<vizact>.call

Create an action that will call a function with the specified arguments

<vizact>.call(  
func  
*args  
**kw  
)  
func
The function to call
*args
Optional arguments to pass to the function
**kw
Optional keyword arguments to pass to the function

Remarks

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.

After you have created the action you can add it to any object as many times as you want.

Return Value

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

Example

Example 1:
#When the object is finished moving 'myfunc' will be called with arguments 5 and 6
def myfunc(p1,p2):
    print(p1,p2)

node.add(vizact.moveTo([0,0,10],speed=1))
node.add(vizact.call(myfunc,5,6))


Example 2:
import viz
import vizact
viz.go()

model = viz.add('logo.ive',pos=(0,1,4))

# Spin 90 degrees
spin = vizact.spinTo(euler=(90,0,0),time=1.0)

# Fade clear color to white
black_to_white = vizact.mix(viz.BLACK,viz.WHITE,time=2.0,interpolate=vizact.easeOutStrong)
color = vizact.call(viz.clearcolor,black_to_white)

# Add spin/fade actions as a sequence
action = vizact.sequence(spin,color)
model.runAction(action)

See also

<vizact>.mix
<vizact>.method.[name]
<viztask>.waitCall