diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-10-17 22:29:01 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-10-17 22:29:01 +0400 |
commit | a709cb2d55573029a4cd36a74ec8f7cabcb834fa (patch) | |
tree | aad89e31128046de4b7eab837cf6d84cd7a454e2 /source/blender/render | |
parent | 2e8ab664d552a3361f286005025e1f6f7df14a23 (diff) |
Fix #37123: UV editor view does not update when using large faces
Update tagging was happening only after full triangle was handled.
Now made it so images are updating once in 0.5sec, progress bar
will still update only after the whole triangle is done.
Diffstat (limited to 'source/blender/render')
-rw-r--r-- | source/blender/render/intern/source/bake.c | 4 | ||||
-rw-r--r-- | source/blender/render/intern/source/multires_bake.c | 10 |
2 files changed, 12 insertions, 2 deletions
diff --git a/source/blender/render/intern/source/bake.c b/source/blender/render/intern/source/bake.c index cb6ca0e30ac..c150133b276 100644 --- a/source/blender/render/intern/source/bake.c +++ b/source/blender/render/intern/source/bake.c @@ -322,6 +322,10 @@ static void bake_shade(void *handle, Object *ob, ShadeInput *shi, int UNUSED(qua if (bs->rect_mask) { bs->rect_mask[bs->rectx * y + x] = FILTER_MASK_USED; } + + if (bs->do_update) { + *bs->do_update = true; + } } static void bake_displacement(void *handle, ShadeInput *UNUSED(shi), float dist, int x, int y) diff --git a/source/blender/render/intern/source/multires_bake.c b/source/blender/render/intern/source/multires_bake.c index 3259608c18f..3ae075b4936 100644 --- a/source/blender/render/intern/source/multires_bake.c +++ b/source/blender/render/intern/source/multires_bake.c @@ -95,6 +95,7 @@ typedef struct { char *texels; const MResolvePixelData *data; MFlushPixel flush_pixel; + short *do_update; } MBakeRast; typedef struct { @@ -162,7 +163,8 @@ static void multiresbake_get_normal(const MResolvePixelData *data, float norm[], } } -static void init_bake_rast(MBakeRast *bake_rast, const ImBuf *ibuf, const MResolvePixelData *data, MFlushPixel flush_pixel) +static void init_bake_rast(MBakeRast *bake_rast, const ImBuf *ibuf, const MResolvePixelData *data, + MFlushPixel flush_pixel, short *do_update) { BakeImBufuserData *userdata = (BakeImBufuserData *) ibuf->userdata; @@ -173,6 +175,7 @@ static void init_bake_rast(MBakeRast *bake_rast, const ImBuf *ibuf, const MResol bake_rast->h = ibuf->y; bake_rast->data = data; bake_rast->flush_pixel = flush_pixel; + bake_rast->do_update = do_update; } static void flush_pixel(const MResolvePixelData *data, const int x, const int y) @@ -240,6 +243,9 @@ static void set_rast_triangle(const MBakeRast *bake_rast, const int x, const int if ((bake_rast->texels[y * w + x]) == 0) { bake_rast->texels[y * w + x] = FILTER_MASK_USED; flush_pixel(bake_rast->data, x, y); + if (bake_rast->do_update) { + *bake_rast->do_update = true; + } } } } @@ -529,7 +535,7 @@ static void do_multires_bake(MultiresBakeRender *bkr, Image *ima, int require_ta handle->height_min = FLT_MAX; handle->height_max = -FLT_MAX; - init_bake_rast(&handle->bake_rast, ibuf, &handle->data, flush_pixel); + init_bake_rast(&handle->bake_rast, ibuf, &handle->data, flush_pixel, bkr->do_update); if (tot_thread > 1) BLI_insert_thread(&threads, handle); |