Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2018-11-16 16:21:57 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2018-11-16 16:22:35 +0300
commitbe405495a9cfd70b531d6ca41e3f4a7f1e0ae9be (patch)
tree8abdd6f8d8ca93e2f70b3f13fc7495ef4f31dfdb /source/blender/editors/physics
parentda344b4045ddf6265bedcae83db9d91d361f00c4 (diff)
Fix T57477: Switching between edit mode, and particle edit mode crashes
Diffstat (limited to 'source/blender/editors/physics')
-rw-r--r--source/blender/editors/physics/particle_edit.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/source/blender/editors/physics/particle_edit.c b/source/blender/editors/physics/particle_edit.c
index 457ff5be4de..09d3beadb2a 100644
--- a/source/blender/editors/physics/particle_edit.c
+++ b/source/blender/editors/physics/particle_edit.c
@@ -4829,10 +4829,18 @@ static int particle_edit_toggle_exec(bContext *C, wmOperator *op)
edit = PE_create_current(depsgraph, scene, ob);
- /* mesh may have changed since last entering editmode.
- * note, this may have run before if the edit data was just created, so could avoid this and speed up a little */
- if (edit && edit->psys)
+ /* Mesh may have changed since last entering editmode.
+ * note, this may have run before if the edit data was just created,
+ * so could avoid this and speed up a little. */
+ if (edit && edit->psys) {
+ /* Make sure pointer to the evaluated modifier data is up to date,
+ * with possible changes applied when object was outside of the
+ * edit mode. */
+ Object *object_eval = DEG_get_evaluated_object(depsgraph, ob);
+ edit->psmd_eval = (ParticleSystemModifierData *)modifiers_findByName(
+ object_eval, edit->psmd->modifier.name);
recalc_emitter_field(depsgraph, ob, edit->psys);
+ }
toggle_particle_cursor(C, 1);
WM_event_add_notifier(C, NC_SCENE | ND_MODE | NS_MODE_PARTICLE, NULL);