3
$\begingroup$

I was looking for a solution of this issue regarding animating the number of particles in blender. I have to emit particles from a pulsating hole at regular intervals. How can i do it? I tried animating the "render" settings in particle to "none" and "object" but the issue is particles that are already emitted are disappearing.I just want to stop the particles coming out of hole at a particle time without disappearing the already emitted particles.

Any solutions?

$\endgroup$
1
  • $\begingroup$ i updated my answer $\endgroup$
    – Chris
    May 3 at 12:22
6
$\begingroup$

Here's a workaround that might help. If you don't want to create a particle system for each "pulse" but a single particle system doesn't allow switching emission "on" and "off", you have to kill particles in those frame ranges that you don't want them.

The lifetime of the particles should be high enough so that they are visible as long as you wish to see them. Let's say you want to emit particles between frames 10-20 and 40-50 for example.

  1. Place a Collision object where the emitter is, set Permmeability = 0 and enable Kill Particles.
  2. Go to frame 9, set keyframes for Permeability and Kill Particles.
  3. Go to frame 10, set Permeability = 1 and disable Kill Particles and keyframe those values again.
  4. Go to frame 20, set keyframes again without changing the values.
  5. On frame 21, set Permeability = 0 and enable Kill Particles, keyframe them again.
  6. Select all keyframes in the Timeline, Ctrl+C to copy them, then go to frame 39 and paste them with Ctrl+V
  7. Keep pasting those keyframes wherever you want to emit particles on the Timeline.

Timeline example for Collision object: collision timeline

Now here comes the problem: depending on what kind of scene you have and how and where you want the particles to emit, killing the particles normally takes (at least) one frame, so they exist for one frame and will be visible. If your scene setup allows it, you could disguise this by having the emitter hidden by another object so that those killed particles stay inside there.

If you are rendering with Cycles you can use the Age output of the Particle Info in the Shader Editor for the particle material. Plug Age into a Greater Than node to check if Age > 1. This information can be used as a Mix Factor between a Transparent Shader and the normal particle material, this makes the particles appear at an age of > 1. This is probably the best, because you can hide the Collision object and don't need another object hiding the killed particles.

emitter

$\endgroup$
1
  • $\begingroup$ Cool idea with collision‼️‼️👍🏻👍🏻 $\endgroup$
    – Chris
    May 3 at 23:34
6
$\begingroup$

The 'Lifetime' of particles can be 'keyframed' and any particles that are generated take on the lifetime at the time it is created. This means that you can control how long each frame's particles will exist for before dying. By pulsing the lifetime between 500 and 1 you can get the following result :

pulsed particles

The only issue here is that the Lifetime cannot be reduced below zero - so the particles will always exist for at least one frame. If the emitter is visible then you will see each particle created during the 'off' pulse briefly appearing before disappearing on the next frame.

The solution to these transient particles is to simply hide them by placing a mesh to cover the emitter such that the particles can pass through unaffected :

pulsed particles with hidden emitter


EDIT: As pointed out by @GordonBrinkmann, while this does work in the viewport, it fails to render as the particles are incorrectly handled as if they expired at the point the Lifetime keyframes back down to '1'. This is the case even if the particle system is first Baked. This would appear to be a bug in Blender.

However, on investigating further, while Blender 2.93 Alpha compiled on 23/3/2021 does exhibit the problem, the latest daily build of Blender 3.00 Alpha as of 4/5/2021 does appear to work correctly. This would seem to indicate the the bug with the handling of keyframed Lifetime appears to have been very recently fixed.

You still do have the problem of the particles existing for 1 frame (the same problem as experienced by Gordon) but that can be hidden behind an additional mesh as described above.


EDIT2: There are some discrepancies between how this operates in Eevee and Cycles and also depending on the start 'lifetime' and how it interacts at the end of the simulation. This all points to some buggy behaviour when manipulating the lifetime in this way. IMO this makes this an unreliable solution at present but I'll put together a bug report to the Blender developers - hopefully this can be resolved at some release in the future. For now, go with @GordonBrinkmann's excellent solution as that requires slightly more setup but should be far more reliable.

$\endgroup$
15
  • $\begingroup$ Wow, didn’t know that!!! Very useful $\endgroup$
    – Chris
    May 3 at 23:30
  • $\begingroup$ Yours combined with Gordon’s shader trick would be the easiest solution $\endgroup$
    – Chris
    May 3 at 23:37
  • $\begingroup$ WOW, didn't know about keyframing lifetime either. As @Chris said, combine that with my particles material and then there's no need for disguising the short-lived particles. At least for Cycles I suppose this amswer to be the best solution... as long as the emission itself is not animatable. $\endgroup$ May 4 at 4:16
  • 1
    $\begingroup$ TBH, I didn’t know about being able to keyframe this until I started researching for the question. That’s what I love about this site - you learn so much just by helping other people solve their problems :-) It’s a shame the lifetime can’t go down to zero as that would be a fantastic way of achieving this. I’m looking forward to the eventual “everything nodes” particle nodes - I think that will be a potential game-changer. $\endgroup$ May 4 at 6:27
  • 1
    $\begingroup$ This is a great source of knowledge! Thanks a lot. Because of the render bug i tried using Blender 3.0 But still the same issue is showing for me. When the lifetime is reaching 1, the already emitted particles are disappearing. $\endgroup$
    – Arun Nura
    May 7 at 6:27
2
$\begingroup$

The particle system itself does not provide this functionality. But...of course...there might be different "cheap" workarounds.

You can increase the lifetime of particles so that they are not disappearing. e.g. increase it a little bit from 50 to...let's say...100000.

enter image description here

One cheap workaround:

Give the particles a material and make this material transparent for that timesframes on which you want to have the pulsating "off".

One expensive workaround: Use python.

UPDATE:

new method with particle info:

use this setup:

enter image description here

this kind of works, but it does not look good because you cannot really "see" the space between when particles are emitting from a sphere....

result on a plane: enter image description here

result on a sphere:

enter image description here

sphere with better camera angle:

enter image description here

for spherical emitters it might make sense to change the color/pulse like this:

enter image description here

$\endgroup$
7
  • 1
    $\begingroup$ The problem with the cheap workaround is, that all particles will be transparent when the pulsating is "off". But I just got an idea... maybe you can build some combination with particle lifetime... for example like: "if frame number is between (specified range where they should be invisible) AND particle lifetime is below (specified lifetime of already spawned particles that should stay visible), then make the material transparent. But as long as all particles stay in view (I guess so, because otherwise disappearing particles wouldn't matter) they would all switch from transparent to visible. $\endgroup$ May 3 at 10:41
  • $\begingroup$ @GordonBrinkmann yep, sounds good 👍🏻 $\endgroup$
    – Chris
    May 3 at 10:47
  • $\begingroup$ I'm not sure my idea is good... I mean, those particles that appear in "off time" become visible when you switch back to "on time" again, too. Don't think this is desired. $\endgroup$ May 3 at 10:56
  • $\begingroup$ Well - in cycles we could ask for the age of particles and consider this. Then it would work...😉 $\endgroup$
    – Chris
    May 3 at 11:04
  • $\begingroup$ I was talking of Cycles, Eevee can't use particle info. But the problem is, if there is a continuous flow of particles that live "forever", than ALL will become visible when you switch off transparency - even those that were generated transparent. $\endgroup$ May 3 at 11:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.