Formulas
This article describes the examples of formulas you can use in Animation mode to set up custom behaviors.
Functions
Syntax  Description  Use Examples 
 Random integer in the range from 0 to YOUR_MAX_VALUE 

 Random integer in the range from YOUR_MIN_VALUE to YOUR_MAX_VALUE 

 Local Xcoordinate of the first object that comes across in the scene with the name YOUR OBJECT NAME 

 Global Xcoordinate of the first object that comes across in the scene with the name YOUR OBJECT NAME 

 Local Ycoordinate of the first object that comes across in the scene with the name YOUR OBJECT NAME 

 Global Ycoordinate of the first object that comes across in the scene with the name YOUR OBJECT NAME 

 Local Zcoordinate of the first object that comes across in the scene with the name YOUR OBJECT NAME 

 Global Zcoordinate of the first object that comes across in the scene with the name YOUR OBJECT NAME 

 Local Xangle in degrees of the first object on the scene named YOUR OBJECT NAME 

 Global Xangle in degrees of the first object on the scene named YOUR OBJECT NAME 

 Local Yangle in degrees of the first object on the scene named YOUR OBJECT NAME 

 Global Yangle in degrees of the first object on the scene named YOUR OBJECT NAME 

 Local Zangle in degrees of the first object on the scene named YOUR OBJECT NAME 

 Global Zangle in degrees of the first object on the scene named YOUR OBJECT NAME 

 Returns the Xsize of a physical body in meters. The global AABB (axis aligned bounding box) is used 

 Returns the Ysize of a physical body in meters. The global AABB (axis aligned bounding box) is used 

 Returns the Zsize of a physical body in meters. The global AABB (axis aligned bounding box) is used 

 Returns width of viewport in pixels 

 Returns height of viewport in pixels 

System Variables
Name  Description  Use Examples 
 The value assigned to the previous keyframe. In the first keyframe, it is equal to the value from the scene. 

 The number in the order of the keyframe in the clip to which this keyframe belongs. The countdown starts from 0. 

 The number of keyframes in the animation track that this keyframe belongs to. 

 Pi number 

Object Variables
Syntax  Description  Use Examples 
 User's custom variable 

 Variables created within a certain animation timeline that are applied to it only. 

Operations and Functions
Arithmetic and Assignment Operators
Operator  Definition  Use Examples 
 Addition between x and y. 

 Subtraction between x and y. 

 Multiplication between x and y. 

 Division between x and y. 

 Modulus of x with respect to y. 

 x to the power of y. 

 Assign the value of x to y. Where y is either a variable or vector type. 

 Increment x by the value of the expression on the righthand side. Where x is either a variable or vector type. 

 Decrement x by the value of the expression on the righthand side. Where x is either a variable or vector type. 

 Assign the multiplication of x by the value of the expression on the righthand side to x. Where x is either a variable or vector type. 

 Assign the division of x by the value of the expression on the righthand side to x. Where x is either a variable or vector type. 

 Assign x modulo the value of the expression on the right   hand side to x. Where x is either a variable or vector type. 

Equalities and Inequalities
Operator  Definition  Use Examples 
 True only if x is strictly equal to y. 

 True only if x does not equal y. 

 True only if x is less than y. 

 True only if x is less than or equal to y. 

 True only if x is greater than y. 

 True only if x greater than or equal to y. 

Boolean Operations
Operator  Definition  Use Examples 
 True state or any value other than zero (typically 1).  
 False state, value of exactly zero.  
 Logical AND, True only if x and y are both true. 

 Multiinput logical AND, True only if all inputs are true. Left to right shortcircuiting of expressions. 

 Multiinput logical OR, True if at least one of the inputs are true. Left to right shortcircuiting of expressions. 

 Logical NAND, True only if either x or y is false. 

 Logical NOR, True only if the result of x or y is false. 

 Logical NOT, Negate the logical sense of the input. 

 Logical OR, True if either x or y is true. 

 Logical XOR, True only if the logical states of x and y differ. 

 Logical XNOR, True iff the biconditional of x and y is satisfied. 

 Similar to AND but with left to right expression short circuiting optimization. 

 Similar to OR but with left to right expression short circuiting optimization. 

General Purpose Functions
Function  Definition  Use Examples 
 Absolute value of x. 

 Average of all the inputs. 

 Smallest integer that is greater than or equal to x.  
 Clamp x in range between r0 and r1, where r0 < r1. 

 Equality test between x and y using normalized epsilon.  
 Error function of x. 

 Complimentary error function of x. 

 e to the power of x. 

 e to the power of x minus 1, where x is very small. 

 Largest integer that is less than or equal to x. 

 Fractional portion of x. 

 Hypotenuse of x and y. 

 Inverseclamp x outside of the range r0 and r1. Where r0 < r1. If x is within the range it will snap to the closest bound. 

 Inrange returns 'true' when x is within the range r0 and r1. Where r0 < r1. 

 Natural logarithm of x. 

 Base 10 logarithm of x. 

 Natural logarithm of 1 + x, where x is very small. 

 Base 2 logarithm of x. 

 Base N logarithm of x. where n is a positive integer. 

 Largest value of all the inputs. 

 Smallest value of all the inputs. 

 Product of all the inputs. 

 Normal cumulative distribution function. 

 Notequal test between x and y using normalized epsilon.  
 x to the power of y. 

 NthRoot of x. where n is a positive integer. 

 Round x to the nearest integer. 

 Round x to n decimal places where n > 0 and is an integer. 

 Sign of x, 1 where x < 0, +1 where x > 0, else zero. 

 Square root of x, where x >= 0. 

 Sum of all the inputs. 

 Swap the values of the variables x and y and return the current value of y. 

 Integer portion of x. 

Trigonometry Functions
Function  Definition  Use Examples 
 Arc cosine of x expressed in radians. Interval [1,+1] 

 Inverse hyperbolic cosine of x expressed in radians. 

 Arc sine of x expressed in radians. Interval [1,+1] 

 Inverse hyperbolic sine of x expressed in radians. 

 Arc tangent of x expressed in radians. Interval [1,+1] 

 Arc tangent of (x / y) expressed in radians. [pi,+pi] 

 Inverse hyperbolic tangent of x expressed in radians. 

 Cosine of x. 

 Hyperbolic cosine of x. 

 Cotangent of x. 

 Cosecant of x. 

 Secant of x. 

 Sine of x. 

 Sine cardinal of x. 

 Hyperbolic sine of x. 

 Tangent of x. 

 Hyperbolic tangent of x. 

 Convert x from degrees to radians. 

 Convert x from degrees to gradians. 

 Convert x from radians to degrees. 

 Convert x from gradians to degrees. 

String Processing
Function  Definition  Use Examples 
 All common equality/inequality operators are applicable to strings and are applied in a case sensitive manner. In the following example x, y and z are of type string. 

 True only if x is a substring of y. 

 True only if the string x matches the pattern y. Available wildcard characters are '*' and '?' denoting zero or more and zero or one matches respectively. 

 True only if the string x matches the pattern y in a case insensitive manner. Available wildcard characters are '*' and '?' denoting zero or more and zero or one matches respectively. 

 The closed interval Note: Both r0 and r1 are assumed to be integers, where r0 <= r1. They may also be the result of an expression, in the event they have fractional components truncation will be performed. (eg: 1.67 > 1) 

 Assign the value of x to y. Where y is a mutable string or string range and x is either a string or a string range. Note: For options 7 and 8 the shorter of the two ranges will denote the number of characters that are to be copied. 

 Concatenation of x and y. Where x and y are strings or string ranges. 

 Append to x the value of y. Where x is a mutable string and y is either a string or a string range. 

 Swap the values of x and y. Where x and y are mutable strings. 

 The string size operator returns the size of the string being actioned. 

Control Structures
Structure  Definition  Use Examples 
 If x is true then return y else return z. 

 The ifelse/elseif statement. Subject to the condition branch the statement will return either the value of the consequent or the alternative branch. 

 The first true case condition that is encountered will determine the result of the switch. If none of the case conditions hold true, the default action is assumed as the final return value. This is sometimes also known as a multiway branch mechanism. 

 The structure will repeatedly evaluate the internal statement(s) 'while' the condition is true. The final statement in the final iteration will be used as the return value of the loop. 

 The structure will repeatedly evaluate the internal until statement(s) 'until' the condition is true. The final statement in the final iteration will be used as the return value of the loop. 

 The structure will repeatedly evaluate the internal statement(s) while the condition is true. On each loop iteration, an 'incrementing' expression is evaluated. The conditional is mandatory whereas the initializer and incrementing expressions are optional. 

 Break terminates the execution of the nearest enclosed loop, allowing for the execution to continue on external to the loop. The default break statement will set the return value of the loop to NaN, where as the return based form will set the value to that of the break expression. 

 Continue results in the remaining portion of the nearest enclosing loop body to be skipped. 

 Return immediately from within the current expression. With the option of passing back a variable number of values (scalar, vector or string). 

 Ternary conditional statement, similar to that of the above denoted ifstatement. 

 Evaluate each subexpression, then return as the result the value of the last subexpression. This is sometimes known as multiple sequence point evaluation. 

 Evaluate any consequent for which its case statement is true. The return value will be either zero or the result of the last consequent to have been evaluated. 

 The vector size operator returns the size of the vector being actioned. 

Last updated