ParticleExpression

With ParticleExpression, you can adjust your particles by setting expressions on their attributes. Using expressions gives you a vast variety of ways of adjusting the way your particles behave. You can use a similar expression syntax as you would elsewhere in Nuke, with the exception that some functions which work in normal Nuke expressions aren't available in particle expressions and vice versa. The main difference between Nuke’s Expression node and ParticleExpression is that particle expressions can return a 3D vector instead of just a single floating point number. If a particle expression returns a single number N in a field that expects a vector (such as velocity or acceleration) it will be converted into a vector with N for each of its components. For more information about functions you can use with ParticleExpression, see Adjusting Particles Using Expressions.

Inputs and Controls

Connection Type

Connection Name

Function

Input

particles

The particle system to which you intend to apply expressions.

Control (UI)

Knob (Scripting)

Default Value

Function

ParticleExpression Tab

[temp name field]

temp_name0

N/A

If you need to use a long expression in several fields, you can use this row for assigning the expression temporarily to a variable. Enter the variable name here, and the expression on the right of the = sign. You can then use the variable to represent the expression in the = fields next to the other particle controls.

=

temp_expr0

N/A

If you need to use a long expression in several fields, you can use this row for assigning the expression temporarily to a variable. Enter the variable name on the left side of the = sign, and the expression in this field. You can then use the variable to represent the expression in the = fields next to the other particle controls.

per-particle

temp_expr0_pp

enabled

When enabled, this temporary expression is evaluated per-particle.

[temp name field]

temp_name1

N/A

If you need to use a long expression in several fields, you can use this row for assigning the expression temporarily to a variable. Enter the variable name here, and the expression on the right of the = sign. You can then use the variable to represent the expression in the = fields next to the other particle controls.

=

temp_expr1

N/A

If you need to use a long expression in several fields, you can use this row for assigning the expression temporarily to a variable. Enter the variable name on the left side of the = sign, and the expression in this field. You can then use the variable to represent the expression in the = fields next to the other particle controls.

per-particle

temp_expr1_pp

enabled

When enabled, this temporary expression is evaluated per-particle.

[temp name field]

temp_name2

N/A

If you need to use a long expression in several fields, you can use this row for assigning the expression temporarily to a variable. Enter the variable name here, and the expression on the right of the = sign. You can then use the variable to represent the expression in the = fields next to the other particle controls.

=

temp_expr2

N/A

If you need to use a long expression in several fields, you can use this row for assigning the expression temporarily to a variable. Enter the variable name on the left side of the = sign, and the expression in this field. You can then use the variable to represent the expression in the = fields next to the other particle controls.

per-particle

temp_expr2_pp

enabled

When enabled, this temporary expression is evaluated per-particle.

[temp name field]

temp_name3

N/A

If you need to use a long expression in several fields, you can use this row for assigning the expression temporarily to a variable. Enter the variable name here, and the expression on the right of the = sign. You can then use the variable to represent the expression in the = fields next to the other particle controls.

=

temp_expr3

N/A

If you need to use a long expression in several fields, you can use this row for assigning the expression temporarily to a variable. Enter the variable name on the left side of the = sign, and the expression in this field. You can then use the variable to represent the expression in the = fields next to the other particle controls.

per-particle

temp_expr3_pp

enabled

When enabled, this temporary expression is evaluated per-particle.

color

colexpr

N/A

Sets expressions controlling particle color.

only on new

colexpr_onlynew

disabled

When disabled, the expression affects all particles. When enabled, the expression only affects new particles.

opacity

opacity_expr

N/A

Sets expressions controlling particle opacity.

only on new

opacityexpr_onlynew

disabled

When disabled, the expression affects all particles. When enabled, the expression only affects new particles.

size

sizeexpr

N/A

Sets expressions controlling particle size.

only on new

sizeexpr_onlynew

disabled

When disabled, the expression affects all particles. When enabled, the expression only affects new particles.

mass

massexpr

N/A

Sets expressions controlling particle mass.

only on new

massexpr_onlynew

disabled

When disabled, the expression affects all particles. When enabled, the expression only affects new particles.

accel

accelexpr

N/A

Sets expressions controlling particle acceleration.

only on new

accelexpr_onlynew

disabled

When disabled, the expression affects all particles. When enabled, the expression only affects new particles.

force

forceexpr

N/A

Sets expressions controlling particle force.

only on new

forceexpr_onlynew

disabled

When disabled, the expression affects all particles. When enabled, the expression only affects new particles.

pos

posexpr

N/A

Sets expressions controlling particle position.

only on new

_onlynewposexpr

disabled

When disabled, the expression affects all particles. When enabled, the expression only affects new particles.

vel

velexpr

N/A

Sets expressions controlling particle velocity.

only on new

velexpr_onlynew

disabled

When disabled, the expression affects all particles. When enabled, the expression only affects new particles.

frame

frameexpr

N/A

Sets expressions controlling the frame used for particle geometry or texture.

only on new

frameexpr_onlynew

disabled

When disabled, the expression affects all particles. When enabled, the expression only affects new particles.

chans

channelsexpr

N/A

Sets expressions controlling whether or not the channels specified in the set to control are applied to the particles.

only on new

channelsexpr_onlynew

disabled

When disabled, the expression affects all particles. When enabled, the expression only affects new particles.

set to

new_channels

b

Sets the new channels to assign to particles matching the chans expression.

Note:  Particles are deleted if none is selected.

Conditions Tab

probability

probability

1

Sets the probability that this node affects your particles. If you set this to zero, the node won’t affect any particles, and if the value is 1, the node will affect every particle.

min age

min_age

0

Limits the effect of this node to particles above this minimum age. The age of the particle is its lifetime normalized between 0 and 1.

max age

max_age

1

Limits the effect of this node to particles below this maximum age. The age of the particle is its lifetime normalized between 0 and 1.

random seed

seed

0

Sets the integer to change the results of generated randomness in your particles. You can achieve slightly different effects by changing this number.

channels

channels

all

Specifies which particle channels the effect of this node should be applied to. Channels a and b are arbitrary names for channels which are useful if you want different ParticleEmitter nodes or other particle force nodes to have an effect on separate channels.

Region Tab

region

region

none

Sets the region which you want to use to confine the particle effect to. For example, if you choose a sphere, only particles inside that sphere shaped region will be affected by particle effects.

none - all particles are affected as normal.

sphere, box, half-space, and cylinder - controls the region’s boundary shape.

invert region

region_invert

disabled

When enabled, particles outside the region are affected rather than those inside it.

file_menu

N/A

Select to import or export a channel file:

Import chan file - import a channel file and transform the region marker according to the transformation data in the channel file. Channel files contain a set of Cartesian coordinates for every frame of animation in a given shot. You can create and export them using Nuke or 3D tracking software, such as 3D-Equalizer, Maya, or Boujou.

Export chan file - export the translation parameters that you’ve applied to the region marker as a channel file. This is a useful method of sharing setups between artists.

snap_menu

N/A

Match selection position - the region marker is snapped to a new position depending on the points selected.

Match selection position, orientation - the region marker is snapped to a new position and orientation depending on the points selected.

Match selection position, orientation, size - the region marker is snapped to a new position, orientation, and size depending on the points selected.

transform order

xform_order

SRT

Sets the operation order for scale (S), rotation (R), and translation (T). The possible operation combinations are SRT, STR, RST, RTS, TSR, TRS.

rotation order

rot_order

ZXY

Sets the order of rotation. The possible axial combinations are ZXY, XYZ, XZY, YXZ, YZX, ZXY, ZYX.

translate

translate

0, 0, 0

Lets you translate the region marker along the x, y, and z axes. You can also adjust translate values by clicking and dragging the axis in the 3D Viewer.

rotate

rotate

0, 0, 0

Lets you rotate the region marker around the x, y, and z axes. You can adjust rotate values by holding down Ctrl/Cmd and dragging in the 3D Viewer.

scale

scaling

1, 1, 1

Lets you scale the region marker on the x, y, and z axes.

uniform scale

uniform_scale

1

Lets you scale the region marker simultaneously on the x, y, and z axes.

skew

skew

0, 0, 0

Lets you skew the region marker on the x, y, and z axes.

pivot

pivot

0, 0, 0

When you make changes to the region marker’s position, scaling, skewing, and rotation, these occur from the location of the object’s origin point or pivot. The pivot x, y, and z controls allow you to offset the pivot point and move it anywhere you like - you can even move it outside of the object. Subsequent transformations applied will then occur relative to the new pivot point location.

You can also hold down Ctrl/Cmd+Alt and drag the pivot point to a new location in the 3D Viewer.

Local Matrix

specify matrix

useMatrix

N/A

Enable this control to specify matrix values for the object you’re transforming as an alternative to setting transform, scale, skew and pivot values above.

matrix

matrix

N/A

The matrix displays values from the object’s transform, rotate, scale, skew, and pivot controls.

Check specify matrix and copy or drag-and-drop matrix values from another object to apply those values, for example, if you wanted to align objects in a scene.

Step-by-Step Guides

Adjusting Particles Using Expressions

Video Tutorials

Example Nuke Scripts

Note:  Loading example scripts only works if you launched the help from Nuke and have set documentation source to local in the Behaviors > Documentation tab of the Preferences.

See Using Script Links for more information.

Using the world position value as the color for each particle

Adjusting the color, opacity, size, and position of particles using expressions

Adjusting the color and opacity of particles using expressions