[Bf-blender-cvs] [d44c79b] master: Fix T37281: View3D could have invalid transform orientation using undo

Campbell Barton noreply at git.blender.org
Fri Nov 22 10:12:50 CET 2013


Commit: d44c79b7c93fb8c6525b79fa4b57548334185bbf
Author: Campbell Barton
Date:   Fri Nov 22 20:10:26 2013 +1100
http://developer.blender.org/rBd44c79b7c93fb8c6525b79fa4b57548334185bbf

Fix T37281: View3D could have invalid transform orientation using undo

===================================================================

M	source/blender/blenloader/intern/readfile.c

===================================================================

diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index ddb045d..3428e52 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;




More information about the Bf-blender-cvs mailing list