Skip to content

Expression

Understanding expressions requires some programming skills. NodeVideo uses MiniScript as the built-in programming language, You can refer to its Quick Reference or User's Manual 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

NameExplanationType
timeThe current time of this layerNumber
nameThe name of this parameterString
valueThe current value of this paramaterNumber, [,], [,,]
frameDurationOne frame time, equivalent to 1/FPSNumber
speedThe speed of change of the current parameterNumber
velocityThe velocity of change of the current parameterNumber, [,], [,,]
numKeysThe number of keyframes the current parameter containsNumber
numLayersThe number of layers the current group containsNumber
indexThe index of this layer under the parent groupNumber

View Variables

All the above variables can be viewed through the expression: "print variable".

Global Objects

thisLayer

NameExplanationType
nameThe name of this layerString
indexThe index of this layerNumber
startTimeThe current time of this layerNumber
is3DIs this layer in 3D modeNumber
positionPosition2D[,], 3D[,,]
scaleScale2D[,], 3D[,,]
pivotPivot2D[,], 3D[,,]
rotationRotation2D[Number], 3D[,,]
opacityOpacityNumber
parentParent groupSame as thisLayer

Built-in Functions

NameExplanationParameters
wiggleWiggle effect
Same as Wiggle Editor
-frequency
-amplitude
-octaves(default 1)
-amp_mult(default 0.5)
-time(default is current time)
smoothSample the current parameter
and take the average
-width(default 0.1)
-samples(default 5)
-time(default is current time)
posterizeTimeSet the update frequency of the expression-updatesPerSecond
keyGet keyframes-index
nearestKeyGet the keyframe closest to the current time-time(default is current time)
seedRandomSet random number seed-seed
-timeless(default is false)
randomGet a random number-min
-max
noiseGet a smooth noise-number
loopInCycle forward from the first keyframe-type
--“cycle”
--“pingpong”
--“continue”
-numKeyframes
loopOutCycle backward from the last keyframe-type
--“cycle”
--“pingpong”
--“continue”
-numKeyframes
loopInDurationSame as LoopIn, but can set loop duration-type(same as LoopIn)
-duration
loopOutDurationSame as LoopOut, but can set loop duration-type(same as LoopOut)
-duration
timeToTimecodeConvert time to timecode
[00:00:00:00]
-time(default is current time)
-timecodeBase(default 30)
-isDuration(default false)
timeToFramesConvert time to frames-time(default is current time)
-fps(default project fps)
-isDuration(default false)
framesToTimeConvert frames to time-frames
-fps(default project fps)
velocityAtTimeThe velocity of change of the current parameter-time(default is current time)
speedAtTimeThe speed of change of the current parameter-time(default is current time)
valueAtTimeThe value of the current parameter-time(default is current time)
linearLinear interpolation-t[0-1]
-value1
-value2
easeSmooth interpolation, tangent at both ends is 0-t[0-1]
-value1
-value2
easeInSmooth interpolation, tangent at start is 0-t[0-1]
-value1
-value2
easeOutSmooth interpolation, tangent at end is 0-t[0-1]
-value1
-value2
rgbToHslConvert RGB to HSL-rgbaArray
hslToRgbConvert HSL to RGB-hslaArray
toFixedReturns the value as a string, specifying the number of decimal places-number
-places(default 2))
layerReturns 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)pisign(x)
sqrt(x)tan(r)exp(f)
pow(f,p)clamp(v,min,max)length(v)
normalize(v)

Email: contact@nodevideo.com