Fix T63590: Blender crashes when deleting particle hair keys
This commit is contained in:
parent
5cfeba72f1
commit
6f087be9f9
Notes:
blender-bot
2023-02-14 04:39:18 +01:00
Referenced by issue #63590, Blender crashes when deleting particle hair keys
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue