Set Value
Set one of the flow's values, or a particle's own position, velocity, speed, scale, colour, spin or shape, from a number, at random, from something else the particle has, or from the smoke and fire where it is.
Set one of the flow's values (listed under Values in the sidebar), or the particle's own position, velocity, speed, scale, colour, spin or shape, as particles enter the event (or every step, for all in it): to a number, a random one, a chance, something of the particle's, another value, the distance to an object, the time or the flow's gas where it is. Shaders read exported values as attributes.
- Add it
- EventAdd OperatorLooksSet Value
- Sends on
- Nothing: it has no wire.
- Influence
- Yes: it works only on particles whose value is above a half.
When to use it
Set Value gives each particle a number of its own, or changes one it has:
- Tag particles: set a Yes or No called
hitas they enter the event a Collide sends them to. - Count: Add 1 to a
bouncesvalue each time they're sent back. - Give each its own: a
strengthfrom Random, to weigh a force by. - Change the particle itself, every step: shrink it with age, slow it by how far it is from an object, give each a random colour.
Values are explained in full on Values: their types, how numbers turn into each kind, and how shaders read them.
Set it up
For a value of your own, open the flow editor sidebar's Values panel and press +. Name it and pick its Type. To set the particle's own position, speed or the like, skip this.
Add Add OperatorLooksSet Value to the event, and pick the Value it sets.
Pick From, and what it reads. Turn on Keep Doing It to set it every step, not only as particles arrive.
Settings
As the flow editor’s sidebar shows them. Changing any of them marks the bake old; those marked Keyframable can also change through a bake.
One of the flow's values (added under Values in the sidebar); Set Value can also set the particle's own position, velocity, speed, scale, color, spin or shape.
Where the value comes from.
- Number: The same for every particle.
- Random: Between two numbers (or vectors), different for each particle and the same each time it's set.
- Chance: Yes for some of the particles, at random.
- Particle: Something of the particle's own: its age, speed, position...
- Value: Another of its values.
- Distance: How far it is from an object, in metres.
- Time: Seconds into the bake.
- Gas: The flow's smoke and fire where the particle is: its heat, flame, smoke, speed or colour (as the last frame left it)
The vector to set.
Shown when The value it sets is a Vector, and From is Number.
The whole number to set.
Shown when The value it sets is a Whole Number, and From is Number.
Ticked sets it to yes, unticked to no.
Shown when The value it sets is a Yes or No, and From is Number.
The lowest number it can pick.
Shown when The value it sets is a Number, Whole Number or Yes or No, and From is Random.
The highest number it can pick.
Shown when The value it sets is a Number, Whole Number or Yes or No, and From is Random.
The lowest each part of the vector can be.
Shown when The value it sets is a Vector, and From is Random.
The highest each part of the vector can be.
Shown when The value it sets is a Vector, and From is Random.
Which of the particle's own values to read.
- Age: Seconds since it was born.
- Time in Event: Seconds since it entered this event.
- Speed: Metres a second.
- Position: Where it is.
- Velocity: Which way and how fast it moves.
- Scale: Its size factor.
- Colour: Its colour.
- Spin: How fast it turns: about an axis, its length in radians a second.
- Id: Its number, unique in the flow, counting births in order.
- Shape: Which of the Shapes collection's objects it shows.
Shown when From is Particle.
The value to read.
Shown when From is Value.
What the distance is measured to.
- Origin: The object's origin.
- Surface: The nearest point of the object's surface.
Shown when From is Distance.
What to read from the gas.
- Heat: How hot the gas is: 0 cold, about 1 to 3 in flames.
- Flame: How brightly it burns there: 0 for none.
- Smoke: How thick its smoke is.
- Fuel: Fuel not yet burnt.
- Speed: How fast the gas goes, in metres a second.
- Velocity: Which way and how fast the gas goes.
- Colour: The gas's own colour (Smoke Source's Colour), white where it has none.
Shown when From is Gas.
Which part of the vector to use.
- All: The whole vector.
- X
- Y
- Z
- Length: How long it is.
Shown when From is Particle, and it reads a vector of the particle's; or From is Value, and the value it reads is a Vector.
Turn numbers in one range into another, straight through and beyond: say speeds from 0 to 10 into 0 to 1.
Shown when It doesn't read a Yes or No.
How the new value joins what's there.
- Set: Replace what's there.
- Add: Add to what's there.
- Multiply: Multiply what's there.
- Lowest: Keep the lower of the two.
- Highest: Keep the higher of the two.
Shown when The value it sets is a Number, Vector or Whole Number.
One of the flow’s number values, to weigh it by, particle by particle. Empty for all of it, on all of them. See Influence.
What it sets
Value is one of the flow's values, or one of the particle's own:
| Value | Sets |
|---|---|
| position | Where it is, in metres |
| velocity | How fast and which way it goes, in metres a second |
| speed | How fast it goes, keeping its way. One standing still stays still |
| scale | Its size, as Scale sets it |
| color | Its colour, as red, green and blue |
| spin | How it turns: the axis, as long as its speed in radians a second |
| shape | Which shape it shows, to the nearest whole number |
From, Part, Remap, Clamp and Mode
These are worked through, step by step, on Values. In short, the number is read (From), one part taken from a vector (Part), turned from one range into another (Remap), kept between two (Clamp), then put with what's there (Mode).
Random gives each particle its own number, and the same one each time this Set Value sets it, so it doesn't flicker with Keep Doing It.
Gas reads the flow's smoke and fire where the particle is, as the last
frame's step left it: its Heat, Flame, Smoke, Fuel,
Speed, Velocity or Colour. Outside the gas they read nothing, and
Colour white. With Keep Doing It, sparks can glow while they're in the hot
gas and dim as they leave it: set a heat value from the gas's Heat, and
let the spark's material read it. The gas comes from a
Smoke Source somewhere in the flow,
and it's VecFlow's own: with NVIDIA Flow it reads nothing.
Works with
- Value Test sends particles on by a value Set Value gave them.
- Order: Set Value reads what the operators above it did that step. Put it below what it reads.
- Influence: weighed by a value, only particles whose value is above a half are set.
Problems you may see
event: operator needs a value to set
event: operator: 'value' is one number: pick a Part of the vector
event: operator: its Clamp Low is above its High
event: operator: Remap needs two different numbers to map From
event: operator: there is no value called 'value'. Add it under Values
Errors stop a bake; warnings don’t. Every message is on the Messages page.
Related
- Values: data each particle carries
- Using values, a guide with examples