Guys, this is NOT the actual code change that should be commited and I haven't done a proper fix. This is just a dummy workaround and can be used for a reference so that you can see the problem more clearly. But I would like to ask you to investigate and to think of a proper solution.
The problem is that when we click 'Bake' button in particle system settings, particle system gets copied in depsgraph and the cache is copied as well. Progress bar is visible but the status is always '0 frames in memory'. After making some changes that should not make the cache outdated (for example applying different material to object) cache is destroyed.
In my workaround patch original cache is used in hair simulation instead of the copied one. It helps to preserve it during object changes and copying/freeing particle system. Also status shows the actual number of frames in memory.
And here's how I think it should work (tried to make it myself but I've got lost in the code):
- When pressing the button and getting original cache from context, the copied cache should be found somehow and used in baking (this will fix status visible to users)
- After depsgraph evaluation the copied cache should be copied to the original particle system (and it applies not to the hair as in my patch, but for particle systems in general)
I understand you've got a lot of work to do, but maybe my message and reference diff can help you somehow to look closely at this problem. Thank you!