It is currently 19 Feb 2018, 17:26

GIMP Python Fu ScriptsPF_ constants or variables defined for inputs for Python Fu scripts for GIMP (Showcase | Slideshow)

Share your Python Fu scripts for GIMP here
Post Reply
User avatar
tim

Administrator
View: Showcase | Slideshow
Topic Posts: 2/4
Posts: 2157
Joined: 26 Sep 2016, 00:16
Cash on hand: 7,894.01 GLP
Bank: 51,356.25 GLP
Gender: Guy
Location: Victoria, BC
Website: https://gimplearn.net
Operating System: Windows
GIMP Version: 2.8.22
My Personal Blog
My FineArtAmerica
x 1196
x 256
Contact:
Canada

PF_ constants or variables defined for inputs for Python Fu scripts for GIMP

Post#1 by tim » 23 Feb 2017, 02:51


This file seems to define all the possible PF_ constants/variables that are used in Python Fu to accept inputs from user.
It's here for future reference.
I have ran into it before but keep forgetting how to search for it... and I tend to search for "PF_ constants" or "PF_ variables" so here it is.
https://www.google.ca/url?sa=t&rct=j&q= ... 2_3tl0Krrg
0 x



aka Tin
Image gimplearn.net                                              

Registered members enjoy ads-free content
User avatar
tim

Administrator
View: Showcase | Slideshow
Topic Posts: 2/4
Posts: 2157
Joined: 26 Sep 2016, 00:16
Cash on hand: 7,894.01 GLP
Bank: 51,356.25 GLP
Gender: Guy
Location: Victoria, BC
Website: https://gimplearn.net
Operating System: Windows
GIMP Version: 2.8.22
My Personal Blog
My FineArtAmerica
x 1196
x 256
Contact:
Canada

Post#2 by tim » 19 Oct 2017, 19:36


What's important to note is this portion code that can be cut and pasted to use as parameters in python fu code

Code: Select all

(PF_INT, "p0", "_INT:", 0), # PF_INT8, PF_INT16, PF_INT32  similar but no difference in Python.
          (PF_FLOAT, "p02", "_FLOAT:", 3.141),
          (PF_STRING, "p03", "_STRING:", "foo"),  # alias PF_VALUE
          (PF_TEXT, "p04", "TEXT:", "bar"),
          # PF_VALUE
          # Pick one from set of choices
          (PF_OPTION,"p1",   "OPTION:", 0, ["0th","1st","2nd"]), # initially 0th is choice
          (PF_RADIO, "p16", "RADIO:", 0, (("0th", 1),("1st",0))), # note bool indicates initial setting of buttons
          # PF_RADIO is usually called a radio button group.
          # SLIDER, ADJUSTMENT types require the extra parameter of the form (min, max, step).
          (PF_TOGGLE, "p2",   "TOGGLE:", 1), # initially True, checked.  Alias PF_BOOL
          # PF_TOGGLE is usually called a checkbox.
          (PF_SLIDER, "p3", "SLIDER:", 0, (0, 100, 10)),
          (PF_SPINNER, "p4", "SPINNER:", 21, (1, 1000, 50)),  # alias PF_ADJUSTMENT
          # Pickers ie combo boxes ie choosers from lists of existing Gimp objects
          (PF_COLOR, "p14", "_COLOR:", (100, 21, 40) ), # extra param is RGB triple
          # PF_COLOUR is an alias by aussie PyGimp author lol
          (PF_IMAGE, "p15", "IMAGE:", None), # should be type gimp.image, but None works
          (PF_FONT, "p17", "FONT:", 0),
          (PF_FILE, "p18", "FILE:", 0),
          (PF_BRUSH, "p19", "BRUSH:", 0),
          (PF_PATTERN, "p20", "PATTERN:", 0),
          (PF_GRADIENT, "p21", "GRADIENT:", 0),
          (PF_PALETTE, "p22", "PALETTE:", 0),
          (PF_LAYER, "p23", "LAYER:", None),
          (PF_CHANNEL, "p24", "CHANNEL:", None),  # ??? Usually empty, I don't know why.
          (PF_DRAWABLE, "p25", "DRAWABLE:", None),
          # Mostly undocumented, but work
          (PF_VECTORS, "p26", "VECTORS:", None),
          (PF_FILENAME, "p27", "FILENAME:", 0),
          (PF_DIRNAME, "p28", "DIRNAME:", 0)
          # PF_REGION might work but probably of little use.  See gimpfu.py.
0 x



aka Tin
Image gimplearn.net                                              

User avatar
gnerd
Forum Member
View: Showcase | Slideshow
Topic Posts: 1/4
Posts: 1214
Joined: 19 Jun 2017, 22:29
Cash on hand: 8,112.41 GLP
Gender: Gal
Location: NC
Operating System: Windows
GIMP Version: 2.9.5
x 188
x 417
United States of America

Post#3 by gnerd » 19 Oct 2017, 21:41


Thank you Tin for all your hard work. I'm still on a STEEP learning curve but I have a lot of bookmarks as I continue to learn!
0 x




User avatar
PhotoMaster
Global Moderator
View: Showcase | Slideshow
Topic Posts: 1/4
Posts: 23
Joined: 11 Nov 2017, 18:55
Cash on hand: 60.61 GLP
Gender: Guy
Location: Lanoka Harbor
Website: https://www.flickr.com/photos/photomastergreg
Operating System: Windows
GIMP Version: 2.8.18
x 13
x 14
Gimp Nation

Post#4 by PhotoMaster » 21 Nov 2017, 17:07


I've written Script-Fu before (a long time ago) but I need to learn Python-Fu. This should be quite helpful!

Thanks Muchly!
0 x



Artists Aren't Crazy...
We're Eccentric!

Post Reply

Last 20 Members Who Visited This Topic

User avatar tim (16), User avatar Pat625 (3), User avatar leopardo-40 (1), User avatar gnerd (5), User avatar animicule (2), User avatar RJKD (2), User avatar PhotoMaster (2), User avatar Issabella (1), User avatar Steve Reid (2)

  • Similar Topics
    Replies
    Views
    Last post
• Featuring Members' Works (Image Attachments Only) •
1: david
2: Pat625
3: gnerd
4: Conbagui
5: Conbagui
6: gnerd
7: animicule

Who is online

Users browsing this forum: No registered users and 2 guests