2
* $Id: drawscene.c 14582 2008-04-28 00:40:38Z aligorith $
4
* ***** BEGIN GPL LICENSE BLOCK *****
6
* This program is free software; you can redistribute it and/or
7
* modify it under the terms of the GNU General Public License
8
* as published by the Free Software Foundation; either version 2
9
* of the License, or (at your option) any later version.
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with this program; if not, write to the Free Software Foundation,
18
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
21
* All rights reserved.
23
* The Original Code is: all of this file.
25
* Contributor(s): none yet.
27
* ***** END GPL LICENSE BLOCK *****
28
* drawing graphics and editing
33
#include "BLI_blenlib.h"
34
#include "BLI_arithb.h"
36
#include "DNA_scene_types.h"
37
#include "DNA_space_types.h"
38
#include "DNA_screen_types.h"
39
#include "DNA_userdef_types.h"
40
#include "DNA_view3d_types.h"
42
#include "BKE_global.h"
44
#include "BKE_scene.h"
46
#include "BDR_editobject.h"
47
#include "BDR_editface.h"
48
#include "BDR_sculptmode.h"
49
#include "BDR_vpaint.h"
51
#include "BIF_space.h"
52
#include "BIF_drawscene.h"
53
#include "BIF_editseq.h"
54
#include "BIF_poseobject.h"
60
#include "blendef.h" /* old */
67
void set_scene(Scene *sce) /* also see scene.c: set_scene_bg() */
71
/* ending all modes */
73
exit_editmode(EM_FREEDATA|EM_FREEUNDO|EM_WAITCURSOR);
81
sc= G.main->screen.first;
83
if((U.flag & USER_SCENEGLOBAL) || sc==G.curscreen) {
85
if(sce != sc->scene) {
86
/* all areas endlocalview */
87
ScrArea *sa= sc->areabase.first;
99
copy_view3d_lock(0); /* space.c */
101
/* are there cameras in the views that are not in the scene? */
102
sc= G.main->screen.first;
104
if( (U.flag & USER_SCENEGLOBAL) || sc==G.curscreen) {
105
ScrArea *sa= sc->areabase.first;
107
SpaceLink *sl= sa->spacedata.first;
109
if(sl->spacetype==SPACE_VIEW3D) {
110
View3D *v3d= (View3D*) sl;
111
if (!v3d->camera || !object_in_scene(v3d->camera, sce)) {
112
v3d->camera= scene_find_camera(sc->scene);
113
if (sc==G.curscreen) handle_view3d_lock();
114
if (!v3d->camera && v3d->persp==V3D_CAMOB) v3d->persp= V3D_PERSP;
125
set_scene_bg(G.scene);
126
scene_update_for_newframe(G.scene, G.scene->lay);
130
/* complete redraw */
131
allqueue(REDRAWALL, 0);
132
allqueue(REDRAWDATASELECT, 0); /* does a remake */