diff options
author | Philipp Oeser <info@graphics-engineer.com> | 2020-09-18 14:52:26 +0300 |
---|---|---|
committer | Philipp Oeser <info@graphics-engineer.com> | 2020-09-18 15:24:22 +0300 |
commit | df126861b25a51baf7d5eaea732a1e61b863af83 (patch) | |
tree | 1a7b39c7c443e9fe5ddbc3c19cc30e22d567976e | |
parent | a5dccd33201f2df7cb914426cd5f5f5ffd6f9e64 (diff) |
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
-rw-r--r-- | source/blender/editors/physics/particle_edit.c | 4 |
1 files changed, 2 insertions, 2 deletions
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( |