[Bf-blender-cvs] [6f087be9f97] master: Fix T63590: Blender crashes when deleting particle hair keys

Sergey Sharybin noreply at git.blender.org
Thu Apr 18 14:43:48 CEST 2019


Commit: 6f087be9f97d6e4b8637b297322438cf23491cae
Author: Sergey Sharybin
Date:   Thu Apr 18 14:43:25 2019 +0200
Branches: master
https://developer.blender.org/rB6f087be9f97d6e4b8637b297322438cf23491cae

Fix T63590: Blender crashes when deleting particle hair keys

===================================================================

M	source/blender/editors/physics/particle_edit.c

===================================================================

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) {



More information about the Bf-blender-cvs mailing list