# Expression
Understanding expressions requires some programming skills. NodeVideo uses MiniScript (opens new window) as the built-in programming language, You can refer to its Quick Reference (opens new window) or User's Manual (opens new window) to learn.
Of course, it doesn’t matter if you don’t know how to program. Please refer to the Expression Examples and copy codes for your needs.
# Global Variables
Name | Explanation | Type |
---|---|---|
time | The current time of this layer | Number |
name | The name of this parameter | String |
value | The current value of this paramater | Number, [,], [,,] |
frameDuration | One frame time, equivalent to 1/FPS | Number |
speed | The speed of change of the current parameter | Number |
velocity | The velocity of change of the current parameter | Number, [,], [,,] |
numKeys | The number of keyframes the current parameter contains | Number |
numLayers | The number of layers the current group contains | Number |
index | The index of this layer under the parent group | Number |
View Variables
All the above variables can be viewed through the expression: "print variable".
# Global Objects
# thisLayer
Name | Explanation | Type |
---|---|---|
name | The name of this layer | String |
index | The index of this layer | Number |
startTime | The current time of this layer | Number |
is3D | Is this layer in 3D mode | Number |
position | Position | 2D[,], 3D[,,] |
scale | Scale | 2D[,], 3D[,,] |
pivot | Pivot | 2D[,], 3D[,,] |
rotation | Rotation | 2D[Number], 3D[,,] |
opacity | Opacity | Number |
parent | Parent group | Same as thisLayer |
# Built-in Functions
Name | Explanation | Parameters |
---|---|---|
wiggle | Wiggle effect Same as Wiggle Editor | -frequency -amplitude -octaves(default 1) -amp_mult(default 0.5) -time(default is current time) |
smooth | Sample the current parameter and take the average | -width(default 0.1) -samples(default 5) -time(default is current time) |
posterizeTime | Set the update frequency of the expression | -updatesPerSecond |
key | Get keyframes | -index |
nearestKey | Get the keyframe closest to the current time | -time(default is current time) |
seedRandom | Set random number seed | -seed -timeless(default is false) |
random | Get a random number | -min -max |
noise | Get a smooth noise | -number |
loopIn | Cycle forward from the first keyframe | -type --“cycle” --“pingpong” --“continue” -numKeyframes |
loopOut | Cycle backward from the last keyframe | -type --“cycle” --“pingpong” --“continue” -numKeyframes |
loopInDuration | Same as LoopIn, but can set loop duration | -type(same as LoopIn) -duration |
loopOutDuration | Same as LoopOut, but can set loop duration | -type(same as LoopOut) -duration |
timeToTimecode | Convert time to timecode [00:00:00:00] | -time(default is current time) -timecodeBase(default 30) -isDuration(default false) |
timeToFrames | Convert time to frames | -time(default is current time) -fps(default project fps) -isDuration(default false) |
framesToTime | Convert frames to time | -frames -fps(default project fps) |
velocityAtTime | The velocity of change of the current parameter | -time(default is current time) |
speedAtTime | The speed of change of the current parameter | -time(default is current time) |
valueAtTime | The value of the current parameter | -time(default is current time) |
linear | Linear interpolation | -t[0-1] -value1 -value2 |
ease | Smooth interpolation, tangent at both ends is 0 | -t[0-1] -value1 -value2 |
easeIn | Smooth interpolation, tangent at start is 0 | -t[0-1] -value1 -value2 |
easeOut | Smooth interpolation, tangent at end is 0 | -t[0-1] -value1 -value2 |
rgbToHsl | Convert RGB to HSL | -rgbaArray |
hslToRgb | Convert HSL to RGB | -hslaArray |
toFixed | Returns the value as a string, specifying the number of decimal places | -number -places(default 2)) |
layer | Returns specify layer | -index -isRelative(default true) |
# Math Functions
- | - | - |
---|---|---|
abs(x) | acos(x) | asin(x) |
atan(y,x) | ceil(x) | cos(r) |
sin(r) | floor(x) | log(x,b) |
round(x,d) | pi | sign(x) |
sqrt(x) | tan(r) | exp(f) |
pow(f,p) | clamp(v,min,max) | length(v) |
normalize(v) |