diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-11-22 13:10:26 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-11-22 13:10:26 +0400 |
commit | d44c79b7c93fb8c6525b79fa4b57548334185bbf (patch) | |
tree | ad65a8318b8b5f8becde0639856a77740c3dcaed /source/blender | |
parent | 283f43d31a602c88e4dd7123973689cca84b3f7f (diff) |
Fix T37281: View3D could have invalid transform orientation using undo
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index ddb045de290..3428e52ca4e 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -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; |