Page MenuHome

Particles cache ignores animated lifetime
Confirmed, NormalPublicBUG


System Information
Operating system: Windows-10-10.0.18362-SP0 64 Bits
Graphics card: GeForce RTX 2080 Ti/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 451.67

Blender Version
Broken: version: 2.90.0, branch: master, commit date: 2020-08-31 11:26, hash: rB0330d1af29c0
Worked: not sure if it worked after 2.80, maybe it worked in 2.79, but I'm not sure.

Short description of error
If you animate the lifetime and bake the particles everything in the same blender session everything works correctly, no matter if you bake them to disk or to memory.
When you save the file, and open the file again the particle cache is broken and it's loading all the animation with the lifetime present in the first frame, no matter if it's a disk cache or a memory cache.

Exact steps for others to reproduce the error

Blende file:

Steps to reproduce:

You can watch the video I did or follow this steps:


1.- Open the attached blend file with Blender 2.90 release
2.- Clean the cache if there is one, change some parameter like particle count (don't touch particle lifetime, it's animated)
3.- Bake the animation, and you will see the correct result
4.- create a new file
5.- reload our test file
6.- you will see how the cache is not behaving correctly and it's ignoring the animated lifetime

It's impossible to trustworthy bake particles without this working, because not even the disk cache is working

Event Timeline

I suspect the problem is in the file:


In the line 1325:

void psys_get_pointcache_start_end(Scene *scene, ParticleSystem *psys, int *sfra, int *efra)
  ParticleSettings *part = psys->part;

  *sfra = max_ii(1, (int)part->sta);
  *efra = min_ii((int)(part->end + part->lifetime + 1.0f), max_ii(scene->r.pefra, scene->r.efra));

Because it takes a static value of the part->lifetime variable, but it's just a suspicion, I'm not sure.

Germano Cavalcante (mano-wii) changed the subtype of this task from "Report" to "Bug".Thu, Sep 10, 11:42 PM

I can confirm the problem.
I tested it in 2.79 and it used to work.
Here the file for 2.79:

Germano Cavalcante (mano-wii) changed the task status from Needs Triage to Confirmed.Fri, Sep 11, 11:05 PM