PopcornFX v2.11

Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors
  1. Home
  2. Docs
  3. PopcornFX v2.11
  4. Node Reference
  5. Builtin nodes
  6. Events

Events

This section details all event-related nodes.

EventGenerator

Scope: Simulation graph.

This is an advanced node, we recommended you do not use it directly but instead use the EventMultiplier or Trail nodes to achieve multiple-events-per-frame emission.

The EventGenerator node is a generalization of the Trigger node, which is able to pulse multiple events per frame.
The EventMultiplier and Trail nodes from the core library both use the EventGenerator node.

 

Minimal setup of an EventGenerator node:

EventGenerator node

 

Input pinsTypeDescription
Accumint2Dimensionless, initialized to int2(0).
See the EventMultiplier or Trail nodes on how to properly setup this value.
OffsetfloatHow much to advance the spawn accumulator each frame.
Valid range: [0, +∞[
IntervalfloatSpawn interval size this frame.
Valid range: ]0, +∞[
PulseWindowStartfloatFraction in current time-window (frame) at which the events should start being pulsed.
0.0 will pulse the event at the beginning of the frame.
1.0 will pulse the event at the end of the frame.
Valid range: [0, 1]
PulseWindowEndfloatFraction in current time-window (frame) at which the events should end being pulsed.
0.0 will pulse the event at the beginning of the frame.
1.0 will pulse the event at the end of the frame.
Valid range: [0, 1]
Output pins
Accumint2Outgoing Accumulator.
For the generate node to function properly, this should always be wired into a DiscretizationPoint node.
SignaleventOutgoing event.
No payloads are added by default.
+ all common properties

When the node is disabled, no events are pulsed.

 

When the spawn accumulator plus Offset reaches Interval, the node emits one event.
It will emit as many events as necessary until the spawn accumulator becomes lower than Interval.

For example, with an Accum starting at zero, an Interval at 2.5, and an Offset of 0.5, the first 4 simulation frames will produce no event, but the 5th will emit one event, followed by 4 frames with no events, etc…
With an Offset of 10.0, the first frame will spawn 4 events, the second frame will then spawn 4 events again, etc…

 

Logic:

    Accum += Offset;
    EventCountThisFrame = int(Accum / Interval);
    Accum -= EventCountThisFrame * Interval;
    for (evid = 0; evid < EventCountThisFrame; evid++)
    PulseEvent();

 

EventGraphPortal

Scope: Simulation graph.

Experimental feature (undocumented, subject to changes), introduced in v2.8.

 

EventParent

Scope: Simulation graph.

This node gives access to the parent event wired into the current layer, which gave birth to the current particle.

It allows to extract any payload the event carried.
These payloads can only be extracted at spawn !

 

Output pinsTypeDescription
SignaleventParent event.
Contains all the payloads sent over by the parent.This cannot be wired directly into an output node to “pass-through” the parent event.
To do so, you must setup a passthrough layer that does a trigger(true) at spawn, then uses a payload copy node to copy the parent event into the new pulsed event, and output that event.The PopcornFX editor can do this for you if you insert a new layer on an existing event wire in the event-graph. (either hover the wire with the mouse cursor and hit Ctrl+Space, then type “Layer” in the node creation dialog, or right-click on the wire, select insert node, and type “Layer”.
+ all common properties

When the node is disabled, no payloads are present.

 

EventPayloadAppend

Scope: Simulation graph.
The PayloadAppend node injects a new payload into an event, or replaces an existing one.

EventPayloadAppend node

 

PropertyTypeDescription
PayloadNameStringName of the payload data element.
PayloadTypeenumType of the payload data element.

  • auto
  • float1
  • float2
  • float3
  • float4
  • int1
  • int2
  • int3
  • int4
  • bool1
  • bool2
  • bool3
  • bool4
  • orientation
PayloadKindenumPayload builtin kind

  • Generic: (default) No specific kind
  • XFormsPositions: Position transforms payload. Will make the payload float3. Transform nodes in child layers will use this payload to transform from local to world at spawn.
  • XFormsOrientations: Orientation transforms payload. Will make the payload float3. Transform nodes in child layers will use this payload to transform from local to world at spawn.
  • EmittedCount: Number of emitted events since the birth of the particle. Only useful with the EventGenerator node. When this payload kind is selected, the Value input pin will be ignored, and the emitted count will be auto-generated.
ForceOverrideboolIf enabled, no warning will be emitted when overriding a payload element of the same name and type.
A warning will still be emitted when overriding a payload element of the same name but a different type.
ForceTypeOverrideboolIf enabled, no warning will be emitted when overriding a payload element of the same name but different type.
IgnoreWarningsUnusedboolIf enabled, no warning will be emitted if this payload element is unused by the layers it triggers in the layergraph.
Input pins
SignaleventEvent to process.
Valuefloat-float4
int-int4
bool-bool4
orientation
Value to add to the payload of Signal.
Output pins
SignaleventProcessed event with the payload added.
+ all common properties

When the node is disabled, no payload is added to the incoming event, which is passed-through unchanged.

Troubleshooting: You cannot use this node in the event-graph ! If you want to append a payload to an event flowing through the event-graph, you will have to create a dummy passthrough layer (insert a “layer” node on the existing event wire) that will take care of re-triggering the event, copying the incoming payload from the parent event, and then append the new payloads you need to add.

 

EventPayloadAppendLinear / EventPayloadAppendCubic

Scope: Simulation graph.
The PayloadAppendLinear or PayloadAppendCubic nodes inject a new payload into an event, or replace an existing one.
They will use the time-fraction in the current frame at which the event was pulsed to interpolate the payload, using the start/end values, and the start/end tangents if any.

 

This allows to smoothly interpolate the spawn position within a trail, and to even get bent trajectories using the start/end velocity of the parent particle.
This is only an example, you can interpolate any payload value.
Values of type orientation cannot use the cubic interpolation mode, only linear.

 

When you create the nodes in-editor, both the Linear and Cubic flavors of this node are in fact presets. There is only a single real EventPayloadAppendInterp node which handles interpolated payloads, and allows you to switch between the different interpolation types.

EventPayloadAppendInterp node

 

PropertyTypeDescription
PayloadNameStringName of the payload data element.
PayloadTypeenumType of the payload data element.

  • auto
  • float1
  • float2
  • float3
  • float4
  • int1
  • int2
  • int3
  • int4
  • bool1
  • bool2
  • bool3
  • bool4
  • orientation
PayloadKindenumPayload builtin kind

  • Generic: (default) No specific kind
  • XFormsPositions: Position transforms payload. Will make the payload float3. Transform nodes in child layers will use this payload to transform from local to world at spawn.
  • XFormsOrientations: Orientation transforms payload. Will make the payload float3. Transform nodes in child layers will use this payload to transform from local to world at spawn.
  • EmittedCount: Number of emitted events since the birth of the particle. Only useful with the EventGenerator node. When this payload kind is selected, the Value input pin will be ignored, and the emitted count will be auto-generated.
ForceOverrideboolIf enabled, no warning will be emitted when overriding a payload element of the same name and type.
A warning will still be emitted when overriding a payload element of the same name but a different type.
ForceTypeOverrideboolIf enabled, no warning will be emitted when overriding a payload element of the same name but different type.
IgnoreWarningsUnusedboolIf enabled, no warning will be emitted if this payload element is unused by the layers it triggers in the layergraph.
InterpolationenumControls how the payload will be interpolated

  • None: No interpolation, same behavior as the EventPayloadAppend node
  • Linear: Uses linear interpolation. The input pins TangentStart and TangetEnd are not visible / ignored.
  • Cubic: Uses cubic interpolation.
HighQualityInterpolationboolWhen enabled, the orientations will be interpolated with a higher-quality algorithm.
When internally represented using quaternions, SLerp will be used instead of NLerp.
Input pins
SignaleventEvent to process.
ValueStartfloat-float4
int-int4
bool-bool4
orientation
Value of the payload at the start of the time-window (frame).
ValueEndfloat-float4
int-int4
bool-bool4
orientation
Value of the payload at the end of the time-window (frame).
TangentStartfloat-float4
int-int4
bool-bool4
Tangent of the payload at the start of the time-window (frame).
Set to ValueEnd - ValueStart to produce linear interpolation even when Interpolation is set to Cubic.
TangentEndfloat-float4
int-int4
bool-bool4
Tangent of the payload at the end of the time-window (frame).
Set to ValueEnd - ValueStart to produce linear interpolation even when Interpolation is set to Cubic.
Output pins
SignaleventProcessed event with the payload added.
+ all common properties

When the node is disabled, no payload is added to the incoming event, which is passed-through unchanged.

 

EventPayloadClear

Scope: Simulation graph.

Erases one or all payload elements from the incoming event wire.

 

PropertyTypeDescription
ClearAllboolIf enabled, will remove all payload elements.
PayloadNamestringName of the payload element to remove. Ignored if ClearAll is enabled.
Input pins
SignaleventEvent to process.
Output pins
SignaleventProcessed event.
+ all common properties

When the node is disabled, the original Signal event is passed-through unchanged.

 

EventPayloadCopy

Scope: Simulation graph.

Copies all payloads from one event wire to another.

EventPayloadCopy node

 

Input pinsTypeDescription
SignaleventEvent to copy the payloads into.
SignalBeventEvent to copy the payloads from.
Output pins
SignaleventProcessed event.
If Signal and SignalB both have events with identical names, the events in SignalB will always be force-copied and overwrite the events that were in Signal initially.
+ all common properties

When the node is disabled, the original Signal event is passed-through unchanged.

 

EventPayloadExtract

Scope: Simulation graph.

This node performs the reverse operation of the EventPayloadAppend node: It extracts a payload from an existing event.
This is usually used inside layers to extract the payloads sent by the parent event and wire them into the simulation computations.

EventPayloadExtract node

 

PropertyTypeDescription
PayloadNameStringName of the payload data element.
PayloadTypeenumType of the payload data element.
This is optional, you usually want to keep it to auto, the graph compiler will deduce the type if it finds the payload in the parent event.

  • auto
  • float1
  • float2
  • float3
  • float4
  • int1
  • int2
  • int3
  • int4
  • bool1
  • bool2
  • bool3
  • bool4
  • orientation
PayloadKindenumPayload builtin kind.
You can leave the payload name empty, and instead specify the kind of payload you want to extract.
This allows you to always extract the XForm or EmittedCount payloads no matter how they’ve been named in the parent payloads. Useful when extracting those builtins from a generic template.

  • Generic: (default) No specific kind
  • XFormsPositions: Position transforms payload. Will make the payload float3. Transform nodes in child layers will use this payload to transform from local to world at spawn.
  • XFormsOrientations: Orientation transforms payload. Will make the payload float3. Transform nodes in child layers will use this payload to transform from local to world at spawn.
  • EmittedCount: Number of emitted events since the birth of the particle. Only useful with the EventGenerator node. When this payload kind is selected, the Value input pin will be ignored, and the emitted count will be auto-generated.
IgnoreWarningsMissingboolIf enabled, no warning will be emitted if this payload element is not found in the input event link. Any numeric payload not found but still extracted evaluates to zero.
ExtractEventMaskboolIf checked, overrides PayloadName, and the node will return the event mask (trigger condition), of type bool.
RemoveFromPayloadboolIf enabled, removes that element from the payload.
Input pins
SignaleventEvent to process.
DefaultValuefloat-float4
int-int4
bool-bool4
orientation
Value to output in the output Value pin when the payload is not found in the parent event.
Output pins
SignaleventInput event passed-through, with the payload removed if RemoveFromPayload is true.
Valuefloat-float4
int-int4
bool-bool4
orientation
Value extracted from the event payload.
Foundbooltrue if the payload was found in the parent event, false otherwise.
This is usually constant-folded at compile time, except when the current layer is triggered by multiple parent layers, some of which append the payload element, and some others don’t.
+ all common properties

When the node is disabled, no payload is extracted from the incoming event, the Value pin behaves as if it was unplugged from whatever it is plugged in.

 

EventPayloadExtractLinear / EventPayloadExtractCubic

Scope: Simulation graph.

These node perform the reverse operation of the EventPayloadAppendLinear / EventPayloadAppendCubic nodes: They extract a payload from an existing event.

 

This can only be used to extract a payload from the same layer, coming from an EventGenerator node, so its use is limited.

It’s only useful to grab payload interpolation parameters that were added inside a template node you don’t have access to and can’t modify (ex: from the corelib, or from your studio’s template library).

EventPayloadExtractInterp node

 

PropertyTypeDescription
PayloadNameStringName of the payload data element.
PayloadTypeenumType of the payload data element.
This is optional, you usually want to keep it to auto, the graph compiler will deduce the type if it finds the payload in the parent event.

  • auto
  • float1
  • float2
  • float3
  • float4
  • int1
  • int2
  • int3
  • int4
  • bool1
  • bool2
  • bool3
  • bool4
  • orientation
PayloadKindenumPayload builtin kind.
You can leave the payload name empty, and instead specify the kind of payload you want to extract.
This allows you to always extract the XForm or EmittedCount payloads no matter how they’ve been named in the parent payloads. Useful when extracting those builtins from a generic template.

  • Generic: (default) No specific kind
  • XFormsPositions: Position transforms payload. Will make the payload float3. Transform nodes in child layers will use this payload to transform from local to world at spawn.
  • XFormsOrientations: Orientation transforms payload. Will make the payload float3. Transform nodes in child layers will use this payload to transform from local to world at spawn.
  • EmittedCount: Number of emitted events since the birth of the particle. Only useful with the EventGenerator node. When this payload kind is selected, the Value input pin will be ignored, and the emitted count will be auto-generated.
IgnoreWarningsMissingboolIf enabled, no warning will be emitted if this payload element is not found in the input event link. Any numeric payload not found but still extracted evaluates to zero.
ExtractEventMaskboolIf checked, overrides PayloadName, and the node will return the event mask (trigger condition), of type bool.
RemoveFromPayloadboolIf enabled, removes that element from the payload.
InterpolationenumControls which interpolation parameters to extract.

  • None: No interpolation, same behavior as the EventPayloadAppend node
  • Linear: Uses linear interpolation. The output pins TangentStart and TangetEnd are not visible / ignored.
  • Cubic: Uses cubic interpolation.
Input pins
SignaleventEvent to process.
DefaultValuefloat-float4
int-int4
bool-bool4
orientation
Value to output in the output Value pin when the payload is not found in the parent event.
Output pins
SignaleventInput event passed-through, with the payload removed if RemoveFromPayload is true.
Valuefloat-float4
int-int4
bool-bool4
orientation
Value extracted from the event payload.
Foundbooltrue if the payload was found in the parent event, false otherwise.
This is usually constant-folded at compile time, except when the current layer is triggered by multiple parent layers, some of which append the payload element, and some others don’t.
+ all common properties

When the node is disabled, no payload is extracted from the incoming event, the Value pin behaves as if it was unplugged from whatever it is plugged in, and the Found pin outputs false.

 

EventStart

Scope: Event graph.

Brings events pulsed from a Timeline into the event graph. One event will be pulsed out of the EventStart node for each event keyframe present in the timeline referenced by the node.
The pulsed event will contain all the payloads specified in the original timeline keyframe.

EventStart node: Timeline

PropertyTypeDescription
EventNamestringName of the timeline track events should be pulsed from
Output pins
SignaleventOutgoing event.
There will be one event pulsed per keyframe in the timeline track. If a single simulation timestep has crossed multiple keyframes, multiple events will be emitted at the correct timestamps.
Each event is emitted with the full payload defined in each timeline keyframe.
+ all common properties

When the node is disabled, no events are pulsed.

 

EventTrigger

Scope: Simulation graph.

The event trigger node takes a bool condition, and pulses an event whenever it is true.
It is evaluated every frame, meaning that if the condition is true during multiple consecutive frames, it will trigger one event per frame, until the condition becomes false.
When the Condition input is a Spawn value, and the node is not forced to Evolve, the evaluation will happen only once at spawn.

It cannot pulse multiple events per frame, making it unsuitable for things like spawning trails.
To pulse multiple events per frame, use the EventGenerator node instead.
To pulse an event only once, use the TriggerOnce node from the core library.

 

Input pinsTypeDescription
ConditionboolTells the trigger node whether or not to pulse an event.
PulseAtfloatTime fraction within the simulation frame at which the event should be pulsed.
0.0 will pulse the event at the beginning of the frame.
1.0 will pulse the event at the end of the frame.Valid range: [0, 1]You can use this to pulse an event at a specific time.
For example you can compute the exact time of a collision inside the frame by using the ratio between the intersection distance over the total raycast length, and the spawned child particles will evolve for the correct impact time up til the end of the frame, giving precise and robust lifetime management for short-lived particles, even at lower framerates. (Note that the “Physics” and “Collision” nodes from the core library already perform these kind of computations to ensure impact events are emitted with the correct timestamps)
Output pins
SignaleventOutgoing event.
The trigger node will emit either zero or one event per simulation step, depending on the value of the Condition input.
No payloads are added by default.
+ all common properties

When the node is disabled, no events are pulsed.

Was this article helpful to you? Yes No

How can we help?