0

I'm typing this code directly into Gimp's Python Console:

img=gimp.image_list()[0]
drw = pdb.gimp_image_active_drawable(img)
gimp-drawable-set-pixel(drw,x,y,3,[0xff,0x00,0x00])

and it's yeilding this error after calling the gimp-drawable-set-pixel function:

Traceback (most recent call last):
  File "<input>", line 1, in <module>
NameError: name 'drawable' is not defined

It yields the same error when called with four bytes instead of three bytes as well.

I'm using gimp 2.8.10 on Ubuntu 14.04.01 x86_64

Tyzoid
  • 1,072
  • 13
  • 31

1 Answers1

2

I think it's a typo of gimp_drawable_set_pixel.

pdb.gimp_drawable_set_pixel(drw,x,y,3,[0xff,0x00,0x00])
falsetru
  • 357,413
  • 63
  • 732
  • 636
  • then I get `NameError: name 'gimp_drawable_set_pixel' is not defined`, but I think you are on to something. – Tyzoid Sep 01 '14 at 13:55
  • @Tyzoid, What happend if you qualify the function with `pdb.` ? – falsetru Sep 01 '14 at 13:56
  • 1
    It is not a "typo" - the GIMP Procedure browser shows the procedures with the Scheme (script-fu) friendly name, which uses "-" as word separator. In Python and all C derived languages, that would just mean a subtraction, so "_" is used. If one click on the "browse" button at the bottom of the Python console, and browse through there, there is an "apply" button which pastes the correct name in the console already. – jsbueno Sep 02 '14 at 12:08