I have a python-fu script, which is mostly working. It scans a layer looking for a color, rectangular selects contiguous areas of that color, copies the portion of image in another layer covered by that selection, and saves it to a separate file. All good.
Now the rectangular select has to be cleared, so that it won't be selected again as part of some other set, and the scan starts over so that it can find the next contiguous rectangular block to save.
Unfortunately, I can see the scan traverse the area that's been cleared, and the debug output shows that it still thinks the color is there. Despite the fact that I can see the area is transparent. So, I must be missing a step that tells gimp to update.
I thought I had it with the following:
pdb.gimp_edit_clear(layer)
pdb.gimp_drawable_update(layer,0,0,width,height)
gimp_edit_clear
does clear the selection in the layer I'm searching -- I see that happen -- but the gimp_drawable_update
doesn't seem to do anything, because when the loop progresses over the spot that's been cleared, it reports that the old color is still there.
What am I missing?