Bake All Dynamics not baking hair particles #70642

Closed
opened 2019-10-08 15:44:13 +02:00 by Benoit Alexis · 12 comments

System Information
Operating system: Windows-10-10.0.18362 64 Bits
Graphics card: GeForce RTX 2080 Ti/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 431.60
CPU : Intel i9-9900K

Blender Version
Broken: version: 2.81 (sub 14), branch: master, commit date: 2019-10-07 20:16, hash: a856c5eccf
Worked: (optional)

Short description of error
When working with multiple particle emitters on a same object, The Bake All Dynamics button doesn't bake anything (when the particles are hair). I had the problem with 2.80 and checked with 2.81 if this was addressed but apparently not.
It is not very efficient to have to go through every particle system in the scene and bake them individually.
Especially since baking individually will only use one CPU core.
Perhaps a solution could be to start launching individual blender instances for every particle system ? This way it would make use of multiple cores. It is sad to see my cpu maxing out at 12% when baking a hair sim, while the other 7 cores are sitting idle…
If for some technical reason All Hair Dynamics cannot be baked with a single click, maybe gray out the Bake All Dynamics Button while in "hair" mode ? It would save a lot of people some time searching why this doesn't work...

Exact steps for others to reproduce the error
Just add a particle system, switch to hair instead of emitter, and Bake All Dynamics will do nothing.

BakeAllDynamics.blend

**System Information** Operating system: Windows-10-10.0.18362 64 Bits Graphics card: GeForce RTX 2080 Ti/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 431.60 CPU : Intel i9-9900K **Blender Version** Broken: version: 2.81 (sub 14), branch: master, commit date: 2019-10-07 20:16, hash: `a856c5eccf` Worked: (optional) **Short description of error** When working with multiple particle emitters on a same object, The Bake All Dynamics button doesn't bake anything (when the particles are hair). I had the problem with 2.80 and checked with 2.81 if this was addressed but apparently not. It is not very efficient to have to go through every particle system in the scene and bake them individually. Especially since baking individually will only use one CPU core. Perhaps a solution could be to start launching individual blender instances for every particle system ? This way it would make use of multiple cores. It is sad to see my cpu maxing out at 12% when baking a hair sim, while the other 7 cores are sitting idle… If for some technical reason All Hair Dynamics cannot be baked with a single click, maybe gray out the Bake All Dynamics Button while in "hair" mode ? It would save a lot of people some time searching why this doesn't work... **Exact steps for others to reproduce the error** Just add a particle system, switch to hair instead of emitter, and Bake All Dynamics will do nothing. [BakeAllDynamics.blend](https://archive.blender.org/developer/F7796695/BakeAllDynamics.blend)
Author

Added subscriber: @BenoitAlexis

Added subscriber: @BenoitAlexis
Member

Added subscriber: @lichtwerk

Added subscriber: @lichtwerk
Member

Some first notes (without diving deeper)

Afaics, if you are going for multiple hair systems on a single object, Bake [instead Bake All Dynamics] will bake multiple hair systems (on that single object) at once (no need to do them separately)

  • 2.79 is the same here
  • there seems to be a bug though [specific to this file?] (in that if you leave both cache names empty, one hair system will just vanish after frame one)
  • that bug can be worked around by writing a separate cache file for each hair system (just name the caches differently...), those still contain both systems [if written to disk they are the same size]
  • one can also see that by doing a disk cache in this file [you dont get indices anymore -- _00 vs _01]
  • I think I managed to reproduce from a fresh file: if you are caching to disk first (all fine, two hair systems get _00 and _01), then cache to memory (disable Disk Cache), then cache to disk again (enable Disk Cache) --> (bug, two hair systems dont _00 and _01)... needs further investigation...

Now if you are using Bake All Dynamics:

#62563, #62893 might be related

Some first notes (without diving deeper) Afaics, if you are going for multiple hair systems on a single object, `Bake` [instead `Bake All Dynamics`] will bake multiple hair systems (on that single object) at once (no need to do them separately) - 2.79 is the same here - there seems to be a bug though [specific to this file?] (in that if you leave both cache names empty, one hair system will just vanish after frame one) - that bug can be worked around by writing a separate cache file for each hair system (just name the caches differently...), those still contain both systems [if written to disk they are the same size] - one can also see that by doing a disk cache in this file [you dont get indices anymore -- _00 vs _01] - I think I managed to reproduce from a fresh file: if you are caching to disk first (all fine, two hair systems get `_00` and `_01`), then cache to memory (disable `Disk Cache`), then cache to disk again (enable `Disk Cache`) --> (bug, two hair systems dont `_00` and `_01`)... needs further investigation... Now if you are using `Bake All Dynamics`: - hair (and keyed particles) are ommitted (on purpose?), see https://developer.blender.org/diffusion/B/browse/master/source/blender/blenkernel/intern/pointcache.c$4053 - needs further investigation as well #62563, #62893 *might* be related

Added subscriber: @grosgood

Added subscriber: @grosgood

When working with multiple particle emitters on a same object, The Bake All Dynamics button doesn't bake anything (when the particles are hair)...

Shades of #53083 perhaps?

> When working with multiple particle emitters on a same object, The Bake All Dynamics button doesn't bake anything (when the particles are hair)... Shades of #53083 perhaps?
Author

Thanks for your reply. I've made some further investigating. I did notice what you suggested about two systems on a single object being baked simultaneously.
It is true when Disk Cache is enabled for both systems, and no name is given to the cache. When I bake only one, I see in the cache folder that two sets of .bphys are created for each frame. Named ###_00.bphys and ###_01.bphys

In the viewport the playback is good. However, as soon as I click on the second system, all the ###_01.bphys vanish, and the cache for this system disappears, stating "0 frames on disk, cache is outdated. And then the viewport is laggy as it caches the simulation of the second system again.

If I rename both caches to "Sys1" and "Sys2", the same thing happens. I do get both systems cached in the folder with the right names : "Sys1_#####00.bphys" and "Sys2#######_01.bphys", but as soon as I click on the other system, its cache is deleted from the folder. The order doesn't matter. First or second system baked first, the other's cache is later discarded.

Clicking "Current Cache to Bake" after baking "one" of the system does not solve this.

Thankfully, if I manually bake both systems individually the cache stays permenantly. But it is a tedious

Thanks for your reply. I've made some further investigating. I did notice what you suggested about two systems on a single object being baked simultaneously. It is true when Disk Cache is enabled for both systems, and no name is given to the cache. When I bake only one, I see in the cache folder that two sets of .bphys are created for each frame. Named ###_00.bphys and ###_01.bphys In the viewport the playback is good. However, as soon as I click on the second system, all the ###_01.bphys vanish, and the cache for this system disappears, stating "0 frames on disk, cache is outdated. And then the viewport is laggy as it caches the simulation of the second system again. If I rename both caches to "Sys1" and "Sys2", the same thing happens. I do get both systems cached in the folder with the right names : "Sys1_#####_00.bphys" and "Sys2_#######_01.bphys", but as soon as I click on the other system, its cache is deleted from the folder. The order doesn't matter. First or second system baked first, the other's cache is later discarded. Clicking "Current Cache to Bake" after baking "one" of the system does not solve this. Thankfully, if I manually bake both systems individually the cache stays permenantly. But it is a tedious
Member

Sorry to say that PointCaches are pretty new to me (just wrapping my head around this now)

I can also confirm that switching to the other particle system will delete the .bphys from disk, that needs to be investigated further.
For me though, giving them different names solves this, I can then select the other particle without loosing the .bphys

What I did find in a specific situation [regarding the case when blender only writes to _00 (instead of _00 and _01)] was:

  • ParticleSettings has a pid->cache->index of 0
  • ParticleSettings.001 has a pid->cache->index of -1 [ in that case ptcache_filename calls BKE_object_insert_ptcache but the list of ob->pc_ids is empty?, we are not incrementing and eventually we end up with the _00 extension twice :( ]

Aand, we still have the case where where hair (and keyed particles) are ommitted (on purpose?) for Bake All Dynamics (relating to #53083).
Stay tuned.

Sorry to say that PointCaches are pretty new to me (just wrapping my head around this now) I can also confirm that switching to the other particle system will delete the .bphys from disk, that needs to be investigated further. For me though, giving them different names solves this, I can then select the other particle without loosing the .bphys What I did find in a specific situation [regarding the case when blender only writes to **_00** (instead of **_00** and **_01**)] was: - `ParticleSettings` has a pid->cache->index of 0 - `ParticleSettings.001` has a pid->cache->index of -1 [ in that case `ptcache_filename` calls `BKE_object_insert_ptcache` but the list of `ob->pc_ids` is empty?, we are not incrementing and eventually we end up with the `_00` extension twice :( ] Aand, we still have the case where where hair (and keyed particles) are ommitted (on purpose?) for `Bake All Dynamics` (relating to #53083). Stay tuned.
Member

FYI, the skipping of hair particles with Bake All Dynamics was introduced in 66918b3add.
On first sight, I dont see a particular reason to skip [tested non-skipping which seems to work], but this is ancient, so I guess this has never been considered a bug...

FYI, the skipping of hair particles with Bake All Dynamics was introduced in 66918b3add. On first sight, I dont see a particular reason to skip [tested non-skipping which seems to work], but this is ancient, so I guess this has never been considered a bug...
Member

I propose to split this report up:

  • the issue about Bake All Dynamics skipping hair particles is really a duplicate of #53083 and should be merged into that report [afraid this is not really abug in the end...]
  • the issue about the vanishing ###_01.bphys when selecting the other particle system is really a different issue and should be handled in a new, separate report [@BenoitAlexis: could you open a new report for this? Please also reference this report in the new report since there is already some information gathered here -- or just paste stuff from here into the new report... -- thx in advance!]
I propose to split this report up: - the issue about `Bake All Dynamics` skipping hair particles is really a duplicate of #53083 and should be merged into that report [afraid this is not really abug in the end...] - the issue about the vanishing ###_01.bphys when selecting the other particle system is really a different issue and should be handled in a new, separate report [@BenoitAlexis: could you open a new report for this? Please also reference this report in the new report since there is already some information gathered here -- or just paste stuff from here into the new report... -- thx in advance!]
Author

Thank you very much for your time ! here is the new report for the "vanishing cache" : #70696

Maybe the Bake All Dynamics issue is not really a bug since it was coded that way, but its behavior is really confusing for the user, and quite honestly it represents a lot of wasted time, I can't imagine how so few people have reported this so far. So should it be a feature request then ?

Thank you very much for your time ! here is the new report for the "vanishing cache" : #70696 Maybe the Bake All Dynamics issue is not really a bug since it was coded that way, but its behavior is really confusing for the user, and quite honestly it represents a lot of wasted time, I can't imagine how so few people have reported this so far. So should it be a feature request then ?
Member

In #70642#793120, @BenoitAlexis wrote:
Thank you very much for your time ! here is the new report for the "vanishing cache" : #70696

Maybe the Bake All Dynamics issue is not really a bug since it was coded that way, but its behavior is really confusing for the user, and quite honestly it represents a lot of wasted time, I can't imagine how so few people have reported this so far. So should it be a feature request then ?

Thx for the new report!
I will merge this report with #53083 then... [lets keep discussion about its status (bug? feature request?) in there... and yep, if find this unclear as well]

> In #70642#793120, @BenoitAlexis wrote: > Thank you very much for your time ! here is the new report for the "vanishing cache" : #70696 > > Maybe the Bake All Dynamics issue is not really a bug since it was coded that way, but its behavior is really confusing for the user, and quite honestly it represents a lot of wasted time, I can't imagine how so few people have reported this so far. So should it be a feature request then ? Thx for the new report! I will merge this report with #53083 then... [lets keep discussion about its status (bug? feature request?) in there... and yep, if find this unclear as well]
Member

Closed as duplicate of #53083

Closed as duplicate of #53083
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
3 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#70642
No description provided.