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
This commit is contained in:
Philipp Oeser 2020-09-18 13:52:26 +02:00
parent a5dccd3320
commit df126861b2
Notes: blender-bot 2023-02-14 06:00:51 +01:00
Referenced by issue #80900, Crash lasso-selecting hair particles in Cloth or Softbody Editing Type
1 changed files with 2 additions and 2 deletions

View File

@ -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(