2007-12-24 18:27:28 +00:00
|
|
|
/**
|
|
|
|
* $Id:
|
|
|
|
*
|
|
|
|
* ***** BEGIN GPL LICENSE BLOCK *****
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software Foundation,
|
|
|
|
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*
|
|
|
|
* The Original Code is Copyright (C) 2007 Blender Foundation.
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* Contributor(s): Blender Foundation
|
|
|
|
*
|
|
|
|
* ***** END GPL LICENSE BLOCK *****
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
#include "MEM_guardedalloc.h"
|
|
|
|
#include "MEM_CacheLimiterC-Api.h"
|
|
|
|
|
|
|
|
#include "IMB_imbuf_types.h"
|
|
|
|
#include "IMB_imbuf.h"
|
|
|
|
|
|
|
|
#include "DNA_object_types.h"
|
|
|
|
#include "DNA_scene_types.h"
|
|
|
|
#include "DNA_sound_types.h"
|
|
|
|
#include "DNA_userdef_types.h"
|
|
|
|
#include "DNA_windowmanager_types.h"
|
|
|
|
|
|
|
|
#include "BKE_blender.h"
|
2008-12-18 02:56:48 +00:00
|
|
|
#include "BKE_context.h"
|
2007-12-24 18:27:28 +00:00
|
|
|
#include "BKE_curve.h"
|
|
|
|
#include "BKE_displist.h"
|
|
|
|
#include "BKE_DerivedMesh.h"
|
|
|
|
#include "BKE_font.h"
|
|
|
|
#include "BKE_global.h"
|
|
|
|
#include "BKE_library.h"
|
|
|
|
#include "BKE_mball.h"
|
2009-07-16 00:50:27 +00:00
|
|
|
#include "BKE_report.h"
|
2007-12-24 18:27:28 +00:00
|
|
|
#include "BKE_utildefines.h"
|
|
|
|
#include "BKE_packedFile.h"
|
|
|
|
|
|
|
|
#include "BLI_blenlib.h"
|
|
|
|
|
|
|
|
#include "RE_pipeline.h" /* RE_ free stuff */
|
|
|
|
|
2008-12-31 05:20:35 +00:00
|
|
|
#ifndef DISABLE_PYTHON
|
2007-12-24 18:27:28 +00:00
|
|
|
#include "BPY_extern.h"
|
2008-12-31 05:20:35 +00:00
|
|
|
#endif
|
2007-12-24 18:27:28 +00:00
|
|
|
|
|
|
|
#include "SYS_System.h"
|
|
|
|
|
2008-11-21 19:14:38 +00:00
|
|
|
#include "RNA_define.h"
|
|
|
|
|
2007-12-24 18:27:28 +00:00
|
|
|
#include "WM_api.h"
|
2008-01-01 15:53:38 +00:00
|
|
|
#include "WM_types.h"
|
2008-12-15 16:54:47 +00:00
|
|
|
|
|
|
|
#include "wm_cursors.h"
|
Lots of stuff; couldn't commit in parts because of refactor work.
* Changes in interface/ module
This commit brings back the way how buttons/menus work under control
of WM event system. The previous implementation extended usage of
handlers and operators in an interesting but confusing way. Better to
try it first according the design specs. :)
Most obviously:
- modal-handler operators are not stored anymore in regions/areas/windows.
such modal handlers own their operator, and should remove it themselves.
- removed code to move handlers from one queue to another.
(needs review with brecht!)
- WM fix: the API call to remove a modal handler got removed. This was a
dangerous thing anyway, and you should leave that to the event system.
Now, if a handler modal() call gets a cancel/finish return, it frees
itself in event system. WM_event_remove_modal_handler was a confusing
call anyway!
Todo:
- allow button-activate to refresh after using button
- re-enable arrow keys for menus
(do both after commit)
- review return values of operator callbacks in interface_ops.c
* Fixes in WM system
- Freeing areas/regions/windows, also on quit, now correctly closes
running modal handlers
- On starting a modal handler, the handler now stores previous area
and region context, so they send proper notifiers etc.
* Other fixes
- Area-split operator had bug, wrong minimal size checking. This
solves error when trying to split a very narrow area.
- removed DNA_USHORT_FIX from screen_types.h, gave warning
- operators didn't get ID name copied when activated, needed for
later re-use or saving.
2008-12-02 14:22:52 +00:00
|
|
|
#include "wm_event_system.h"
|
2007-12-24 18:27:28 +00:00
|
|
|
#include "wm.h"
|
|
|
|
#include "wm_files.h"
|
|
|
|
#include "wm_window.h"
|
|
|
|
|
2009-03-22 00:30:18 +00:00
|
|
|
#include "ED_armature.h"
|
2009-03-31 22:36:13 +00:00
|
|
|
#include "ED_keyframing.h"
|
2009-01-27 17:12:40 +00:00
|
|
|
#include "ED_node.h"
|
2.5
Added WM Jobs manager
- WM can manage threaded jobs for you; just provide a couple
of components to get it work:
- customdata, free callback for it
- timer step, notifier code
- start callback, update callback
- Once started, each job runs an own timer, and will for
every time step check necessary updates, or close the
job when ready.
- No drawing happens in jobs, that's for notifiers!
- Every job stores an owner pointer, and based on this owner
it will prevent multiple jobs to enter the stack.
Instead it will re-use a running job, signal it to stop
and allow caller to re-initialize it even.
- Check new wm_jobs.c for more explanation. Jobs API is still
under construction.
Fun: BLI_addtail(&wm->jobs, steve); :)
Put Node shader previews back using wmJobs
- Preview calculating is now fully threaded (1 thread still)
- Thanks to new event system + notifiers, you can see
previews update even while dragging sliders!
- Currently it only starts when you change a node setting.
Warning: the thread render shares Node data, so don't delete
nodes while it renders! This topic is on the todo to make safe.
Also:
- bug in region initialize (do_versions) showed channel list in
node editor wrong.
- flagged the channel list 'hidden' now, it was really in the
way! This is for later to work on anyway.
- recoded Render API callbacks so it gets handlers passed on,
no globals to use anymore, remember?
- previewrender code gets now so much nicer! Will remove a lot
of stuff from code soon.
2009-01-22 14:59:49 +00:00
|
|
|
#include "ED_previewrender.h"
|
2009-01-06 18:14:37 +00:00
|
|
|
#include "ED_space_api.h"
|
2008-01-07 18:03:41 +00:00
|
|
|
#include "ED_screen.h"
|
2008-12-31 17:11:42 +00:00
|
|
|
#include "ED_util.h"
|
2008-01-07 18:03:41 +00:00
|
|
|
|
2008-12-19 12:14:58 +00:00
|
|
|
#include "UI_interface.h"
|
2009-01-29 05:19:27 +00:00
|
|
|
#include "BLF_api.h"
|
2008-12-19 12:14:58 +00:00
|
|
|
|
|
|
|
#include "GPU_extensions.h"
|
|
|
|
#include "GPU_draw.h"
|
|
|
|
|
|
|
|
|
2007-12-24 18:27:28 +00:00
|
|
|
|
|
|
|
/* XXX */
|
|
|
|
static void sound_init_listener(void)
|
|
|
|
{
|
|
|
|
G.listener = MEM_callocN(sizeof(bSoundListener), "soundlistener");
|
|
|
|
G.listener->gain = 1.0;
|
|
|
|
G.listener->dopplerfactor = 1.0;
|
|
|
|
G.listener->dopplervelocity = 340.29f;
|
|
|
|
}
|
|
|
|
|
2009-07-16 00:50:27 +00:00
|
|
|
|
|
|
|
static void wm_init_reports(bContext *C)
|
|
|
|
{
|
2009-07-16 22:47:27 +00:00
|
|
|
BKE_reports_init(CTX_wm_reports(C), RPT_STORE);
|
2009-07-16 00:50:27 +00:00
|
|
|
}
|
|
|
|
static void wm_free_reports(bContext *C)
|
|
|
|
{
|
2009-07-16 22:47:27 +00:00
|
|
|
BKE_reports_clear(CTX_wm_reports(C));
|
2009-07-16 00:50:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-12-24 18:27:28 +00:00
|
|
|
/* only called once, for startup */
|
|
|
|
void WM_init(bContext *C)
|
|
|
|
{
|
|
|
|
|
|
|
|
wm_ghost_init(C); /* note: it assigns C to ghost! */
|
2008-12-15 16:54:47 +00:00
|
|
|
wm_init_cursor_data();
|
2007-12-24 18:27:28 +00:00
|
|
|
wm_operatortype_init();
|
|
|
|
|
|
|
|
set_free_windowmanager_cb(wm_close_and_free); /* library.c */
|
2008-12-30 13:16:14 +00:00
|
|
|
set_blender_test_break_cb(wm_window_testbreak); /* blender.c */
|
|
|
|
|
2009-01-27 17:12:40 +00:00
|
|
|
ED_spacetypes_init(); /* editors/space_api/spacetype.c */
|
|
|
|
|
|
|
|
ED_file_init(); /* for fsmenu */
|
|
|
|
ED_init_node_butfuncs();
|
2009-01-06 14:42:54 +00:00
|
|
|
|
2009-05-05 23:10:32 +00:00
|
|
|
BLF_init(11, U.dpi);
|
2009-02-18 13:29:54 +00:00
|
|
|
BLF_lang_init();
|
|
|
|
|
2009-03-31 22:36:13 +00:00
|
|
|
init_builtin_keyingsets(); /* editors/animation/keyframing.c */
|
|
|
|
|
2007-12-24 18:27:28 +00:00
|
|
|
/* get the default database, plus a wm */
|
2009-02-07 10:00:46 +00:00
|
|
|
WM_read_homefile(C, NULL);
|
2007-12-24 18:27:28 +00:00
|
|
|
|
2009-07-16 00:50:27 +00:00
|
|
|
wm_init_reports(C); /* reports cant be initialized before the wm */
|
|
|
|
|
2009-01-23 17:42:36 +00:00
|
|
|
UI_init();
|
|
|
|
|
|
|
|
// clear_matcopybuf(); /* XXX */
|
|
|
|
|
|
|
|
// glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
|
2007-12-24 18:27:28 +00:00
|
|
|
|
|
|
|
sound_init_listener();
|
|
|
|
// init_node_butfuncs();
|
|
|
|
|
2.5
Added WM Jobs manager
- WM can manage threaded jobs for you; just provide a couple
of components to get it work:
- customdata, free callback for it
- timer step, notifier code
- start callback, update callback
- Once started, each job runs an own timer, and will for
every time step check necessary updates, or close the
job when ready.
- No drawing happens in jobs, that's for notifiers!
- Every job stores an owner pointer, and based on this owner
it will prevent multiple jobs to enter the stack.
Instead it will re-use a running job, signal it to stop
and allow caller to re-initialize it even.
- Check new wm_jobs.c for more explanation. Jobs API is still
under construction.
Fun: BLI_addtail(&wm->jobs, steve); :)
Put Node shader previews back using wmJobs
- Preview calculating is now fully threaded (1 thread still)
- Thanks to new event system + notifiers, you can see
previews update even while dragging sliders!
- Currently it only starts when you change a node setting.
Warning: the thread render shares Node data, so don't delete
nodes while it renders! This topic is on the todo to make safe.
Also:
- bug in region initialize (do_versions) showed channel list in
node editor wrong.
- flagged the channel list 'hidden' now, it was really in the
way! This is for later to work on anyway.
- recoded Render API callbacks so it gets handlers passed on,
no globals to use anymore, remember?
- previewrender code gets now so much nicer! Will remove a lot
of stuff from code soon.
2009-01-22 14:59:49 +00:00
|
|
|
ED_preview_init_dbase();
|
2007-12-24 18:27:28 +00:00
|
|
|
|
2008-12-19 12:14:58 +00:00
|
|
|
GPU_extensions_init();
|
|
|
|
|
2008-12-20 12:36:14 +00:00
|
|
|
G.ndofdevice = -1; /* XXX bad initializer, needs set otherwise buttons show! */
|
|
|
|
|
2007-12-24 18:27:28 +00:00
|
|
|
read_Blog();
|
|
|
|
BLI_strncpy(G.lib, G.sce, FILE_MAX);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* free strings of open recent files */
|
|
|
|
static void free_openrecent(void)
|
|
|
|
{
|
|
|
|
struct RecentFile *recent;
|
|
|
|
|
|
|
|
for(recent = G.recent_files.first; recent; recent=recent->next)
|
|
|
|
MEM_freeN(recent->filename);
|
|
|
|
|
|
|
|
BLI_freelistN(&(G.recent_files));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* bad stuff*/
|
|
|
|
|
|
|
|
extern ListBase editelems;
|
|
|
|
extern wchar_t *copybuf;
|
|
|
|
extern wchar_t *copybufinfo;
|
|
|
|
|
2008-12-29 11:04:55 +00:00
|
|
|
// XXX copy/paste buffer stuff...
|
2009-02-24 11:18:24 +00:00
|
|
|
extern void free_anim_copybuf();
|
2008-12-29 11:04:55 +00:00
|
|
|
|
2007-12-24 18:27:28 +00:00
|
|
|
/* called in creator.c even... tsk, split this! */
|
|
|
|
void WM_exit(bContext *C)
|
|
|
|
{
|
Lots of stuff; couldn't commit in parts because of refactor work.
* Changes in interface/ module
This commit brings back the way how buttons/menus work under control
of WM event system. The previous implementation extended usage of
handlers and operators in an interesting but confusing way. Better to
try it first according the design specs. :)
Most obviously:
- modal-handler operators are not stored anymore in regions/areas/windows.
such modal handlers own their operator, and should remove it themselves.
- removed code to move handlers from one queue to another.
(needs review with brecht!)
- WM fix: the API call to remove a modal handler got removed. This was a
dangerous thing anyway, and you should leave that to the event system.
Now, if a handler modal() call gets a cancel/finish return, it frees
itself in event system. WM_event_remove_modal_handler was a confusing
call anyway!
Todo:
- allow button-activate to refresh after using button
- re-enable arrow keys for menus
(do both after commit)
- review return values of operator callbacks in interface_ops.c
* Fixes in WM system
- Freeing areas/regions/windows, also on quit, now correctly closes
running modal handlers
- On starting a modal handler, the handler now stores previous area
and region context, so they send proper notifiers etc.
* Other fixes
- Area-split operator had bug, wrong minimal size checking. This
solves error when trying to split a very narrow area.
- removed DNA_USHORT_FIX from screen_types.h, gave warning
- operators didn't get ID name copied when activated, needed for
later re-use or saving.
2008-12-02 14:22:52 +00:00
|
|
|
wmWindow *win;
|
|
|
|
|
|
|
|
/* first wrap up running stuff, we assume only the active WM is running */
|
|
|
|
/* modal handlers are on window level freed, others too? */
|
2008-12-21 16:24:19 +00:00
|
|
|
/* note; same code copied in wm_files.c */
|
2008-12-18 02:56:48 +00:00
|
|
|
if(C && CTX_wm_manager(C)) {
|
2009-01-27 17:12:40 +00:00
|
|
|
|
|
|
|
WM_jobs_stop_all(CTX_wm_manager(C));
|
|
|
|
|
2008-12-18 02:56:48 +00:00
|
|
|
for(win= CTX_wm_manager(C)->windows.first; win; win= win->next) {
|
Lots of stuff; couldn't commit in parts because of refactor work.
* Changes in interface/ module
This commit brings back the way how buttons/menus work under control
of WM event system. The previous implementation extended usage of
handlers and operators in an interesting but confusing way. Better to
try it first according the design specs. :)
Most obviously:
- modal-handler operators are not stored anymore in regions/areas/windows.
such modal handlers own their operator, and should remove it themselves.
- removed code to move handlers from one queue to another.
(needs review with brecht!)
- WM fix: the API call to remove a modal handler got removed. This was a
dangerous thing anyway, and you should leave that to the event system.
Now, if a handler modal() call gets a cancel/finish return, it frees
itself in event system. WM_event_remove_modal_handler was a confusing
call anyway!
Todo:
- allow button-activate to refresh after using button
- re-enable arrow keys for menus
(do both after commit)
- review return values of operator callbacks in interface_ops.c
* Fixes in WM system
- Freeing areas/regions/windows, also on quit, now correctly closes
running modal handlers
- On starting a modal handler, the handler now stores previous area
and region context, so they send proper notifiers etc.
* Other fixes
- Area-split operator had bug, wrong minimal size checking. This
solves error when trying to split a very narrow area.
- removed DNA_USHORT_FIX from screen_types.h, gave warning
- operators didn't get ID name copied when activated, needed for
later re-use or saving.
2008-12-02 14:22:52 +00:00
|
|
|
|
2008-12-18 02:56:48 +00:00
|
|
|
CTX_wm_window_set(C, win); /* needed by operator close callbacks */
|
Lots of stuff; couldn't commit in parts because of refactor work.
* Changes in interface/ module
This commit brings back the way how buttons/menus work under control
of WM event system. The previous implementation extended usage of
handlers and operators in an interesting but confusing way. Better to
try it first according the design specs. :)
Most obviously:
- modal-handler operators are not stored anymore in regions/areas/windows.
such modal handlers own their operator, and should remove it themselves.
- removed code to move handlers from one queue to another.
(needs review with brecht!)
- WM fix: the API call to remove a modal handler got removed. This was a
dangerous thing anyway, and you should leave that to the event system.
Now, if a handler modal() call gets a cancel/finish return, it frees
itself in event system. WM_event_remove_modal_handler was a confusing
call anyway!
Todo:
- allow button-activate to refresh after using button
- re-enable arrow keys for menus
(do both after commit)
- review return values of operator callbacks in interface_ops.c
* Fixes in WM system
- Freeing areas/regions/windows, also on quit, now correctly closes
running modal handlers
- On starting a modal handler, the handler now stores previous area
and region context, so they send proper notifiers etc.
* Other fixes
- Area-split operator had bug, wrong minimal size checking. This
solves error when trying to split a very narrow area.
- removed DNA_USHORT_FIX from screen_types.h, gave warning
- operators didn't get ID name copied when activated, needed for
later re-use or saving.
2008-12-02 14:22:52 +00:00
|
|
|
WM_event_remove_handlers(C, &win->handlers);
|
2008-12-10 13:56:54 +00:00
|
|
|
ED_screen_exit(C, win, win->screen);
|
Lots of stuff; couldn't commit in parts because of refactor work.
* Changes in interface/ module
This commit brings back the way how buttons/menus work under control
of WM event system. The previous implementation extended usage of
handlers and operators in an interesting but confusing way. Better to
try it first according the design specs. :)
Most obviously:
- modal-handler operators are not stored anymore in regions/areas/windows.
such modal handlers own their operator, and should remove it themselves.
- removed code to move handlers from one queue to another.
(needs review with brecht!)
- WM fix: the API call to remove a modal handler got removed. This was a
dangerous thing anyway, and you should leave that to the event system.
Now, if a handler modal() call gets a cancel/finish return, it frees
itself in event system. WM_event_remove_modal_handler was a confusing
call anyway!
Todo:
- allow button-activate to refresh after using button
- re-enable arrow keys for menus
(do both after commit)
- review return values of operator callbacks in interface_ops.c
* Fixes in WM system
- Freeing areas/regions/windows, also on quit, now correctly closes
running modal handlers
- On starting a modal handler, the handler now stores previous area
and region context, so they send proper notifiers etc.
* Other fixes
- Area-split operator had bug, wrong minimal size checking. This
solves error when trying to split a very narrow area.
- removed DNA_USHORT_FIX from screen_types.h, gave warning
- operators didn't get ID name copied when activated, needed for
later re-use or saving.
2008-12-02 14:22:52 +00:00
|
|
|
}
|
|
|
|
}
|
2007-12-24 18:27:28 +00:00
|
|
|
wm_operatortype_free();
|
|
|
|
|
2008-12-31 17:11:42 +00:00
|
|
|
/* all non-screen and non-space stuff editors did, like editmode */
|
|
|
|
if(C)
|
|
|
|
ED_editors_exit(C);
|
2009-03-20 18:00:51 +00:00
|
|
|
|
|
|
|
// XXX
|
|
|
|
// BIF_GlobalReebFree();
|
|
|
|
// BIF_freeRetarget();
|
2009-03-22 00:30:18 +00:00
|
|
|
BIF_freeTemplates(C);
|
2009-01-04 14:14:06 +00:00
|
|
|
|
2007-12-24 18:27:28 +00:00
|
|
|
free_ttfont(); /* bke_font.h */
|
|
|
|
|
|
|
|
free_openrecent();
|
|
|
|
|
|
|
|
BKE_freecubetable();
|
|
|
|
|
|
|
|
// if (G.background == 0)
|
|
|
|
// sound_end_all_sounds();
|
|
|
|
|
|
|
|
|
|
|
|
/* before free_blender so py's gc happens while library still exists */
|
|
|
|
/* needed at least for a rare sigsegv that can happen in pydrivers */
|
2008-12-27 20:22:22 +00:00
|
|
|
#ifndef DISABLE_PYTHON
|
2008-12-27 04:55:45 +00:00
|
|
|
BPY_end_python();
|
2008-12-27 20:22:22 +00:00
|
|
|
#endif
|
2007-12-24 18:27:28 +00:00
|
|
|
|
2009-02-04 17:40:50 +00:00
|
|
|
fastshade_free_render(); /* shaded view */
|
2.5
Added WM Jobs manager
- WM can manage threaded jobs for you; just provide a couple
of components to get it work:
- customdata, free callback for it
- timer step, notifier code
- start callback, update callback
- Once started, each job runs an own timer, and will for
every time step check necessary updates, or close the
job when ready.
- No drawing happens in jobs, that's for notifiers!
- Every job stores an owner pointer, and based on this owner
it will prevent multiple jobs to enter the stack.
Instead it will re-use a running job, signal it to stop
and allow caller to re-initialize it even.
- Check new wm_jobs.c for more explanation. Jobs API is still
under construction.
Fun: BLI_addtail(&wm->jobs, steve); :)
Put Node shader previews back using wmJobs
- Preview calculating is now fully threaded (1 thread still)
- Thanks to new event system + notifiers, you can see
previews update even while dragging sliders!
- Currently it only starts when you change a node setting.
Warning: the thread render shares Node data, so don't delete
nodes while it renders! This topic is on the todo to make safe.
Also:
- bug in region initialize (do_versions) showed channel list in
node editor wrong.
- flagged the channel list 'hidden' now, it was really in the
way! This is for later to work on anyway.
- recoded Render API callbacks so it gets handlers passed on,
no globals to use anymore, remember?
- previewrender code gets now so much nicer! Will remove a lot
of stuff from code soon.
2009-01-22 14:59:49 +00:00
|
|
|
ED_preview_free_dbase(); /* frees a Main dbase, before free_blender! */
|
2009-07-19 04:50:10 +00:00
|
|
|
wm_free_reports(C); /* before free_blender! - since the ListBases get freed there */
|
2.5
Added WM Jobs manager
- WM can manage threaded jobs for you; just provide a couple
of components to get it work:
- customdata, free callback for it
- timer step, notifier code
- start callback, update callback
- Once started, each job runs an own timer, and will for
every time step check necessary updates, or close the
job when ready.
- No drawing happens in jobs, that's for notifiers!
- Every job stores an owner pointer, and based on this owner
it will prevent multiple jobs to enter the stack.
Instead it will re-use a running job, signal it to stop
and allow caller to re-initialize it even.
- Check new wm_jobs.c for more explanation. Jobs API is still
under construction.
Fun: BLI_addtail(&wm->jobs, steve); :)
Put Node shader previews back using wmJobs
- Preview calculating is now fully threaded (1 thread still)
- Thanks to new event system + notifiers, you can see
previews update even while dragging sliders!
- Currently it only starts when you change a node setting.
Warning: the thread render shares Node data, so don't delete
nodes while it renders! This topic is on the todo to make safe.
Also:
- bug in region initialize (do_versions) showed channel list in
node editor wrong.
- flagged the channel list 'hidden' now, it was really in the
way! This is for later to work on anyway.
- recoded Render API callbacks so it gets handlers passed on,
no globals to use anymore, remember?
- previewrender code gets now so much nicer! Will remove a lot
of stuff from code soon.
2009-01-22 14:59:49 +00:00
|
|
|
free_blender(); /* blender.c, does entire library and spacetypes */
|
2007-12-24 18:27:28 +00:00
|
|
|
// free_matcopybuf();
|
2009-02-24 11:18:24 +00:00
|
|
|
free_anim_copybuf();
|
2007-12-24 18:27:28 +00:00
|
|
|
// free_vertexpaint();
|
|
|
|
// free_imagepaint();
|
|
|
|
|
|
|
|
// fsmenu_free();
|
2009-02-17 16:56:29 +00:00
|
|
|
|
|
|
|
BLF_exit();
|
|
|
|
|
2007-12-24 18:27:28 +00:00
|
|
|
RE_FreeAllRender();
|
2.5: Render/Game Engine
An engine to use for output can now be selected an influences what
shows in the buttons window, only showing relevant data. The idea
behind this is to make it more clear what is supported where, make
the system more pluggable for external render/game engines, and save
space hiding stuff that is not relevant anyway.
* Top header now has an engine menu, to choose between the blender
render engine, game engine, and other future external engines.
* If the game engine is enabled, the buttons window should show
only properties that work in the game engine, and similarly for
the render engine.
* Moved panels from the logic space and game tabs to the physics,
scene and world tabs instead, and removed the game tab.
* Materials and textures tabs should eventually become game
specific too, to better show what is supported.
2009-07-23 21:50:40 +00:00
|
|
|
RE_engines_exit();
|
2007-12-24 18:27:28 +00:00
|
|
|
|
|
|
|
// free_txt_data();
|
|
|
|
|
|
|
|
// sound_exit_audio();
|
|
|
|
if(G.listener) MEM_freeN(G.listener);
|
|
|
|
|
|
|
|
|
|
|
|
libtiff_exit();
|
|
|
|
|
|
|
|
#ifdef WITH_QUICKTIME
|
|
|
|
quicktime_exit();
|
|
|
|
#endif
|
|
|
|
|
|
|
|
if (!G.background) {
|
Port of part of the Interface code to 2.50.
This is based on the current trunk version, so these files should not need
merges. There's two things (clipboard and intptr_t) that are missing in 2.50
and commented out with XXX 2.48, these can be enabled again once trunk is
merged into this branch.
Further this is not all interface code, there are many parts commented out:
* interface.c: nearly all button types, missing: links, chartab, keyevent.
* interface_draw.c: almost all code, with some small exceptions.
* interface_ops.c: this replaces ui_do_but and uiDoBlocks with two operators,
making it non-blocking.
* interface_regions: this is a part of interface.c, split off, contains code to
create regions for tooltips, menus, pupmenu (that one is crashing currently),
color chooser, basically regions with buttons which is fairly independent of
core interface code.
* interface_panel.c and interface_icons.c: not ported over, so no panels and
icons yet. Panels should probably become (free floating) regions?
* text.c: (formerly language.c) for drawing text and translation. this works
but is using bad globals still and could be cleaned up.
Header Files:
* ED_datafiles.h now has declarations for datatoc_ files, so those extern
declarations can be #included instead of repeated.
* The user interface code is in UI_interface.h and other UI_* files.
Core:
* The API for creating blocks, buttons, etc is nearly the same still. Blocks
are now created per region instead of per area.
* The code was made non-blocking, which means that any changes and redraws
should be possible while editing a button. That means though that we need
some sort of persistence even though the blender model is to recreate buttons
for each redraw. So when a new block is created, some matching happens to
find out which buttons correspond to buttons in the previously created block,
and for activated buttons some data is then copied over to the new button.
* Added UI_init/UI_init_userdef/UI_exit functions that should initialize code
in this module, instead of multiple function calls in the windowmanager.
* Removed most static/globals from interface.c.
* Removed UIafterfunc_ I don't think it's needed anymore, and not sure how it
would integrate here?
* Currently only full window redraws are used, this should become per region
and maybe per button later.
Operators:
* Events are currently handled through two operators: button activate and menu
handle. Operators may not be the best way to implement this, since there are
currently some issues with events being missed, but they can become a special
handler type instead, this should not be a big change.
* The button activate operator runs as long as a button is active, and will
handle all interaction with that button until the button is not activated
anymore. This means clicking, text editing, number dragging, opening menu
blocks, etc.
* Since this operator has to be non-blocking, the ui_do_but code needed to made
non-blocking. That means variables that were previously on the stack, now
need to be stored away in a struct such that they can be accessed again when
the operator receives more events.
* Additionally the place in the ui_do_but code indicated the state, now that
needs to be set explicit in order to handle the right events in the right
state. So an activated button can be in one of these states: init, highlight,
wait_flash, wait_release, wait_key_event, num_editing, text_editing,
text_selecting, block_open, exit.
* For each button type an ui_apply_but_* function has also been separated out
from ui_do_but. This makes it possible to continuously apply the button as
text is being typed for example, and there is an option in the code to enable
this. Since the code non-blocking and can deal with the button being deleted
even, it should be safe to do this.
* When editing text, dragging numbers, etc, the actual data (but->poin) is not
being edited, since that would mean data is being edited without correct
updates happening, while some other part of blender may be accessing that
data in the meantime. So data values, strings, vectors are written to a
temporary location and only flush in the apply function.
Regions:
* Menus, color chooser, tooltips etc all create screen level regions. Such menu
blocks give a handle to the button that creates it, which will contain the
results of the menu block once a MESSAGE event is received from that menu
block.
* For this type of menu block the coordinates used to be in window space. They
are still created that way and ui_positionblock still works with window
coordinates, but after that the block and buttons are brought back to region
coordinates since these are now contained in a region.
* The flush/overdraw frontbuffer drawing code was removed, the windowmanager
should have enough information with these screen level regions to have full
control over what gets drawn when and to then do correct compositing.
Testing:
* The header in the time space currently has some buttons to test the UI code.
2008-11-11 18:31:32 +00:00
|
|
|
// XXX UI_filelist_free_icons();
|
2007-12-24 18:27:28 +00:00
|
|
|
}
|
|
|
|
|
2009-01-28 19:42:49 +00:00
|
|
|
GPU_extensions_exit();
|
2007-12-24 18:27:28 +00:00
|
|
|
|
|
|
|
// if (copybuf) MEM_freeN(copybuf);
|
|
|
|
// if (copybufinfo) MEM_freeN(copybufinfo);
|
|
|
|
|
|
|
|
BKE_undo_save_quit(); // saves quit.blend if global undo is on
|
|
|
|
BKE_reset_undo();
|
|
|
|
|
2009-01-06 14:42:54 +00:00
|
|
|
ED_file_exit(); /* for fsmenu */
|
|
|
|
|
Port of part of the Interface code to 2.50.
This is based on the current trunk version, so these files should not need
merges. There's two things (clipboard and intptr_t) that are missing in 2.50
and commented out with XXX 2.48, these can be enabled again once trunk is
merged into this branch.
Further this is not all interface code, there are many parts commented out:
* interface.c: nearly all button types, missing: links, chartab, keyevent.
* interface_draw.c: almost all code, with some small exceptions.
* interface_ops.c: this replaces ui_do_but and uiDoBlocks with two operators,
making it non-blocking.
* interface_regions: this is a part of interface.c, split off, contains code to
create regions for tooltips, menus, pupmenu (that one is crashing currently),
color chooser, basically regions with buttons which is fairly independent of
core interface code.
* interface_panel.c and interface_icons.c: not ported over, so no panels and
icons yet. Panels should probably become (free floating) regions?
* text.c: (formerly language.c) for drawing text and translation. this works
but is using bad globals still and could be cleaned up.
Header Files:
* ED_datafiles.h now has declarations for datatoc_ files, so those extern
declarations can be #included instead of repeated.
* The user interface code is in UI_interface.h and other UI_* files.
Core:
* The API for creating blocks, buttons, etc is nearly the same still. Blocks
are now created per region instead of per area.
* The code was made non-blocking, which means that any changes and redraws
should be possible while editing a button. That means though that we need
some sort of persistence even though the blender model is to recreate buttons
for each redraw. So when a new block is created, some matching happens to
find out which buttons correspond to buttons in the previously created block,
and for activated buttons some data is then copied over to the new button.
* Added UI_init/UI_init_userdef/UI_exit functions that should initialize code
in this module, instead of multiple function calls in the windowmanager.
* Removed most static/globals from interface.c.
* Removed UIafterfunc_ I don't think it's needed anymore, and not sure how it
would integrate here?
* Currently only full window redraws are used, this should become per region
and maybe per button later.
Operators:
* Events are currently handled through two operators: button activate and menu
handle. Operators may not be the best way to implement this, since there are
currently some issues with events being missed, but they can become a special
handler type instead, this should not be a big change.
* The button activate operator runs as long as a button is active, and will
handle all interaction with that button until the button is not activated
anymore. This means clicking, text editing, number dragging, opening menu
blocks, etc.
* Since this operator has to be non-blocking, the ui_do_but code needed to made
non-blocking. That means variables that were previously on the stack, now
need to be stored away in a struct such that they can be accessed again when
the operator receives more events.
* Additionally the place in the ui_do_but code indicated the state, now that
needs to be set explicit in order to handle the right events in the right
state. So an activated button can be in one of these states: init, highlight,
wait_flash, wait_release, wait_key_event, num_editing, text_editing,
text_selecting, block_open, exit.
* For each button type an ui_apply_but_* function has also been separated out
from ui_do_but. This makes it possible to continuously apply the button as
text is being typed for example, and there is an option in the code to enable
this. Since the code non-blocking and can deal with the button being deleted
even, it should be safe to do this.
* When editing text, dragging numbers, etc, the actual data (but->poin) is not
being edited, since that would mean data is being edited without correct
updates happening, while some other part of blender may be accessing that
data in the meantime. So data values, strings, vectors are written to a
temporary location and only flush in the apply function.
Regions:
* Menus, color chooser, tooltips etc all create screen level regions. Such menu
blocks give a handle to the button that creates it, which will contain the
results of the menu block once a MESSAGE event is received from that menu
block.
* For this type of menu block the coordinates used to be in window space. They
are still created that way and ui_positionblock still works with window
coordinates, but after that the block and buttons are brought back to region
coordinates since these are now contained in a region.
* The flush/overdraw frontbuffer drawing code was removed, the windowmanager
should have enough information with these screen level regions to have full
control over what gets drawn when and to then do correct compositing.
Testing:
* The header in the time space currently has some buttons to test the UI code.
2008-11-11 18:31:32 +00:00
|
|
|
UI_exit();
|
2009-04-30 16:44:00 +00:00
|
|
|
BKE_userdef_free();
|
2008-11-21 19:14:38 +00:00
|
|
|
|
|
|
|
RNA_exit();
|
2007-12-24 18:27:28 +00:00
|
|
|
|
2008-12-18 02:56:48 +00:00
|
|
|
CTX_free(C);
|
2007-12-24 18:27:28 +00:00
|
|
|
|
Merge of trunk into blender 2.5:
svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r12987:17416
Issues:
* GHOST/X11 had conflicting changes. Some code was added in 2.5, which was
later added in trunk also, but reverted partially, specifically revision
16683. I have left out this reversion in the 2.5 branch since I think it is
needed there.
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=16683
* Scons had various conflicting changes, I decided to go with trunk version
for everything except priorities and some library renaming.
* In creator.c, there were various fixes and fixes for fixes related to the -w
-W and -p options. In 2.5 -w and -W is not coded yet, and -p is done
differently. Since this is changed so much, and I don't think those fixes
would be needed in 2.5, I've left them out.
* Also in creator.c: there was code for a python bugfix where the screen was not
initialized when running with -P. The code that initializes the screen there
I had to disable, that can't work in 2.5 anymore but left it commented as a
reminder.
Further I had to disable some new function calls. using src/ and python/, as
was done already in this branch, disabled function calls:
* bpath.c: error reporting
* BME_conversions.c: editmesh conversion functions.
* SHD_dynamic: disabled almost completely, there is no python/.
* KX_PythonInit.cpp and Ketsji/ build files: Mathutils is not there, disabled.
* text.c: clipboard copy call.
* object.c: OB_SUPPORT_MATERIAL.
* DerivedMesh.c and subsurf_ccg, stipple_quarttone.
Still to be done:
* Go over files and functions that were moved to a different location but could
still use changes that were done in trunk.
2008-11-12 21:16:53 +00:00
|
|
|
if(MEM_get_memory_blocks_in_use()!=0) {
|
|
|
|
printf("Error Totblock: %d\n", MEM_get_memory_blocks_in_use());
|
2007-12-24 18:27:28 +00:00
|
|
|
MEM_printmemlist();
|
|
|
|
}
|
|
|
|
// delete_autosave();
|
|
|
|
|
|
|
|
printf("\nBlender quit\n");
|
|
|
|
|
|
|
|
#ifdef WIN32
|
|
|
|
/* ask user to press enter when in debug mode */
|
|
|
|
if(G.f & G_DEBUG) {
|
|
|
|
printf("press enter key to exit...\n\n");
|
|
|
|
getchar();
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
SYS_DeleteSystem(SYS_GetSystem());
|
|
|
|
|
|
|
|
exit(G.afbreek==1);
|
|
|
|
}
|
|
|
|
|