Question Object

The Question object determines when to carry out one or more Actions which are present in the Question object's Actions list. It does not produce a visible presence in the editor or at render time.

You can only add a Question object to the scene by clicking the ‘Add Question’ button in the emitter’s Questions tab (which adds the Question to the scene and inserts it into the emitter’s Questions list). Once that is done, you can also drag the Question object into the questions list of any other emitter in the scene, if required.

Each question has at least one parameter and sometimes a list of conditions. These conditions would include tests such as whether the particle value is less than or greater than the value you specify. The particle is compared to the value you give, and if the conditions are satisfied the question is said to have ‘passed’ and any Action or Actions listed in the Question are carried out on the particle. If the conditions are not satisfied the question is said to have ‘failed’ and the Action is not carried out.

An emitter may have any number of Questions. Each Question object MUST be present in the emitter’s Questions list for it to be tested.

Important: a Question won’t do anything at all until you have:

  • inserted it into the Questions list of an emitter
  • added at least one Action object to the Actions list of the Question, or made use of the modifiers to activate or deactivate lists (see below)

You can use the same Question object in more than one emitter if you wish. Just drag the Question object into the Questions list of each emitter where you want to use that Question.

Question object interface

By default the Question object's interface looks like this:

Parameters

Question Type

There are a large number of possible questions in X-Particles 3, so that a single long list is not practicable. Therefore they have been divided into 6 groups, as follows:

Question Type Notes
Particle Data Tests various data items associated with a particle, such as speed, radius, etc.
Particle Position Tests any aspect of the particle's position in the scene.
Particle Flags The particle maintains a series of internal flags to indicate that some event has happened. Some of these flags can be tested with these questions.
Geometry Questions relating to geometry associated with a particle.
Physical Data The data relating to the FLIP solver can be tested with these questions.
Other Miscellaneous questions not fitting into another category

To select a question, first choose the category of question from the first drop-down menu. Then you can choose a specific question from the second drop-down menu. This menu will change depending on the selected category.

Parameters to Test

After you choose the question, you will be shown a variety of parameters to test. Most parameters apply to individual particles but some (such as Current Frame) are scene-wide.

The parameters depend on what kind of question it is so the interface will vary. Each question is described below in the Question types section.

Test Sub-Questions Mode

This is described in the Sub-Questions section below.

Create Sub-Question

Click this button to add a Sub-Question to the main Question. It will appear as a child object of the Question object.

Actions and Add Action

The Actions which will be carried out if the question is passed can be dragged into the 'Actions' list. You can create an Action object from the X-Particles menu or by clicking the 'Add Action' button, in which case the Action will be created and automatically added to the list.

Modifiers to Activate

In previous versions of X-Particles, if you wanted a Question to activate a modifier for a particle, you would create an Action to do that. In X-Particles 3, if that is all you need to do, then you can drag the modifier to be activated into this list and if the question is passed, the modifier will be activated directly. You can still do it the old way with an Action but this new feature reduces the number of objects and is faster to set up.

Modifiers to Deactivate

The same as for 'Modifiers to Activate' but modifiers in this list will be deactivated.

Multiple questions

If you only have one Question in the emitter, then this section is not relevant. If you have more than one Question, X-Particles can treat them in two different ways, which can be selected by the ‘Mode’ drop-down list in the Questions tab of the emitter.

To try these modes out, create two Question objects. The first should ask if the particle age is greater than 30 frames, the second if the particle age is greater than 60 frames. Drag both Questions into the emitter’s Questions tab list, with the 60-frame Question below the 30-frame Question, and change the mode to ‘Strict sequential order’. Then add an Action object to each Question. In the 30-frame Question, make the Action change the particle colour to red; in the 60-frame Question make the Action change the colour to blue.

Play the animation. The particles should change colour from their default (green, unless you changed it) to red when each particle is 30 frames old, and then to blue when the particle is 60 frames old.

Testing each Question once only

In most cases you will probably want to test each question until it passes, then not again. To do this, in the emitter drag the Question object into the list headed 'Test and Pass Once'. (This is where the Question will be placed if you click the 'Add Question' button in the emitter.) This list has two possible modes.

Mode: Strict Sequential Order

This mode is easy to understand. If the selected mode is ‘Strict sequential order’ then each question is asked in strict sequence. Suppose you have the setup described above, but then add a second question which asks whether the particle age is over 60 frames. You place this question – and this is important – below the first question in the question list.

The second question will not be asked until the first has been passed as true. In other words, the 60-frame question won’t be asked of a particle until the 30-second question has been passed. That’s fine, and completely logical. But what if you drag the 60-frame question to be above the 30-frame question in the question list? Now the 30-frame question won’t even be tested until after the 60-frame question has been tested. In this scenario, what you will see is that the 60-frame Question takes effect when a particle is more than 60 frames old, then in the very next frame the 30-frame question will be asked (and will pass, since the particle is of course more than 30 frames old).

Mode: Bypass Unanswered Questions

Let’s go back to the original setup with two Questions, one testing the particle age to be more than 30 frames and the other 60 frames. The 60-frame question is below the 30-frame question in the list.

If you play the animation, you will see exactly the same as in the ‘Strict sequential order’ mode. Now drag the 60-frame question above the 30-frame question and run the animation again. You see that the particles change to red when each is 30 frames old, but never change to blue. Why?

In this mode, the emitter will test each question in turn until it finds one which passes. In this case the 30-frame Question will pass before the 60-frame question, even though it is below the 60-frame Question in the questions list. But, in the next frame the particle ‘knows’ that the 30-frame question has passed and will look for the next question in the list. Since there is no next question, the 60-frame question will never be executed; it’s been bypassed by the 30-frame question.

Although this sounds complicated, it is in fact the more useful mode of the two and is therefore the default setting.

There is one important lesson from this: always make sure your questions are in the right order and you have selected the correct mode for what you want to do. If they aren't, you WILL get unexpected results!

You can prevent individual questions from being asked by disabling them in the object manager or by removing them from the questions list.

Testing questions repeatedly

As you can see from the emitter interface, there are in fact two lists of questions in the Questions tab of the emitter. The first list is headed 'Test and Pass Once' and includes the Mode setting described above. These questions, regardless of which order they are answered in, will only ever pass once for any particle. This means that the associated Action(s) will only be triggered once by the Question.

Sometimes it is desirable to test the Question in each frame, and trigger the Action(s) whenever it passes. To do this, drag the Question object into the list headed 'Test all Frames' and delete it from the 'Test and Pass Once' list. Now the Question will be tested every frame and will trigger its Action(s) each time it passes.

Sub-questions

What if you want to ask two questions at the same time? Suppose you want to carry out an Action if the particle is both more than 60 frames old AND has a speed of more than 200 units/second? You can do this by adding one or more Sub-questions to a Question.

To do this, click the ‘Create sub-question’ button in the Question object. This will add a Sub-question as a child object of the Question. This is the only way to add a Sub-question; you cannot add one via the Plugins menu or using the System object.

Please note: to create sub-questions you MUST do this by using the 'Create Sub-Question' button in the Question object. You cannot do it by creating a new question, or copy/pasting an existing question, and making it a child of another Question object - this will not work. Although they look similar, Sub-Question objects are not the same as Question objects and are handled differently by X-Particles.

Sub-questions are almost identical to Questions except that you cannot add Action objects to them and you cannot add Sub-questions to a Sub-question. You set up the Sub-question just as you would a Question. The interface is therefore very similar to the Question object:

How sub-questions work

Back in the Question object, there is an option titled ‘Test Sub-Questions Mode’. There are two modes:

AND (the default mode)

Both the main Question and all Sub-questions must pass in order to carry out an action (so in the example above a particle would have to be more than 30 frames old and have a speed of more than 200 before the associated Action(s) were carried out)

OR

Either the main Question or any of the Sub-questions must pass in order to carry out an action (so in the example above a particle would either have to be more than 30 frames old or have a speed of more than 200 before the associated Action(s) were carried out)

The use of Sub-Questions can be very useful in deciding if an Action is to be carried out since you can set precise conditions in which the Action can occur.

Question types

There are several types of question which can be tested by the Question object. These are as follows.

Range settings

Many questions have a range setting. This is used to create a range either side of the base value. For example, suppose you want to test particle speed and you set a basic speed value of 200 and a range value of 10. The question tests whether the particle speed is within the range of values from 190 to 210 (i.e. 200 +/- 10).

Questions using a range almost always have two modes to use the range: you can select if the parameter being tested falls within the range or falls outside it. The range is not used unless you select one of these options.

Particle Data Questions

Particle Age

This is the default mode. This question tests whether a particle has a certain age. You should note that this does not mean the animation frame of the scene. For example, a particle may be emitted at frame 20 of the scene; if the Question tests whether the particle has an age exceeding (say) 30 frames, then at scene frame 30 this particle will only be 10 frames old (30 – 20) and so will not pass the question.

Parameters

There are three parameters for this question:

Mode

The question mode: whether the particle age is less than, equal to, or greater than the specified age; a fourth mode tests whether the particle is within a certain number of frames of death - see below for more details; two modes test whether the particle age is within a specified range, and the last mode tests if the particle has a specific age within the range.

Age

The age of the particle. (Or, if the mode is set to 'Is Within Time of Death the time before the particle dies.)

Range

The possible range either side of the age value.

Is Within Time of Death

In the Question mode setting, there is an option called 'Is Within Time of Death'. What it does is take the value in the 'Age' parameter and tests whether the particle will die within that many frames (or seconds). How does this work?

Suppose you have an emitter generating particles with a lifespan of 100 frames. At 95 frames old, you'd like the particle to spawn some new particles. This is easy: just add a Question testing for age equals 95 frames and use that to trigger a Spawn action. But what if the particles all have different lifespans because some variation was set in the emitter? Now you don't know what the age of each particle is. Some will spawn too long before death (if they have longer lifespans than 100 frames) while some won't spawn at all (if they have lifespans of under 95 frames). This question mode solves this problem by letting you specify an action to be triggered within a certain number of frames before death. In the above example, you would set this mode and then set the 'Age' value to 5. Now, 5 frames before death, the particle will trigger the action, no matter how long its lifespan is.

A couple of small points: the value in 'Age' now becomes the time before the expected particle death, NOT the age of the particle. If you set it to zero, the action(s) will be carried out at the moment of particle death. Of course, you may not see anything because the particle is now dead, but you can use this to spawn particles when a particle dies, for example. If you set the 'Age' value to the lifespan of the particle, the action(s) will be triggered as soon as the particle is created.

Secondly, this question uses the expected lifespan of the particle. If the particle is killed by another action, modifier, etc., these actions will not be triggered.

Fixed Within Range

For this mode setting, the range is supplied as with the inside or outside range modes. The difference is this. Suppose the age range is 50 +/- 20 frames, that is, 30 to 70 frames. The 'Is Within Range' setting will pass the question as soon as the particle is 30 frames old - because at that point, it is within the specified range. The 'Fixed Within Range' setting assigns a specific, randomly-chosen frame to each particle within that range, so any given particle may pass the test at a specific age within that range. The advantage of this is that the question will pass, and any actions triggered, at a specific age for each particle, so it doesn't happen all at once as it does for the 'Is Within Range' mode.

Particle Color

This question lets you test a particle's colour.

Parameters

Component to Test

This drop-down selects which of the three colour components (Red, Green, and Blue) are tested, alone or in combination:

  • RGB (Brightness)
  • Red Only
  • Green Only
  • Blue Only
  • Red and Green
  • Red and Blue
  • Green and Blue
Mode

The question mode: less than, equals, greater than, is in range or is not in range.

Component Values

The colour you want to test the particle colour against. By default this is mid-grey (RGB 127, 127, 127).

Range

Only available if the mode is one of the range questions. The lower limit of the range is the 'Component Values' colour minus the 'Range' colour, while the upper limit is those two values added together.

Be careful of the colour you select here. The default is black (RGB 0, 0, 0) so with this colour the question is the same as if 'Mode' was set to 'Equals'. If you make this colour mid-grey, and leave the default colour as it is, the question will always pass since then range is then between pure black and pure white.

Particle Group

This question tests whether a particle is, or is not, in a particular group.

Parameters

The two parameters are:

Mode

Whether a particle is in a group or if it is not in a group.

Groups

The list of groups to test; multiple groups can be dropped into this list.

If no group is in the groups list, the question will never pass. If more than one group is in the list and the mode is set to 'Is in Particle Group' the question will pass if the particle is in any of those groups. If the mode is set to 'Is not in Particle Group' the question will only pass if the particle is not in any of the groups.

Particle Index

Each emitted particle has its own unique index value. This question allows an action to be carried on one specific particle, or for any particles whose index falls into a range of values. Note that this is NOT the actual index of the particle in the emitter's particle array, as this can change over time. It is a unique identifier for each particle.

This is not the same as testing the particle count. The particle count question looks at live particles only. In this question, if you specify an index of 100, then the action will affect the particle with that index if one exists. If no particle with that index currently exists, the question will not be passed.

Parameters

There are three parameters for this question:

Mode

The question mode, which can be one of the following:

  • Equals: the particle index is equal to the specified index
  • Is greater than: the particle index is greater than the specified index
  • Is in range: the particle index is between the the specified index and the specified index plus the range (e.g. if the index is 10 and the range is 8, the particle must have an index of 10 to 18 to pass the question)
  • Is Not in range: the particle index is outside the specified index and the specified index plus the range (e.g. if the index is 10 and the range is 8, the particle must have an index of less than 10 or greater than 18 to pass the question)
  • Even-numbered particles: the particle index must be an even number
  • Odd-numbered particles: the particle index must be an odd number
Particle Index

The unique index of the particle.

Range

The index range (used for the 'Is in range' or 'Is Not in range' tests - see above).

Particle Radius

This question tests the radius of the particle.

Parameters

There are three parameters for this question:

Mode

The question mode, whether the radius is equal to, smaller than, or greater than, the test value, or is within or outside of the range.

Radius

The radius value to test.

Range

The possible range either side of the radius value.

Particle Rotation

This question lets you test a particle's rotation on any axis.

Parameters

Axis to Test

The rotation axis, either H, P, or B.

Mode

The question mode: less than, equals, greater than, is in range or is not in range.

Rotation Amount

The value to test the particle's rotation against.

Range

This value is subtracted from the 'Rotation Amount' to provide the lower limit of the range, and added to it to give the upper limit.

Particle Scale

This question tests a particle's scale.

Parameters

Axis to Test

The axis to test, alone or in combination:

  • XYZ
  • X Only
  • Y Only
  • Z Only
  • XY
  • XZ
  • YZ
Mode

The question mode: less than, equals, greater than, is in range or is not in range.

Component Values

The values to test for each axis. Not all values are used (e.g. if you are testing the scale along the X-axis, only the X component is tested and the others are ignored).

Range

Only available if the mode is one of the range questions. The lower limit of the range is the 'Component Values' setting minus the 'Range' setting, while the upper limit is those two values added together.

Particle Speed

This mode is the same as the particle age mode except that it tests particle speed instead of age. This can be used to change (or remove) particles which are of too high or low a speed.

Parameters

There are three parameters for this question:

Mode

Whether the particle speed is less than, equal to, or greater than the specified speed, or is within or outside of the range.

Speed

The speed of to test in scene units per second.

Range

The possible range either side of the speed value.

Particle Speed (World)

To use this question you MUST have activated 'World Speed' in the emitter's Extended Data tab.

This question works in exactly the same way as the 'Particle Speed' except that it tests the particle's "world speed". This is the particle's actual speed in the 3D world. If a particle is stuck to an object and its internal speed (as measured by the 'Particle Speed' question) is zero, it may still be moving if the object it is stuck to is moving. That is what this question tests.

Parameters

These are identical to the 'Particle Speed' question. Please refer to that question for details.

Time in Group

This question tests how long a particle has been a member of its current group. A particle can only be a member of one group at a time, but the group it belongs to can be changed. When the particle is created, or when the group changes, the time it has been in the group is set to zero then increments each frame. You can use this question to test how long it has been in its current group.

Parameters

There are three parameters for this question:

Mode

Whether the time in the group is less than or greater than the specified time, or is within or outside of the time range.

Time

The time of to test in time units (either frames or seconds, depending on user preferences).

Range

The possible range either side of the time value.

Custom Particle Data

In the emitter 'Extended Data' tab, you can add customised particle data of your own choosing. See the Custom Data page for full details.

This question lets you query the custom data you added and trigger actions accordingly, just as with the inbuilt data such as particle speed or age.

Parameters

This question has six parameters.

ID & Name

These two fields are used to identify which custom data item to query. You should enter either ID value of the data item you want to test, or its name, or both. How these fields are used to identify a data item is explained on the Custom Data page.

Mode

This drop-down has five options which test whether the data item in the particle is equal to the value in the 'Value' field (or 'String' or 'Time' field, depending on the chosen 'Data Type' option), greater or less than the value, or within or outside of a range centred around the value.

Data Type

The type of data in the custom data item. Can be one of:

  • Float
  • Integer
  • Matrix
  • String
  • Time
  • Vector

More detail can be found on the Custom Data page.

It is up to you to make sure that the data type in the question matches the data type in the custom data item, as specified in the emitter 'Extended Data' tab. If the two are different, the results are unpredictable; you cannot, for example, really test a Matrix against a String.

Value

As with other questions, this is the value to test the data item against.

String

If the data type is 'String', then instead of the 'Value' field you will see this field instead. Enter the string to test the custom data against.

Time

If the data type is 'Time', then instead of the 'Value' field you will see this field instead. Enter the time to test the custom data against.

Range

The possible range either side of the 'Value' or 'Time' fields. Not available for the 'String' datatype.

Particle Position Questions

Distance Along Spline

This is used in conjunction with the Follow spline modifier.

Parameters

The question has four parameters:

Parameter

The test to make:

  • whether the particle has reached the end or start of the spline
  • the distance it has travelled along the spline
  • or the number of loops the particle has made along the full length of the spline

Important note: if the particle is travelling in the forwards direction along the spline, it will never reach the start of the spline as it's moving away from the start. Likewise, if it is travelling backwards, it will never reach the end of the spline as it is moving towards the start.

Confusion can arise because in a closed spline the start and end positions appear to be in the same place, so you might assume that reaching the end is the same as reaching the start. However, that is not the case for an open spline, when the start and end locations are different. Therefore, be sure to choose the appropriate parameter to test depending on the direction of movement along the spline.

Mode

For the distance and loops tests only, whether the value should be greater or less than the corresponding test value.

Distance

For the distance test only, the distance to test for in terms of a percentage value of the spline length.

Loops

For the loops test only, the number of loops to test for.

Distance to Camera

This question compares the distance of the particle from the current camera (in scene units) to the value specified in the question. You can use this to carry out an Action (for example, changing generated geometry from a high-poly version to a low-poly version when the particle is sufficiently far away from the camera).

Please note that the distance tested is the particle distance to the camera used in the current render view, not the current editor view (these may, of course, not be the same).

Parameters

There are three parameters for this question:

Mode

Whether the distance is less than, equal to, or greater than the specified distance, or is within or outside of the range.

Distance

The distance from the particle in scene units to the camera.

Range

The possible range either side of the distance value.

When using this question, you would normally use the 'is greater than' test for particles travelling away from the camera, so that the question is passed once the particle gets far enough away. The 'is less than' test is most useful for particles coming towards the camera. If you use the 'is greater than' test for far-away particles coming towards the camera, please note that the test may be passed immediately the particle is released, which is probably not what you intended.

Be very careful when testing for equality as testing for an exact distance may never succeed. If you test for 1500 units and the actual distance is 1500.1, the question will not pass.

Distance to Object

This question compares the distance of the particle from a scene object to the value specified in the question.

Parameters

There are four parameters for this question:

Mode

Whether the distance is less than or greater than the specified distance, or is within or outside of the range.

Object

The object to test (the question will always fail if this is link field is empty).

Distance

The distance from the particle in scene units to the object.

Range

The possible range either side of the distance value.

Distance Travelled

This question compares the distance travelled by the particle (in scene units) to the value specified in the question.

Please note that what is tested is the actual distance travelled by the particle, not the distance from its origin to its current position. If a particle was to reverse its course and travel back to its point of origin, the actual distance travelled would be that from the origin to the point at which it changed direction, multiplied by 2.

Parameters

There are three parameters for this question:

Mode

Whether the distance travelled is less than, equal to, or greater than the specified distance, or is within or outside of the range.

Distance

The distance travelled by the particle in scene units.

Range

The possible range either side of the distance value.

Illumination

This question tests whether a particle is illuminated by a light. Note that this only tests if the particle falls within the illumination field of the light. It does NOT take account of any scene objects which may block the light from reaching the particle.

Currently, this question only works with Spot or Omni lights.

Parameters

Mode

Whether the particle is, or is not, illuminated by the light.

Light

The light to test - the question will always fail if this field is empty.

Use Falloff

Whether to take account of any falloff in the light's parameters; if this is unchecked, falloff is ignored.

Illumination Threshold

A threshold value - this is the illumination value of the light falling on the particle. If the threshold value is more than zero, and the test is whether a particle is illuminated, the light falling on the particle, taking the falloff into account if required, must exceed this value. If the test is if a particle is not being illuminated, the light on the particle must be below this value.

In Camera FOV

This question tests if a particle is, or is not, in the field of view of the current camera. Note that this means the camera currently in use, which can be the editor camera or some other camera. In other words, the question will fail unless the particle is in the field of view of a camera AND that camera is the current scene camera.

Parameter

There is only one parameter:

Mode

Whether the particle is in the camera FOV or if it is not be in the FOV.

Inside Volume

This question tests whether a particle is inside or outside the space occupied by an object.

Parameters

There are two parameters:

Mode

This has two options, whether the particle is inside the volume or outside the volume.

Object

The object whose volume is to be tested. This must be a collapsed polygon object or a C4D generator object or an object primitive. Objects in a Mograph Cloner or an Array object will not work. If you need to use one of these objects, drop the Cloner or Array into a Connect object and drop that into this field.

Modifier Falloff

This question tests whether a particle is within a particular modifier's falloff field.

Modifier

Drag the modifier to test into this field.

Parameters

The parameters are:

Mode

The question Mode, which can be one of the following:

  • Particle Within Falloff - passes the question if the particle is within the modifier's falloff; will always pass if the falloff is set to Infinite
  • Particle Outside Falloff - passes the question if the particle is outside the modifier's falloff; will never pass if the falloff is set to Infinite
  • Falloff > - passes if the falloff value is greater than the value given in the 'Low Falloff Value' parameter
  • Falloff < - passes if the falloff value is less than the value given in the 'High Falloff Value' parameter
  • In Range - passes if the falloff is equal to or greater than the 'Low Falloff Value' AND equal to or less than the 'High Falloff Value'
Low Falloff Value, High Falloff Value

See the 'Mode' parameter above.

Weighting

This is a random factor which affects the chance of a particle passing the question. Suppose the mode is 'Particle Within Falloff' and the Weighting is 100%. The question will always pass if the particle is within the falloff. But if the Weighting is 50%, then the question only has a 50% chance of passing even if the particle is within the falloff. This allows you to introduce some random variation and ensures that each particle does not pass the question at exactly the same point.

Nearest Particle

To use this question you MUST have activated 'Nearest Particle Data' in the emitter's Extended Data tab.

This question tests how far away is the nearest particle to or furthest particle from the one being tested.

Parameters

Parameter

There are two options:

  • Nearest Particle: the question looks at the nearest particle to the one being tested
  • Furthest Particle: the question looks at the furthest particle from the one being tested
Mode

This drop-down menu has two options:

  • Is Less Than: this tests if the nearest or furthest particle is closer than the distance given in the 'Distance' parameter
  • Is Greater Than: this tests if the nearest or furthest particle is further away than the distance given in the 'Distance' parameter
Distance

The distance to test.

Particle Position

This question tests a particle's position, either in relation to the centre of the 3D world or from an object.

Parameters

There are five parameters:

Position Space

The position space, either the centre of the 3D world or the position of an object.

Object

The object, if 'Position Space' is set to 'Object'.

Axis

This is the axis to test the distance along, can be X, Y, or Z. In other words, if set to 'X' the particle distance along the X-axis is tested against zero (if 'Position Space' is set to 'World') or the X-axis position of the object (if 'Position Space' is set to 'Object').

Mode

The question mode - is the particle position less than or greater than the distance in the 'Distance' parameter.

Distance

The distance to test.

Vortex Radius

This question tests the vortex radius of a particle. It requires a Vortex modifier to generate the required data; without one, the question will never pass. You can use this question (for example) to remove particles which have a vortex radius outside specific values.

Parameters

Mode

Whether the vortex radius is less than or greater than the specified distance, or is within or outside of the range.

Radius

The radius to test.

Range

The possible range either side of the Radius value.

Particle Flags Questions

Particle Collided (Object)

This question tests whether a particle has recently collided with a scene object. When that happens an internal flag is set in the particle and this question tests for that flag. The question will pass if the flag is set.

Note: this flag is NOT set for particle-particle collisions.

Parameter

In X-Particles 4 the parameter to this question, 'Clear Collision Flag' no longer exists. Due to the way collisions are handled the flag is cleared automatically by the emitter in the same frame that it occurs. Therefore the question will only pass in the frame that the collision takes place, and the flag is not persisted to later frames.

It is possible to add a persistent flag by using custom data. To do this, add a new custom data item to the emitter, with an Integer type and a starting value of zero. Add an Action to the collider tag which will change the value of this custom data item to 1 when a collision takes place. This data value will remain set so you can test it at any required time.

Particle-Particle Collision

This question tests whether a particle has recently collided with another particle. When that happens an internal flag is set in the particle and this question tests for that flag. The question will pass if the flag is set.

Note: this flag is NOT set for collisions with a scene object.

Parameter

This flag has no parameters. Note that the internal flag is cleared by the emitter in the same frame that the collision occurs - see 'Particle Collided (Object)' above for more details.

Has Exploded

This question tests whether a particle has been 'exploded' by an Explode modifier. If it has, the question will pass. Note that this internal flag is only set by the Explode modifier, NOT by the Explode action in direct mode.

Parameters

There are no parameters for this question.

Has Connections

This question tests whether a particle is connected to an object or to another particle. These connections can be created by the Constraints object, the Collider tag, or the Particle-Particle Collision object.

Parameters

The only parameter is a drop-down menu from which you choose the connection type you want to test for.

Note that the question will pass if the number of the connections of the selected type for the particle is greater than zero.

Particle Frozen

This question tests whether a particle has been frozen by a Freeze modifier or a Freeze action.

This question does not test if X-Particles has been halted by a Freeze tag! By definition it cannot do so, since a halted X-Particles will no longer be able to test any questions.

Parameters

There are four parameters:

Operation

This drop-down has two settings:

  • Match any: the question will pass if any of the movement, spin, or scale switches are checked
  • Match exact: the will only pass if the switches match the frozen parameters exactly.
Frozen Movement, Frozen Spin, Frozen Scale

These switches indicate which aspect of the particle must be frozen to pass the test. For example, a particle whose movement has been frozen but not the spin will pass the test if 'Frozen Movement' is checked but not if 'Frozen Spin' is the only checked switch, since the particle spin has not been frozen.

As an example, assume the Frozen Spin and Frozen Scale switches are checked, but that only the particle's scale has been frozen. This arrangement will pass the question if 'Match Any' is selected since the 'Frozen Scale' switch is set and the scale has been frozen. However, if 'Match Exact' is selected the question will not pass because to pass it both the particle's scale and spin would have to be frozen.

Particle Stick Question

This question is used in conjunction with the Cover/Fill modifier. It tests whether a particle has reached its target point on the object to be covered or filled. It can then be used to trigger any Action(s) in the Actions list of the Question.

Parameters

There are no parameters for this question.

Snapped (Inheritance Mod.)

This question tests whether a particle has been snapped to its target position by an Inheritance modifier. If it has, the question will pass. It requires an Inheritance modifier to generate the required data; without one, the question will never pass.

Parameters

There are no parameters for this question.

Stuck to Source Object

When emitted from an object, particles can be stuck to the source object so that they move with it if the object moves. This question tests whether a particle is stuck to its source object.

Parameters

There are no parameters for this question.

Geometry Questions

Branching

This question will only work if the particle is under the influence of a Branching modifier. There are several branching parameters which can be tested.

Parameters

Question Type

This can be one of the following:

  • the length of the branch controlled by this particle, expressed in frames
  • the branch level (for use with multiple sub-branch levels - see the Branching modifier for details)
  • the maximum length of the branch, expressed in frames
  • the number of branches associated with this particle
Mode

The question mode, whether the parameter to be tested is equal to, smaller than, or greater than, the test value.

Value to Test

The value to test against the particle branching data.

Important: in the Branching modifier, the length of a branch can be set either by scene units or by the length of time the branch grows for. The Branching question always tests for the length of the branch in terms of the number of frames it has grown for (not in time or in scene units). Once the branch has reached its maximum length the number of frames will not increase (i.e. this is not testing the age of the branch but the number of frames it has grown for until stopping).

Generated Object

This question allows you to test which object is being generated by a Generator or Sprite object.

Parameters

There are four parameters:

Object Type

This can be either the Generator or the Sprite object.

Mode

Whether or not the particle is associated with a generated object.

Object Index

For the Generator only, the index of the object being generated; it is up to you to make sure that the index is a sensible one - if you enter '3' here, and Generator has only two child objects, the question will always fail.

Sprite Type

For the Sprite object only, which type of sprite is being generated; this is the same drop-down list as found in the Sprite object'

Morph Value

This question is used in conjunction with particle morphing, and tests the amount that a particle has been morphed.

Parameters

Mode

It has the following modes:

  • Morph at Maximum - this tests if the particle has reached its maximum morph value
  • Morph Value Higher Than - tests if the morph amount is greater than the value in the 'Morph Value' setting
  • Morph Value Equals - tests if the morph amount equals the value in 'Morph Value' setting
  • Morph Value Less Than - tests if the morph amount is greater than the value in the 'Morph Value' setting

Morph Value

In the last three modes, the value to test against is found in this setting.

Particle Trail

This simple question tests whether the particle trail, if there is one, is at one of three possible states.

Parameter

Trail Length

The options are:

  • Trail is at Maximum Length
  • Trail Has Zero Length
  • Trail is Less Than Max. Length (i.e. the length is somewhere between zero and maximum length)

Physical Data Questions

Burn, Fuel, Mass, Smoke and Temperature; Friction & Bounce

These questions in the Physical Data section all test the various physical data used with the FLIP solver. The data which can be tested include:

  • Burn
  • Fuel
  • Mass
  • Smoke
  • Temperature

These two questions test the particle friction and bounce used in collisions with scene objects or other particles:

  • Friction
  • Bounce

Parameters

Mode

The question mode - less than, equals, greater than, is in range or is not in range.

Value

The name of this setting will change depending on the physical data selected. In each case it is the value to test the particle data against.

Range

The possible range either side of the physical data value.

Other Questions

Boolean Input

The purpose of this question is to allow you to feed the result of an Xpresso calculation into the question object. It is used as follows.

  1. Create a Question object and set it to 'Boolean input'
  2. Add an Xpresso tag to a screen object and drag the Question object into the Xpresso editor
  3. Create (or load from a preset) an Xpresso expression of some kind - it can be anything you like but must result in a boolean output
  4. Connect the boolean output of the Xpresso expression to the Input value port of the Question object

Once this is done, you can test if the output from the Xpresso is either TRUE or FALSE and trigger an Action accordingly.

Parameters

There are two parameters:

Mode

Whether the input value should be TRUE or FALSE to pass the question.

Input Value

The input value (this is set to TRUE by default, but this has no meaning because you would normally connect up an Xpresso expression to this value).

Special note regarding Boolean questions

One problem you may see here is that the Boolean output from the Xpresso node may not be reset to the initial value when the scene rewinds to the start frame. Suppose a node outputs FALSE at the start, then TRUE at some point during the animation. Then you rewind the scene and you would expect this to be reset to FALSE. This is usually what happens but it may not in some cases. For example, if you are testing a particle state which can either be TRUE or FALSE, at the start frame there are no particles and the node cannot execute - so it retains the value it currently has. It will be reset the next frame (assuming there are particles in this frame) but if the question has already been tested and passed, it's too late.

The solution to this if you encounter this problem is to add a sub-question to the Boolean question. The sub-question should test for current frame > (start frame + 1) - i.e., if the start frame is 0, this should test for current frame > 1. This will allow the Boolean value to be reset before the question will pass.

Current Time

This mode tests whether the current scene time is either equal to or greater than the specified value. Note that its effect is quite different from the particle age question. As an example, suppose you have a Question which tests whether the current scene time is greater than 30 frames, and if so, passes control to an Action which changes the particle colour. The moment the scene frame exceeds 30, all the particles which have been produced so far will change colour, but new particles will continue to have the colour specified in the emitter.

Parameters

There are three parameters for this question:

Mode

Whether the scene time is equal to or greater than the specified time, or is within or outside of the range.

Time

The scene time to test.

Range

The possible range either side of the time value.

Particle Count

This mode tests the particle count. It looks at currently ‘live’ particles and does not include previous particles which have been deleted.

Parameters

There are three parameters for this question:

Mode

Whether the particle count is less than or greater than the specified count, or is within or outside of the range.

Particle Count

The particle count to test.

Range

The possible range either side of the count value.

Python Script

With this question, you can write a Python script to test particle parameters and trigger an Action. For details, please see the page 'Using Python in X-Particles'.

Random Probability

This question doesn't test anything in the particle. It simply generates a random probability based on the 'Probability' parameter. If this is set to 100%, the Question always passes; if it is 0%, it will never pass. Set to 50% gives the question a 1 in 2 chance of passing.

By itself this isn't very useful, but as a sub-question in combination with other questions it is quite powerful because it introduces some random variation into the actions carried out on a particle. For example, you could combine it with a particle age question and set the probability to 50%. Without the random factor, the particle age question would pass, and trigger an Action, every time a particle reached the specified age, giving a rather too uniform appearance. But with the random probability set to 50%, the Action will only be triggered in 50% of cases even when the main particle age question passes.

Parameters

It has three parameters:

Mode

This allows you to choose between two methods of working. In X-Particles 3.5, using this question could give a different result each time the animation was run. So you might have got the perfect animation, but when it came time to render it,, it wasn't the same. In X-Particles 4 this question will now give the same result each time the animation is run, giving more consistency. You can select which method to use with this drop-down menu. The options are:

  • Constant - the new X-Particles 4 method giving consistent results
  • Varying - the legacy mode from X-Particles 3 (switch to this one if you load an older scene which uses this question and it doesn't give the results you expect)
Random seed

The seed value for the random number generator.

Probability

The probability that the question will pass.

Note: in Constant mode this question should give consistent results each time you run the animation. But if you change the number of subframes, this will change the result obtained from the question so the animation may be rather different as a result.

Number of Collisions

X-Particles keeps track of the number of collisions that have been made with scene objects (not particle to particle collisions). You can test for number of collisions with this question.

Note: this is the total number of collisions made by all particles, NOT the number made by an individual particle.

Parameters

There are three parameters for this question:

Mode

Whether the number of collisions is less than, equal to, or greater than the specified value, or is within or outside of the range.

Collisions

The number of collisions to test.

Range

The possible range either side of the number of collisions.