Page MenuHome

Fix T68645: Hair Particle Edit - Particle Mirror crash when children are visible in the viewport
Needs ReviewPublic

Authored by Philipp Oeser (lichtwerk) on Wed, Sep 11, 1:47 PM.



seems to be an issue of not correctly freeing the PTCacheEdit (see
T68645 for details), quick and dirty fix would be to free the path cache
early and let everything be done from scratch? Or when the DEG updates,
let 'psys_cache_paths' free the paths on the original edit?

Diff Detail

rB Blender
T68645 (branched from master)
Build Status
Buildable 4918
Build 4918: arc lint + arc unit

Event Timeline

From reading i don't see this is necessarily a threading issue, more like some missing update tag or so? Maybe need to do ID_RECALC_PSYS_RESET or ID_RECALC_PSYS_CHILD ?

couple of notes:

  • not a threading issue probably, agree
  • cant get it to work with suggested ID_RECAL flags
  • specifically calling psys_free_path_cache(NULL, edit) is also used by ADD and CUT brush, also done by shape_cut_exec

For the depsgraph side of things:

  • I can see psys_free is called alongside deg_evaluate_copy_on_write:
  • this calls psys_free_path_cache(psys, NULL), so only frees the ParticleSystem pathcache, but not the PTCacheEdit pathcache, hm...
  • a bit later we reach particle_system_update (this gets called, too) > hair_step > psys_update_path_cache > psys_cache_paths
  • this calls psys_free_path_cache(psys, psys->edit) (this should free both ParticleSystem and PTCacheEdit pathcache-- hooray!), but psys->edit is actually NULL here, hm...
  • reminds me of D5758: PTCacheEdit does not live on evaluated object... so will update the diff to use psys_orig_edit_getin that place...
  • if we go with the second suggestion, I can also check for ADD and CUT brush as well as shape_cut_exec (if their usage of psys_free_path_cache(NULL, edit) is obsolete...)
  • particle code still make me a little dizzy, so not sure if I can be of more help here :)
  • I know the old psys is not fun to look at, and is EOL, but I still think we should fix some stuff that is just broken in 2.8 compared to 2.79...

another suggestion regarding the path cache freeing