Vizard 7 » Reference » Flow control » Actions » Sequences
7.6

Sequences

The vizact library also contains a feature called action sequences. Action sequences allow you to group multiple actions together and repeat them multiple times. Grouping multiple actions together makes your code smaller and easier to read. For instance, in the previous section there was an example that faded an object in, waited 2 seconds, then faded it out. Instead of adding each action individually, we could have created an action sequence:

wait = vizact.waittime(2)
fadeIn = vizact.fadeTo(1,time=1)
fadeOut = vizact.fadeTo(0,time=1)
fadeInAndOut = vizact.sequence(fadeIn,wait,fadeOut)
object.add(fadeInAndOut)

Another feature of action sequences is the ability to repeat them a specified number of times. For instance, let's say we wanted the above fadeInAndOut action to repeat forever:

fadeInAndOut = vizact.sequence(fadeIn,wait,fadeOut,viz.FOREVER)

As you can tell, we added an extra parameter at the end which makes the sequence repeat forever. If you wanted the sequence to repeat 5 times, you would replace viz.FOREVER with 5.

See also

In this section:

Action Basics

Action synchronization and management

Dynamic parameters

Node commands as actions

Creating your own actions

Actions command table

Other sections:

Tutorial: Using actions

Task basics

Director basics

Timer basics

Animation path basics

Event Basics

Event Reference

Example scripts:

Actions

Event callbacks