It is currently 13 Dec 2019, 09:11


GIMP/GL:  Tutorials | Tips | Questions | Interests | Script Requests
Recommendations:  Index | Top 10
Resources:  🡆 Python-Fu Plug-ins | Scheme-Fu Scripts | GIMP
Python:  Lessons | Questions | Exercises
The Arts:  GIMPed | GIMPed Photos | Other | Contests | Public Domain Images | Isolated Images | Blender
Inkscape
Social:  Say Hello | Anything Goes | Shares | FCSP

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

Share your Python Fu Scripts/plug-ins for GIMP here
Post Reply
tim
GL Blogger

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
aka Tin
:tree_02:
Tin's: Favorite Index | Simple Art === fb4yt video search | fb4yt recent video views report
Lottery numbers from image | Interested Members in TLF
Paying for hosting is to support my hobby, and donating money made from ads to The Red Cross.
         
0

tim
GL Blogger

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.
aka Tin
:tree_02:
Tin's: Favorite Index | Simple Art === fb4yt video search | fb4yt recent video views report
Lottery numbers from image | Interested Members in TLF
Paying for hosting is to support my hobby, and donating money made from ads to The Red Cross.
         
0

gnerd
Forum Member

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

PhotoMaster
Global Moderator

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!
Artists Aren't Crazy...
We're Eccentric!
0


GIMP/GL:  Tutorials | Tips | Questions | Interests | Script Requests
Recommendations:  Index | Top 10
Resources:  🡆 Python-Fu Plug-ins | Scheme-Fu Scripts | GIMP
Python:  Lessons | Questions | Exercises
The Arts:  GIMPed | GIMPed Photos | Other | Contests | Public Domain Images | Isolated Images | Blender
Inkscape
Social:  Say Hello | Anything Goes | Shares | FCSP

Post Reply
  • Similar Topics
    Replies
    Views
    Last post
• Featuring Members' Works (Image Attachments) •
1: member
2: member
3: member
4: member
5: member

Who is online

Users browsing this forum: No registered users and 13 guests