0 like 0 dislike
Hello, I'm using shape + shape sample nodes to give position of particle spawn.

I wonder if i could move the spawn position overtime by collaborate with curve + curve over time nodes. Therefore,  particles are spawned while the particle spawn position is moving.

Also, seems like xform node does not support local position.  I couldn't keep the particles are attached and stayed with the spawn position while it's moving.

Please help.  Thanks
by niceyaeja (170 points)

1 Answer

0 like 0 dislike

Hi !

I'm assuming you are using PopcornFX v2 and not v1 as you mention nodes?

If you want to move the spawn position along a path or curve, as if the spawn shape was "swept" along that path over time, you can just add it to the position, but you will need to make sure the sampling of the curve or path happens at spawn time, not evolve time.

Here's a simple example I just made with an event-multiplier node that emits 1000 particles per second over 2 seconds, and spawns this layer:

The "Animtrack sampler" node has an animtrack node plugged into it, which points to an FBX file containing an animation path, with in this case is a roughly "circular" path. (the animtrack node is displayed with the same icon as a curve, but it is not a curve, we will change that icon in an update)

You could also use a curve & curve sampler node.

This view of the graph is the "Exec rate" view, and colors nodes to show which ones run at spawn, and which ones run at evolve (every frame). You can toggle between the different views using the "P" and "Shift+P" hotkeys in the nodal editor.

The red nodes are updated every frame.

Notice that the animtrack sampler node appears red here. This is because by default, when nothing is plugged inside its input "Cursor" pin, it uses the particle LifeRatio, which is updated every frame.

It will produce this:

As you can see, as the path sampling sursor is the particle LifeRatio, the particles will sample different points along the path as they age, making them move along the path.

Here is the same graph, but now plugging "effect.age" in the cursor input of the animtrack sampler:

The animtrack sampler node is still red because one of its node still runs at evolve (the "LifeRatio" node). But notice how the sampler position value and the rest of the nodes are now run at spawn time. (There's a bug in v2.1 where the renderer nodes are also shown as being run at spawn time, they should be colored like in the first screenshot)

This is what it produces:

Notice how it stops at the end of the path. This is because the multiplier node (emitter) emits for 2 seconds in that example, so particles will be born between 0 seconds and 2 seconds after the effect starts, and we use effect.age as the animtrack cursor, but the animtrack expects [0,1] values for its cursor, 0 meaning the beginning of the path, 1 meaning the end. So here, after 1 second, we'll have sampled the entire path, and after that, it'll stay clamped at the end of the path.

If you have more complex paths with rotations and scales you can also use a "transform" node instead of the "add" node:

I'm not sure what the issue was with the xform node?


Following the discussion below, to have all particles move along the path at the same time, you'd set the "effect.age" node so they all sample the path at the same location at any given time (all particles from the same effect instance will have the same value for "effect.age", which is the time in seconds since the effect instance has been spawned into the world)

And the result:

Hope this helps !

by Julien (35.2k points)
Thank you Julien.  I'm clear about the idea for moving position but i need to know if we could move the particles in sphere shape instead of being left behind.  Basically, particles in shape of sphere moves to different location without breaking the form.
Ah sorry I didn't understand that.
Well sure, just set 'effect.age' to run at evolve. Then all particles will sample the track at the exact same place every frame, and you'll have them move along a sphere.

With 'self.lifeRatio', each particle has its "own" time-cursor in the track, with 'effect.age', all particles from the same effect instance are using the same cursor.

The graph: https://i.imgur.com/xBSbqLT.png

The result: https://i.imgur.com/XyEbuJT.gif

EDIT: I just edited the answer above with this solution.