2017

Table Of Contents
NOTE Errors in the functions file will be reported when it is first read. This file is read every time that an unknown
function is used in an expression.
Comments
You can include comments in the functions file by starting the line with a number sign ( # ). The comments
extend through the end of the line on which they appear and are ignored by Smoke when the user-defined
functions file is interpreted. Comments are useful for describing the purpose of a function and adding any
notes you feel are pertinent. They can be introduced anywhere in the file, except for inside of function
definitions that span several lines.
Sample Function Definitions
The following sample functions are found in the functions file that is installed with Smoke.
This function creates a sine curve for a given channel that oscillates between 0 and 100. The sin100
function takes one argument, named $arg1, that it uses in conjunction with the predefined sin function.
The return value for sin100 is the sine of $arg1 times 50, plus 50.
sin100($arg1) : sin($arg1)*50 + 50;
This function creates a sine curve based on the specified frequency and amplitude. The sinfreqamp
function takes three arguments, named $pos, $freq and $amp.
sinfreqamp($pos,$freq,$amp) : sin($pos*$freq)*$amp;
This function provides an approximation of the speed, or more precisely, the derivative (rate of change),
of a given channel. The speed function takes one argument, named $channelName.
speed($channelName) :eval($channelName,frame+0.1) -
eval($channelName,frame-0.1))/0.2;
NOTE For information on the other example functions in the functions file, see Slip Functions (page 1253) and
Rounding Functions (page 1261).
Sample Expression Setups
A few Action setups with sample expressions are provided in the directory
/usr/discreet/presets/<product_name>/examples/action.
To load an Action setup from ConnectFX, select the Action node in the schematic, then click Node Prefs
and Load Node.
Animated Text
To see this example, load the example setup named expressions_text into Action. This example involves
multiple text objects that move along a path, with each letter following slightly behind the last.
Advanced Animation: About Expressions | 1271