diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2011-02-26 23:21:09 +0300 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2011-02-26 23:21:09 +0300 |
commit | 63b31ef91b562a1a4aa95991323555a140dd6ede (patch) | |
tree | 4287fcc7edc5e01efbd4b26d7c923c9b0cd8d830 /source/blender/editors/render | |
parent | 745e396d63ed15fa69203e04840597112498ec3b (diff) | |
parent | 2f0d93ba563ae2c87a088f21113d5559ab9abfc4 (diff) |
Merged changes in the trunk up to revision 35203.
Conflicts resolved:
source/creator/creator.c
source/blender/python/intern/bpy.c
Diffstat (limited to 'source/blender/editors/render')
-rw-r--r-- | source/blender/editors/render/render_intern.h | 2 | ||||
-rw-r--r-- | source/blender/editors/render/render_internal.c | 38 | ||||
-rw-r--r-- | source/blender/editors/render/render_opengl.c | 2 | ||||
-rw-r--r-- | source/blender/editors/render/render_ops.c | 2 | ||||
-rw-r--r-- | source/blender/editors/render/render_preview.c | 19 | ||||
-rw-r--r-- | source/blender/editors/render/render_shading.c | 2 |
6 files changed, 43 insertions, 22 deletions
diff --git a/source/blender/editors/render/render_intern.h b/source/blender/editors/render/render_intern.h index 4339d07c7a9..24831cebad7 100644 --- a/source/blender/editors/render/render_intern.h +++ b/source/blender/editors/render/render_intern.h @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/render/render_internal.c b/source/blender/editors/render/render_internal.c index 17d05bed24a..52280fa8e6a 100644 --- a/source/blender/editors/render/render_internal.c +++ b/source/blender/editors/render/render_internal.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -68,7 +68,7 @@ static ScrArea *biggest_area(bContext *C); static ScrArea *biggest_non_image_area(bContext *C); -static ScrArea *find_area_showing_r_result(bContext *C); +static ScrArea *find_area_showing_r_result(bContext *C, wmWindow **win); static ScrArea *find_area_image_empty(bContext *C); /* called inside thread! */ @@ -232,9 +232,13 @@ void screen_set_image_output(bContext *C, int mx, int my) } if(!sa) { - sa= find_area_showing_r_result(C); + sa= find_area_showing_r_result(C, &win); if(sa==NULL) sa= find_area_image_empty(C); + + /* if area found in other window, we make that one show in front */ + if(win && win!=CTX_wm_window(C)) + wm_window_raise(win); if(sa==NULL) { /* find largest open non-image area */ @@ -336,16 +340,15 @@ static ScrArea *biggest_area(bContext *C) } -static ScrArea *find_area_showing_r_result(bContext *C) +static ScrArea *find_area_showing_r_result(bContext *C, wmWindow **win) { wmWindowManager *wm= CTX_wm_manager(C); - wmWindow *win; ScrArea *sa = NULL; SpaceImage *sima; /* find an imagewindow showing render result */ - for(win=wm->windows.first; win; win=win->next) { - for(sa=win->screen->areabase.first; sa; sa= sa->next) { + for(*win=wm->windows.first; *win; *win= (*win)->next) { + for(sa= (*win)->screen->areabase.first; sa; sa= sa->next) { if(sa->spacetype==SPACE_IMAGE) { sima= sa->spacedata.first; if(sima->image && sima->image->type==IMA_TYPE_R_RESULT) @@ -355,7 +358,7 @@ static ScrArea *find_area_showing_r_result(bContext *C) if(sa) break; } - + return sa; } @@ -800,7 +803,7 @@ void RENDER_OT_render(wmOperatorType *ot) ot->modal= screen_render_modal; ot->exec= screen_render_exec; - ot->poll= ED_operator_screenactive; + /*ot->poll= ED_operator_screenactive;*/ /* this isnt needed, causes failer in background mode */ RNA_def_boolean(ot->srna, "animation", 0, "Animation", "Render files from the animation range of this scene"); RNA_def_boolean(ot->srna, "write_still", 0, "Write Image", "Save rendered the image to the output path (used only when animation is disabled)"); @@ -862,18 +865,19 @@ void RENDER_OT_view_cancel(struct wmOperatorType *ot) static int render_view_show_invoke(bContext *C, wmOperator *UNUSED(unused), wmEvent *event) { - ScrArea *sa= find_area_showing_r_result(C); - - /* test if we have a temp screen active */ - if(CTX_wm_window(C)->screen->temp) { - wm_window_lower(CTX_wm_window(C)); + wmWindow *wincur = CTX_wm_window(C); + + /* test if we have currently a temp screen active */ + if(wincur->screen->temp) { + wm_window_lower(wincur); } else { - /* is there another window? */ - wmWindow *win; + wmWindow *win, *winshow; + ScrArea *sa= find_area_showing_r_result(C, &winshow); + /* is there another window showing result? */ for(win= CTX_wm_manager(C)->windows.first; win; win= win->next) { - if(win->screen->temp) { + if(win->screen->temp || (win==winshow && winshow!=wincur)) { wm_window_raise(win); return OPERATOR_FINISHED; } diff --git a/source/blender/editors/render/render_opengl.c b/source/blender/editors/render/render_opengl.c index 1f182723bc8..68bf4fa9b5b 100644 --- a/source/blender/editors/render/render_opengl.c +++ b/source/blender/editors/render/render_opengl.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/render/render_ops.c b/source/blender/editors/render/render_ops.c index 62f573c031f..c0995785d05 100644 --- a/source/blender/editors/render/render_ops.c +++ b/source/blender/editors/render/render_ops.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/render/render_preview.c b/source/blender/editors/render/render_preview.c index d635a799ec1..67a0773199f 100644 --- a/source/blender/editors/render/render_preview.c +++ b/source/blender/editors/render/render_preview.c @@ -68,6 +68,7 @@ #include "BKE_main.h" #include "BKE_material.h" #include "BKE_node.h" +#include "BKE_idprop.h" #include "IMB_imbuf.h" #include "IMB_imbuf_types.h" @@ -286,6 +287,7 @@ void ED_preview_init_dbase(void) BlendFileData *bfd; extern int datatoc_preview_blend_size; extern char datatoc_preview_blend[]; + const int fileflags= G.fileflags; G.fileflags |= G_FILE_NO_UI; bfd= BLO_read_from_memory(datatoc_preview_blend, datatoc_preview_blend_size, NULL); @@ -294,7 +296,7 @@ void ED_preview_init_dbase(void) MEM_freeN(bfd); } - G.fileflags &= ~G_FILE_NO_UI; + G.fileflags= fileflags; } void ED_preview_free_dbase(void) @@ -1053,6 +1055,14 @@ static void shader_preview_render(ShaderPreview *sp, ID *id, int split, int firs /* unassign the pointers, reset vars */ preview_prepare_scene(sp->scene, NULL, GS(id->name), sp); + + /* XXX bad exception, end-exec is not being called in render, because it uses local main */ + if(idtype == ID_TE) { + Tex *tex= (Tex *)id; + if(tex->use_nodes && tex->nodetree) + ntreeEndExecTree(tex->nodetree); + } + } /* runs inside thread for material and icons */ @@ -1078,12 +1088,19 @@ static void shader_preview_free(void *customdata) ShaderPreview *sp= customdata; if(sp->matcopy) { + struct IDProperty *properties; /* node previews */ shader_preview_updatejob(sp); /* get rid of copied material */ BLI_remlink(&pr_main->mat, sp->matcopy); free_material(sp->matcopy); + + properties= IDP_GetProperties((ID *)sp->matcopy, FALSE); + if (properties) { + IDP_FreeProperty(properties); + MEM_freeN(properties); + } MEM_freeN(sp->matcopy); } diff --git a/source/blender/editors/render/render_shading.c b/source/blender/editors/render/render_shading.c index 95523cba85e..5f9aa54e9db 100644 --- a/source/blender/editors/render/render_shading.c +++ b/source/blender/editors/render/render_shading.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** |