From 6f087be9f97d6e4b8637b297322438cf23491cae Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Thu, 18 Apr 2019 14:43:25 +0200 Subject: Fix T63590: Blender crashes when deleting particle hair keys --- source/blender/editors/physics/particle_edit.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'source') diff --git a/source/blender/editors/physics/particle_edit.c b/source/blender/editors/physics/particle_edit.c index d592bbd82b1..6f6f78fc321 100644 --- a/source/blender/editors/physics/particle_edit.c +++ b/source/blender/editors/physics/particle_edit.c @@ -2728,7 +2728,7 @@ static int remove_tagged_particles(Object *ob, ParticleSystem *psys, int mirror) return removed; } -static void remove_tagged_keys(Object *ob, ParticleSystem *psys) +static void remove_tagged_keys(Depsgraph *depsgraph, Object *ob, ParticleSystem *psys) { PTCacheEdit *edit = psys->edit; ParticleData *pa; @@ -2736,12 +2736,13 @@ static void remove_tagged_keys(Object *ob, ParticleSystem *psys) POINT_P; KEY_K; PTCacheEditKey *nkey, *new_keys; - ParticleSystemModifierData *psmd_eval; short new_totkey; if (pe_x_mirror(ob)) { /* mirror key tags */ - psmd_eval = psys_get_modifier(ob, psys); + ParticleSystemModifierData *psmd = psys_get_modifier(ob, psys); + ParticleSystemModifierData *psmd_eval = (ParticleSystemModifierData *)modifier_get_evaluated( + depsgraph, ob, &psmd->modifier); LOOP_POINTS { @@ -3187,7 +3188,7 @@ static int delete_exec(bContext *C, wmOperator *op) if (type == DEL_KEY) { foreach_selected_key(&data, set_delete_particle_key); - remove_tagged_keys(data.ob, data.edit->psys); + remove_tagged_keys(data.depsgraph, data.ob, data.edit->psys); recalc_lengths(data.edit); } else if (type == DEL_PARTICLE) { -- cgit v1.2.3