Fix T37281: View3D could have invalid transform orientation using undo

This commit is contained in:
Campbell Barton 2013-11-22 20:10:26 +11:00
parent 283f43d31a
commit d44c79b7c9
Notes: blender-bot 2023-02-14 11:39:15 +01:00
Referenced by issue #37281, Visual 3D View Bug due to Undo and seemly missing User Transform Orientation
1 changed files with 8 additions and 0 deletions

View File

@ -5936,6 +5936,14 @@ void blo_lib_link_screen_restore(Main *newmain, bScreen *curscreen, Scene *cursc
/* not very nice, but could help */
if ((v3d->layact & v3d->lay) == 0) v3d->layact = v3d->lay;
/* its possible the current transform orientation has been removed */
if (v3d->twmode >= V3D_MANIP_CUSTOM) {
const int selected_index = (v3d->twmode - V3D_MANIP_CUSTOM);
if (!BLI_findlink(&sc->scene->transform_spaces, selected_index)) {
v3d->twmode = V3D_MANIP_GLOBAL;
}
}
/* free render engines for now */
for (ar = sa->regionbase.first; ar; ar = ar->next) {
RegionView3D *rv3d= ar->regiondata;