Baked particles dont render in final frame #68290

Closed
opened 2019-08-06 07:29:53 +02:00 by mike · 24 comments

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: f6cb5f5449
Worked: 2.79b

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. bug particle 280.blend
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:
Bug test particles.blend

**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: `f6cb5f5449` Worked: 2.79b **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. [bug particle 280.blend](https://archive.blender.org/developer/F8392636/bug_particle_280.blend) 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: [Bug test particles.blend](https://archive.blender.org/developer/F7651203/Bug_test_particles.blend)
Author

Added subscriber: @kosblend

Added subscriber: @kosblend

#95583 was marked as duplicate of this issue

#95583 was marked as duplicate of this issue

#81253 was marked as duplicate of this issue

#81253 was marked as duplicate of this issue

#97114 was marked as duplicate of this issue

#97114 was marked as duplicate of this issue

Added subscriber: @dr.sybren

Added subscriber: @dr.sybren

Confirmed on Blender 88a872dd6e. 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.

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.
Sybren A. Stüvel self-assigned this 2019-08-07 09:59:31 +02:00
Sybren A. Stüvel removed their assignment 2019-08-08 17:10:21 +02:00

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 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.

Added subscriber: @ChristophWerner

Added subscriber: @ChristophWerner

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'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.

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.

@kosblend 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.

@kosblend 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.
Author

@dr.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,
bug particle 280.blend

@dr.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, [bug particle 280.blend](https://archive.blender.org/developer/F8392636/bug_particle_280.blend)

Added subscriber: @SteffenD

Added subscriber: @SteffenD

Added subscriber: @rbtn

Added subscriber: @rbtn

I have the same issue on blender 2.93.0 Alpha... This is pretty annoying. I hope someone fixes this.

I have the same issue on blender 2.93.0 Alpha... This is pretty annoying. I hope someone fixes this.

Actually I'm noticing inconsistent results... I baked my particles and they didn't appear on my last frame (frame 100). I think deleted the bake and re-baked it and they showed up... Whenever I do the trick where I make my animation 1-101 frames and bake, then set back to 1-100 -> it also works consistently...

I hope this gets fixed so we don't need to keep changing our frame count or rebaking over and over until it appears.

Actually I'm noticing inconsistent results... I baked my particles and they didn't appear on my last frame (frame 100). I think deleted the bake and re-baked it and they showed up... Whenever I do the trick where I make my animation 1-101 frames and bake, then set back to 1-100 -> it also works consistently... I hope this gets fixed so we don't need to keep changing our frame count or rebaking over and over until it appears.
Member

Added subscriber: @lichtwerk

Added subscriber: @lichtwerk
Member

Possible duplicates (or at least closely related):

  • #81253 (Particle cache misses last frame)
  • #68436 (External Particle Cache Playback Is Broken (2.8))
  • #86865 (Baking particle system loose 0)
Possible duplicates (or at least closely related): - #81253 (Particle cache misses last frame) - #68436 (External Particle Cache Playback Is Broken (2.8)) - #86865 (Baking particle system loose 0)
Member

Added subscribers: @Jannes-Nagel, @PratikPB2123

Added subscribers: @Jannes-Nagel, @PratikPB2123

Added subscriber: @mano-wii

Added subscriber: @mano-wii

This issue was referenced by d0bcb6efea

This issue was referenced by d0bcb6efead49a269d3b9b6f29ef07f5241fa137

This issue was referenced by 405bff7fd8

This issue was referenced by 405bff7fd8ed5df8d44a1362763fac7c00e2060b

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Campbell Barton self-assigned this 2022-04-14 08:58:43 +02:00
Member

Added subscribers: @Jadon-3, @OmarEmaraDev

Added subscribers: @Jadon-3, @OmarEmaraDev
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
9 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#68290
No description provided.