diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-01-31 18:53:19 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-01-31 18:53:19 +0300 |
commit | d2f3378249902cdc093c54c41afb1b48ae8357c3 (patch) | |
tree | 411ef779ae0d71b0ff54f33c7a713eb5e00f9a3e /source/blender/editors | |
parent | 0d2b977c3b1d0c382a9ba09bead5289d387bda33 (diff) |
Fix T59339: Particle render without baking issues
The issue was caused by dependency graph resetting particles
when evaluating copy-on-write version of object. Solved by
only doing reset from dependency graph on user edits.
Other issue was caused by modifier itself trying to compare
topology and reset particles when number of vertices or faces
changed. This isn't reliable, since topology might change even
with same number of elements. But also, since copy-on-written
object initially always have those fields zero-ed the reset
was happening on every F12.
The latter issue is solved by moving reset from modifier stack
to places where we exit edit/paint modes which might be changing
topology.
There is still weird issue of particles generated at some
weird location after tapping tab twice, but this is not a new
issue in 2.8 branch and is to be looked separately.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/object/object_edit.c | 2 | ||||
-rw-r--r-- | source/blender/editors/sculpt_paint/sculpt.c | 5 |
2 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index dff78d15692..958d9c08814 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -78,6 +78,7 @@ #include "BKE_modifier.h" #include "BKE_object.h" #include "BKE_paint.h" +#include "BKE_particle.h" #include "BKE_pointcache.h" #include "BKE_softbody.h" #include "BKE_editmesh.h" @@ -537,6 +538,7 @@ bool ED_object_editmode_exit_ex(Main *bmain, Scene *scene, Object *obedit, int f } BLI_freelistN(&pidlist); + BKE_particlesystem_reset_all(obedit); BKE_ptcache_object_reset(scene, obedit, PTCACHE_RESET_OUTDATED); /* also flush ob recalc, doesn't take much overhead, but used for particles */ diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index d7ecfadcfc5..f3a06988f1b 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -67,7 +67,9 @@ #include "BKE_node.h" #include "BKE_object.h" #include "BKE_paint.h" +#include "BKE_particle.h" #include "BKE_pbvh.h" +#include "BKE_pointcache.h" #include "BKE_report.h" #include "BKE_screen.h" #include "BKE_subsurf.h" @@ -5569,6 +5571,9 @@ void sculpt_dynamic_topology_disable_ex( ss->bm_log = NULL; } + BKE_particlesystem_reset_all(ob); + BKE_ptcache_object_reset(scene, ob, PTCACHE_RESET_OUTDATED); + /* Refresh */ sculpt_update_after_dynamic_topology_toggle(depsgraph, scene, ob); } |