diff options
author | Ton Roosendaal <ton@blender.org> | 2009-06-07 15:12:35 +0400 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2009-06-07 15:12:35 +0400 |
commit | a2f9ca3b3fcd020e5124b6c3fb6523545377b5e2 (patch) | |
tree | 83830cf58852e6b2a6572d36b244bd6bdeddfebc /source/blender/editors/space_buttons/space_buttons.c | |
parent | 1bb8d745b914aade700d69220e665096d5db43d0 (diff) |
2.5
Nice goodie: Preview renders!
- Added new preview.blend, allowing super wide cinemascope previews
- Draws nicely blended inside widget type, rounded corners
- Preview now renders using all available cpus/cores.
- Uses - hopefully rock stable - method, which doesn't copy or
allocate anything for previews, but just uses render API calls.
- Multiple previews are possible! But, added provision in Jobs
manager to only render one preview job at a time. If you start
more preview jobs, they're suspended until it's their turn.
Bugfix: new buttons context code crashed when going full-window.
Tweaks are still needed for notifiers. I have to figure out still
how to retrieve SpaceButs button view types...
Diffstat (limited to 'source/blender/editors/space_buttons/space_buttons.c')
-rw-r--r-- | source/blender/editors/space_buttons/space_buttons.c | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/source/blender/editors/space_buttons/space_buttons.c b/source/blender/editors/space_buttons/space_buttons.c index c8724cae9e6..e7be5dcba36 100644 --- a/source/blender/editors/space_buttons/space_buttons.c +++ b/source/blender/editors/space_buttons/space_buttons.c @@ -240,15 +240,21 @@ static void buttons_header_area_draw(const bContext *C, ARegion *ar) } /* reused! */ -static void buttons_area_listener(ARegion *ar, wmNotifier *wmn) +static void buttons_area_listener(ScrArea *sa, wmNotifier *wmn) { + SpaceButs *sbuts= sa->spacedata.first; + /* context changes */ switch(wmn->category) { case NC_SCENE: switch(wmn->data) { case ND_FRAME: + ED_area_tag_redraw(sa); + break; + case ND_OB_ACTIVE: - ED_region_tag_redraw(ar); + ED_area_tag_redraw(sa); + sbuts->preview= 1; break; } break; @@ -258,10 +264,25 @@ static void buttons_area_listener(ARegion *ar, wmNotifier *wmn) case ND_BONE_ACTIVE: case ND_BONE_SELECT: case ND_GEOM_SELECT: - ED_region_tag_redraw(ar); + ED_area_tag_redraw(sa); break; } break; + case NC_MATERIAL: + ED_area_tag_redraw(sa); + + switch(wmn->data) { + case ND_SHADING: + case ND_SHADING_DRAW: + /* currently works by redraws... if preview is set, it (re)starts job */ + sbuts->preview= 1; + printf("shader notifier \n"); + break; + } + break; + case NC_WORLD: + ED_area_tag_redraw(sa); + sbuts->preview= 1; } } @@ -279,6 +300,7 @@ void ED_spacetype_buttons(void) st->duplicate= buttons_duplicate; st->operatortypes= buttons_operatortypes; st->keymap= buttons_keymap; + st->listener= buttons_area_listener; st->context= buttons_context; /* regions: main window */ @@ -286,7 +308,6 @@ void ED_spacetype_buttons(void) art->regionid = RGN_TYPE_WINDOW; art->init= buttons_main_area_init; art->draw= buttons_main_area_draw; - art->listener= buttons_area_listener; art->keymapflag= ED_KEYMAP_UI|ED_KEYMAP_FRAMES; BLI_addhead(&st->regiontypes, art); @@ -300,7 +321,6 @@ void ED_spacetype_buttons(void) art->init= buttons_header_area_init; art->draw= buttons_header_area_draw; - art->listener= buttons_area_listener; BLI_addhead(&st->regiontypes, art); /* regions: channels */ |