Fix T80426: Crash when deleting custom orientation

Indices referencing other orientations were not being updated,
This commit is contained in:
Germano Cavalcante 2020-09-04 15:01:04 -03:00
parent 1767a7c986
commit e43d482cc9
Notes: blender-bot 2023-02-14 02:13:08 +01:00
Referenced by issue #80426, Crash when deleting custom orientation. And gizmo points wrong way.
Referenced by issue #80396, Potential candidates for corrective releases
Referenced by issue #77348, Blender LTS: Maintenance Task 2.83
1 changed files with 4 additions and 0 deletions

View File

@ -2424,6 +2424,10 @@ void BKE_scene_transform_orientation_remove(Scene *scene, TransformOrientation *
orient_slot->type = V3D_ORIENT_GLOBAL;
orient_slot->index_custom = -1;
}
else if (orient_slot->index_custom > orientation_index) {
BLI_assert(orient_slot->type == V3D_ORIENT_CUSTOM);
orient_slot->index_custom--;
}
}
BLI_freelinkN(&scene->transform_spaces, orientation);