[Bf-blender-cvs] [df126861b25] master: Fix T80900: Crash lasso-selecting in particle editmode in certain situations

Philipp Oeser noreply at git.blender.org
Fri Sep 18 14:25:46 CEST 2020


Commit: df126861b25a51baf7d5eaea732a1e61b863af83
Author: Philipp Oeser
Date:   Fri Sep 18 13:52:26 2020 +0200
Branches: master
https://developer.blender.org/rBdf126861b25a51baf7d5eaea732a1e61b863af83

Fix T80900: Crash lasso-selecting in particle editmode in certain
situations

In the situation that the PTCacheEdit is not available (e.g. when
editing unbaked Cloth or Softbody caches - or, as in the report, being
in Cloth or Softbody Editing Type for Hair particles), accesing the
corresponding ParticleSystem or ParticleSystemModifierData would crash.

Now access these later (after PE_start_edit had the chance to return
early on this non-valid situation).

Reviewers: JacquesLucke

Maniphest Tasks: T80900

Differential Revision: https://developer.blender.org/D8941

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

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 b403863f28b..65d83b5a776 100644
--- a/source/blender/editors/physics/particle_edit.c
+++ b/source/blender/editors/physics/particle_edit.c
@@ -2254,8 +2254,6 @@ int PE_lasso_select(bContext *C, const int mcoords[][2], const int mcoords_len,
   ARegion *region = CTX_wm_region(C);
   ParticleEditSettings *pset = PE_settings(scene);
   PTCacheEdit *edit = PE_get_current(depsgraph, scene, ob);
-  ParticleSystem *psys = edit->psys;
-  ParticleSystemModifierData *psmd_eval = edit->psmd_eval;
   POINT_P;
   KEY_K;
   float co[3], mat[4][4];
@@ -2276,6 +2274,8 @@ int PE_lasso_select(bContext *C, const int mcoords[][2], const int mcoords_len,
     data.is_changed |= PE_deselect_all_visible_ex(edit);
   }
 
+  ParticleSystem *psys = edit->psys;
+  ParticleSystemModifierData *psmd_eval = edit->psmd_eval;
   LOOP_VISIBLE_POINTS {
     if (edit->psys && !(psys->flag & PSYS_GLOBAL_HAIR)) {
       psys_mat_hair_to_global(



More information about the Bf-blender-cvs mailing list