Page MenuHome

Baked particles dont render in final frame
Confirmed, NormalPublicBUG

Description

System Information
Operating system: Windows-10-10.0.18362 64 Bits
Graphics card: GeForce GTX 980 Ti/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 431.60

Blender Version
Broken: version: 2.80 (sub 75), branch: master, commit date: 2019-07-29 14:47, hash: rBf6cb5f54494e
Worked: (optional)

Short description of error
Baked particles in final frame shows up in viewport but not in render.

Exact steps for others to reproduce the error
Load attached blend file.


Play animation, move to last frame. Render and you can see the particles fine.
Bake the particles, move to last frame. Render and now particles missing.

Originally attached file:

Event Timeline

Sybren A. Stüvel (sybren) lowered the priority of this task from 90 to 50.EditedAug 6 2019, 5:20 PM

Confirmed on Blender 88a872dd6eac10e99afbd18243d39be68921642a. It has to do with the baking range, because when I change the scene end frame from 20 to 21, bake the particles, reset the scene end frame to 20, and render, it's fine.

I'm leaving this for a developer with more knowledge of the particle system. My findings so far:

  • There seems to be a relation between the described problem and what is saved on disk when enabling disk caching. When using a scene frame range 1-5, in 2.79 there are files xxx_000000_00.bphys to xxx_000005_00.bphys. In 2.80 that first file with zero index is missing.
  • BKE_ptcache_bake(): in 2.79 pid->totpoint(pid->calldata, 0) returns the number of particles; in 2.80 this returns 0.
  • BKE_ptcache_write(): same as above, resulting in cfra=0 not being written, which means that the 'info' data in the particle cache isn't written.
  • Forcing pid->totpoint(pid->calldata, cfra) to return 1000 (by hard-coding psys->totpart = 1000) fixes the reported problem, as well as causes the zero-index bphys file to be written.

I've managed to get the correct number of particles by applying the following patch.

diff --git a/source/blender/editors/physics/physics_pointcache.c b/source/blender/editors/physics/physics_pointcache.c
index bc2f1d6cef6..d68f076bb2c 100644
--- a/source/blender/editors/physics/physics_pointcache.c
+++ b/source/blender/editors/physics/physics_pointcache.c
@@ -38,6 +38,7 @@
 #include "BKE_pointcache.h"
 
 #include "DEG_depsgraph.h"
+#include "DEG_depsgraph_query.h"
 
 #include "ED_particle.h"
 
@@ -165,7 +166,7 @@ static PTCacheBaker *ptcache_baker_create(bContext *C, wmOperator *op, bool all)
 
   if (!all) {
     PointerRNA ptr = CTX_data_pointer_get_type(C, "point_cache", &RNA_PointCache);
-    Object *ob = ptr.id.data;
+    Object *ob = DEG_get_evaluated_object(baker->depsgraph, ptr.id.data);
     PointCache *cache = ptr.data;
     baker->pid = BKE_ptcache_id_find(ob, baker->scene, cache);
   }

This does fix the missing zero-index bphys file, but still doesn't solve the render issue.

I'm not sure but I guess, I've the same problem here in 2.81. The particles in the very last frame of my animation will not be rendered.
All frames before the last frame are rendered, when I bake them and save them within the blend file.

My only solution to render the very last particle frame is to cache the particles to disk, but in this case I'm not able to render it on a renderfarm like Renderstreet e.g.

I've read the manual, and found this:

The simulation is only calculated for positive frames in between the Start and End frames of the Cache panel, whether you bake or not. So if you want a simulation that is longer than the default frame range, you have to change the End frame.

My overall frame range is 1-60.
When I bake the particles for the complete frame range, then frame 60 has no particles.
Is this a bug? When I bake from 1-62 then all is fine and frame 60 has particles. If I use frame 61 as end frame, then it doesn't work.

Because the manual says positive frames only are calculated. Is frame 60 in my animation not a positive frame number?
Sorry if I spam this thread. I can create a new task if my problem is a different topic.

Jeroen Bakker (jbakker) changed the subtype of this task from "Report" to "Bug".Feb 4 2020, 11:49 AM

@mike (mikeblend) Can you check with older versions of Blender to see when this bug was introduced? If this also happened in 2.79, it's unlikely to be fixed (due to the particle system being marked end-of-life). More recent issues will be fixed. Once you figure out which version still worked, please attach a test file that we can open with that version, so that we can figure out more easily what exactly caused it.

@Sybren A. Stüvel (sybren)
I tested 2.79, A and B versions and no issues.
The issue appears in 2.80.
Attaching a new blend file, but the original still shows the issue as well,