Fix #108966: multires UDIM bake progress bar exceeds 100%

This commit is contained in:
Brecht Van Lommel
2023-06-16 18:40:18 +02:00
parent 05190a5a23
commit 770616446b

View File

@@ -361,6 +361,7 @@ struct MultiresBakeThread {
MultiresBakeRender *bkr;
Image *image;
void *bake_data;
int num_total_faces;
/* thread-specific data */
MBakeRast bake_rast;
@@ -436,7 +437,7 @@ static void *do_multires_bake_thread(void *data_v)
if (bkr->progress) {
*bkr->progress = (float(bkr->baked_objects) +
float(bkr->baked_faces) / handle->queue->tot_tri) /
float(bkr->baked_faces) / handle->num_total_faces) /
bkr->tot_obj;
}
BLI_spin_unlock(&handle->queue->spin);
@@ -565,6 +566,7 @@ static void do_multires_bake(MultiresBakeRender *bkr,
handle->bkr = bkr;
handle->image = ima;
handle->num_total_faces = queue.tot_tri * BLI_listbase_count(&ima->tiles);
handle->queue = &queue;
handle->data.vert_positions = positions;