Skip to content

addWithValues()

Step a function through a list of values, evenly spaced over time.

Automate.addWithValues(action, values)

Calls the function once for each value in turn, handing it the current value. Good for sweeping a setting smoothly through a series of numbers.

Parameters

Automate.addWithValues(action, values, duration=None, repeat=1, whenDone=None)
Parameter Type Default Description
action function required The function to call; it receives one parameter, the current value.
values list required The values to step through, in order.
duration int or float None How long the whole list takes, in seconds. If omitted, one value is delivered per frame.
repeat int 1 How many times to run through the list; use -1 to repeat forever.
whenDone function None A function to call once, after the last run through the list; it receives no parameters.