Post Reply 

Problems with gimp-edit-bucket-fill

Apr 6, 2012, 00:31
Post: #1
Problems with gimp-edit-bucket-fill
Hello, I'm having trouble using script-fu and getting gimp-edit-bucket-fill to work. I tried using this call in a script, but it had no effect. Figured I was doing something wrong with layers or selection, as is often the case. But when I try it in the console, it has no effect. Here's what I tried:

1. Upgraded to the latest gimp version (2.6.12) on Windows (Vista Pro SP2).
2. Closed gimp and restarted it.
3. File > New... and then use all defaults except under advanced I set the fill to BG (white).
4. Filters > Script-fu > Console and then Browse to find gimp-edit-bucket-fill.
5. Enter the following in the console:

> (gimp-edit-bucket-fill 1 0 0 100 10 TRUE 0 0)

1 is the drawable, found by trial and error
0 for FG-BUCKET-FILL (should be black)
100 opacity
10 threshold (0 should work too, but just in case)
TRUE for sample-merged (shouldn't matter because I don't have layers)
o o as x and y coordinates (shouldn't matter because new image is all white)

But nothing happens, my image is still white. I tried a lot of other combinations, never any fill as I expect. Other script-fu console commands modify the image, but not this one. The bucket fill tool in the UI works using the mouse as normal. What am I missing?
Find all posts by this user
Quote this message in a reply
Apr 6, 2012, 17:35
Post: #2
RE: Problems with gimp-edit-bucket-fill
You're right, I was getting the wrong drawable. I was just using the first one that didn't give me an error, given that my new image has only [Base Image]. But

> (gimp-image-get-active-drawable 1) ; where 1 is the image, found by trial and error :-)

And then

> (gimp-edit-bucket-fill 2 0 0 100 10 FALSE 1 1)

does work as expected. I swear I'd used gimp-image-get-active-drawable in other attempts, and had the right drawable, but I guess not. In any case, debugging with the script-fu console would be easier if it had built-ins for curImage and curDrawable like a script.

And now I found why the bucket fill wouldn't work in a script: before editing my script (MyBorder.scm), I saved it as MyBorderOriginal.scm. But since it was still in the script folder with .scm extension, gimp was loading both files and the original was overwriting my new one. DOH!

In any case, thanks for your help ofnuts, after 2 days of trying various things, it showed me the right path.
Find all posts by this user
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  GIMP Resynthesizer Plugin not working Mikkel Andersen 1 341 Jun 26, 2018 16:36
Last Post: paynekj
  Tablet issues with GIMP 2.10 Phoenisca 1 521 May 30, 2018 14:30
Last Post: paynekj
  addonCollectionManager-3.0 on Gimp 2.10.2 (Solved) Pocholo 0 296 May 26, 2018 02:26
Last Post: Pocholo
  Gimp 2.10 with old vignette from Plugin registry. DenisT 2 244 May 19, 2018 20:42
Last Post: DenisT
  Problems with a bat script :( ThaUnknown_ 1 378 Mar 26, 2018 21:14
Last Post: paynekj

Forum Jump:

GIMP ForumPortalArchiveContactTermsRSS