fix for another case where object editmode data could be lost when switching scenes.
authorCampbell Barton <ideasman42@gmail.com>
Fri, 23 Jul 2010 18:42:15 +0000 (18:42 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 23 Jul 2010 18:42:15 +0000 (18:42 +0000)
source/blender/blenkernel/intern/scene.c

index fe52375617b34f556831dbc2c68ddbbb201cfcaa..9d736bd92eb305233b5dfa3d0aab34f8af106341 100644 (file)
@@ -512,6 +512,10 @@ void set_scene_bg(Scene *scene)
        /* check for cyclic sets, for reading old files but also for definite security (py?) */
        scene_check_setscene(scene);
        
+       /* can happen when switching modes in other scenes */
+       if(scene->obedit && !(scene->obedit->mode & OB_MODE_EDIT))
+               scene->obedit= NULL;
+
        /* deselect objects (for dataselect) */
        for(ob= G.main->object.first; ob; ob= ob->id.next)
                ob->flag &= ~(SELECT|OB_FROMGROUP);