Skip to content

Commit

Permalink
Read history: commiting blend params needs to be done after fetching …
Browse files Browse the repository at this point in the history
…masks from DB

It's confusing because (parametric) blending operations are fetched in the same SQL query as module params, but masks are not. They have their own method and their own SQL query that needs to update the existing history stack.

So we just need to commit blendops (including raster masks) after that step of history fetching.

Fix Bug: Raster masks broken #396
  • Loading branch information
aurelienpierre committed Jan 11, 2025
1 parent 55e40ef commit cf52835
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/develop/develop.c
Original file line number Diff line number Diff line change
Expand Up @@ -1616,9 +1616,6 @@ static void _sync_blendop_params(dt_dev_history_item_t *hist, const void *blendo
{
memcpy(hist->blend_params, hist->module->default_blendop_params, sizeof(dt_develop_blend_params_t));
}

// Copy and publish the masks on the raster stack for other modules to find
dt_iop_commit_blend_params(hist->module, hist->blend_params);
}

static int _sync_params(dt_dev_history_item_t *hist, const void *module_params, const int param_length,
Expand Down Expand Up @@ -1822,7 +1819,16 @@ void dt_dev_read_history_ext(dt_develop_t *dev, const int imgid, gboolean no_ima
dt_ioppr_check_iop_order(dev, imgid, "dt_dev_read_history_no_image end");

// Update masks history
// Note: until there, we had only blendops. No masks
dt_masks_read_masks_history(dev, imgid);

// Copy and publish the masks on the raster stack for other modules to find
for(GList *history = g_list_first(dev->history); history; history = g_list_next(history))
{
dt_dev_history_item_t *hist = (dt_dev_history_item_t *)history->data;
dt_iop_commit_blend_params(hist->module, hist->blend_params);
}

dt_dev_masks_list_change(dev);

dt_print(DT_DEBUG_HISTORY, "[history] dt_dev_read_history_ext completed\n");
Expand Down

0 comments on commit cf52835

Please sign in to comment.