Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
small plugin code help
#16
This is because you used dashes (gimp-drawable-edit-clear) instead of underscores: (gimp_drawable_edit_clear). For Python you are therefore trying to subtract a variable called drawable from pdb.gimp. The Python doc is auto-generated and since the same text is used for script-fu and python-fu, there are things to adapt:
  • all dashes become underscores
  • object IDs in script-fu are plain objects in Python (so you get a gimp.Image object, not an integer)
  • when there is no object instead of using the -1 ID you use None
Also, don't use image.active_layer. If you script registration is correct, your script is passed a layer as the second argument and this is the layer you should work with. Using image.active_layer doesn't do you any good because if the active drawable isn't a layer (because it is a mask/channel), then image.active_layer returns None.
Reply


Messages In This Thread
small plugin code help - by gimpygirl - 02-29-2024, 07:21 PM
RE: small plugin code help - by Ofnuts - 02-29-2024, 11:54 PM
RE: small plugin code help - by gimpygirl - 03-01-2024, 12:25 AM
RE: small plugin code help - by Ofnuts - 03-01-2024, 08:02 AM
RE: small plugin code help - by gimpygirl - 03-01-2024, 08:31 PM
RE: small plugin code help - by Ofnuts - 03-01-2024, 09:48 PM
RE: small plugin code help - by gimpygirl - 03-01-2024, 11:18 PM
RE: small plugin code help - by Ofnuts - 03-02-2024, 01:41 AM
RE: small plugin code help - by gimpygirl - 03-02-2024, 03:35 AM
RE: small plugin code help - by Ofnuts - 03-02-2024, 09:10 AM
RE: small plugin code help - by gimpygirl - 03-02-2024, 06:56 PM
RE: small plugin code help - by Ofnuts - 03-01-2024, 09:41 PM
RE: small plugin code help - by MrsP-from-C - 03-02-2024, 07:56 PM
RE: small plugin code help - by Ofnuts - 03-02-2024, 08:58 PM
RE: small plugin code help - by gimpygirl - 03-02-2024, 11:05 PM
RE: small plugin code help - by Ofnuts - 03-03-2024, 12:35 AM
RE: small plugin code help - by gimpygirl - 03-03-2024, 01:42 AM
RE: small plugin code help - by Ofnuts - 03-03-2024, 05:09 PM

Forum Jump: