silhouette-2024.5 : Expressions : Operators, Variables and Samples
Operators, Variables and Samples
Arithmetic Operators
Keyword
Description
*
Multiply
/
Divide
+
Add
-
Subtract
See Python Mathematical Functions for a complete list of supported arithmetic operators.
Variables
Variable
Description
self
The current object
time
The current time in seconds
frame
The current frame
parent
The parent object (same as self.parent)
node
The current node
session.width, session_height
The session width and height
random()
Returns a random number in the range 0–1
gaussRandom(min=0, max=1, seed=<current_frame>)
Returns a random number. The results have a Gaussian (bell-shaped) distribution.
wiggle(frequency, amplitude, octaves=1, amp_mult=0.5, lacunarity=1.0, time=<current_time>)
Wiggles an object across random values
Noise Functions
Function
Description
noise(t)
Generates 1D simplex noise, the building block of Perlin noise
noise2D(point)
Generates 2D simplex noise, the building block of Perlin noise
noise3D(point)
Generates 3D simplex noise, the building block of Perlin noise
Point 3D Functions
Functions
Description
Point3D.angle(point)
Returns angle in degrees between self and point
Point3D.cross(point)
Returns the cross product with point as a Point3D
Point3D.dot(point)
Returns the dot product with point as a float
Point3D.lerp(p, t)
Returns the interpolated position along (self, p) at t
Point3D.normalize()
Returns the normalized Point3D
Point3D.perpendicular()
Returns a perpendicular vector to self
Point3D.rotate(angle, origin=(0,0,0))
Returns a new Point3D
Sample expressions
Expression
Description
saturation
Uses the value of the current object’s saturation property at the current time
self.property('saturation').getValue(frame+1)
Fetches the value of saturation at the next frame
Roto_1.alpha_invert
Fetches the value of the Alpha > Invert property for the node named Roto 1
Transform_1.scale.x
Uses the X value from the Transform 1 node Scale parameter