diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2012-09-23 22:50:56 +0400 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2012-09-23 22:50:56 +0400 |
commit | a42ba82f638e481d7fd3c3ed2ba05c331ef6717e (patch) | |
tree | 81a2b9221799707b49b74a5df8bb3ff964ba78bd /source/blender/editors/object/object_bake.c | |
parent | 7afbdff1b6c348227e652e1c3071ab7ba7c91c44 (diff) | |
parent | a73dd3476e7d180d3320afc04d218ce22f2f3bfc (diff) |
Merged changes in the trunk up to revision 50829.
Conflicts resolved:
source/blender/blenloader/intern/readfile.c
source/blender/render/intern/source/convertblender.c
source/blender/render/intern/source/pipeline.c
Also addressed code inconsistency due to changes in the trunk revision 50628 (color
management with OCIO) and 50806 (UV project material). OCIO-related changes are marked
OCIO_TODO as in some other files modified in revision 50628.
Diffstat (limited to 'source/blender/editors/object/object_bake.c')
-rw-r--r-- | source/blender/editors/object/object_bake.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/source/blender/editors/object/object_bake.c b/source/blender/editors/object/object_bake.c index f9b73a56403..0ea2f78a415 100644 --- a/source/blender/editors/object/object_bake.c +++ b/source/blender/editors/object/object_bake.c @@ -69,6 +69,7 @@ #include "IMB_imbuf_types.h" #include "IMB_imbuf.h" +#include "IMB_colormanagement.h" #include "GPU_draw.h" /* GPU_free_image */ @@ -685,7 +686,7 @@ static void apply_heights_data(void *bake_data) } } - ibuf->userflags = IB_RECT_INVALID; + ibuf->userflags = IB_RECT_INVALID | IB_DISPLAY_BUFFER_INVALID; } static void free_heights_data(void *bake_data) @@ -769,6 +770,8 @@ static void apply_heights_callback(DerivedMesh *lores_dm, DerivedMesh *hires_dm, char *rrgb = (char *)ibuf->rect + pixel * 4; rrgb[3] = 255; } + + ibuf->userflags |= IB_DISPLAY_BUFFER_INVALID; } /* MultiresBake callback for normals' baking @@ -826,6 +829,8 @@ static void apply_tangmat_callback(DerivedMesh *lores_dm, DerivedMesh *hires_dm, rgb_float_to_uchar(rrgb, vec); rrgb[3] = 255; } + + ibuf->userflags |= IB_DISPLAY_BUFFER_INVALID; } static void count_images(MultiresBakeRender *bkr) @@ -895,7 +900,7 @@ static void finish_images(MultiresBakeRender *bkr) RE_bake_ibuf_filter(ibuf, (char *)ibuf->userdata, bkr->bake_filter); - ibuf->userflags |= IB_BITMAPDIRTY; + ibuf->userflags |= IB_BITMAPDIRTY | IB_DISPLAY_BUFFER_INVALID;; if (ibuf->rect_float) ibuf->userflags |= IB_RECT_INVALID; @@ -1324,11 +1329,12 @@ static int test_bake_internal(bContext *C, ReportList *reports) static void init_bake_internal(BakeRender *bkr, bContext *C) { Scene *scene = CTX_data_scene(C); + bScreen *sc = CTX_wm_screen(C); /* get editmode results */ ED_object_exit_editmode(C, 0); /* 0 = does not exit editmode */ - bkr->sa = BKE_screen_find_big_area(CTX_wm_screen(C), SPACE_IMAGE, 10); /* can be NULL */ + bkr->sa = sc ? BKE_screen_find_big_area(sc, SPACE_IMAGE, 10) : NULL; /* can be NULL */ bkr->main = CTX_data_main(C); bkr->scene = scene; bkr->actob = (scene->r.bake_flag & R_BAKE_TO_ACTIVE) ? OBACT : NULL; @@ -1369,6 +1375,7 @@ static void finish_bake_internal(BakeRender *bkr) if (ima->ok == IMA_OK_LOADED) { if (ibuf) { if (ibuf->userflags & IB_BITMAPDIRTY) { + ibuf->userflags |= IB_DISPLAY_BUFFER_INVALID; GPU_free_image(ima); imb_freemipmapImBuf(ibuf); } |