Fix T40751 preview image not generated after baking.
A DAG_id_tag_update here is enough to fix the problem.
This commit is contained in:
parent
d76d3144b4
commit
f2c8209756
Notes:
blender-bot
2023-02-14 10:27:12 +01:00
Referenced by issue #40751, Bake preview missing (UV/Image Editor)
|
@ -682,6 +682,7 @@ static void finish_bake_internal(BakeRender *bkr)
|
|||
}
|
||||
|
||||
BKE_image_release_ibuf(ima, ibuf, NULL);
|
||||
DAG_id_tag_update(&ima->id, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -56,6 +56,7 @@
|
|||
#include "BKE_modifier.h"
|
||||
#include "BKE_mesh.h"
|
||||
#include "BKE_screen.h"
|
||||
#include "BKE_depsgraph.h"
|
||||
|
||||
#include "RE_engine.h"
|
||||
#include "RE_pipeline.h"
|
||||
|
@ -260,13 +261,14 @@ static bool write_internal_bake_pixels(
|
|||
}
|
||||
|
||||
/* force OpenGL reload */
|
||||
static void reset_images_gpu(BakeImages *bake_images)
|
||||
static void refresh_images(BakeImages *bake_images)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < bake_images->size; i++) {
|
||||
Image *ima = bake_images->data[i].image;
|
||||
if (ima->ok == IMA_OK_LOADED) {
|
||||
GPU_free_image(ima);
|
||||
DAG_id_tag_update(&ima->id, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -966,7 +968,7 @@ cage_cleanup:
|
|||
}
|
||||
|
||||
if (is_save_internal)
|
||||
reset_images_gpu(&bake_images);
|
||||
refresh_images(&bake_images);
|
||||
|
||||
cleanup:
|
||||
|
||||
|
|
|
@ -42,6 +42,7 @@
|
|||
#include "BLI_threads.h"
|
||||
|
||||
#include "BKE_ccg.h"
|
||||
#include "BKE_depsgraph.h"
|
||||
#include "BKE_global.h"
|
||||
#include "BKE_image.h"
|
||||
#include "BKE_multires.h"
|
||||
|
@ -1297,6 +1298,7 @@ static void finish_images(MultiresBakeRender *bkr, MultiresBakeResult *result)
|
|||
}
|
||||
|
||||
BKE_image_release_ibuf(ima, ibuf, NULL);
|
||||
DAG_id_tag_update(&ima->id, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue