It is currently 16 Dec 2017, 01:10

GIMP Python Fu ScriptsProof of concept recordable actions (Showcase | Slideshow)

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

Administrator
View: Showcase | Slideshow
Topic Posts: 3/5
Posts: 2000
Joined: 25 Sep 2016, 17:16
Cash on hand: 6,288.73 GLP
Bank: 41,331.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 1005
x 217
Contact:
Canada

Proof of concept recordable actions

Post#1 by tim » 07 Dec 2016, 23:46


You need to create a folder called "recordings" under your user's GIMP's folder
like mine is C:\Users\Tin Tran\.gimp-2.8\recordings\
download below file.
:download:
record_scripts.zip #
zipped .py file (unzip, put in your GIMP's /plug-ins/ folder)
(2.26 KiB) Downloaded 32 times
:download:
record_scripts (2).zip #
version 2 - will create GIMP's /recordings/ directory for you if not yet exists.
(2.36 KiB) Downloaded 21 times
:download:
record_scripts (3).zip #
version 3 - put a path separator between ~ and .gimp-2.8 (might be a linux thing only).
(2.41 KiB) Downloaded 23 times
:download:
record_scripts (4).zip #
version 4 - allow more fill-types for "Fill Layer" like the actual procedure allows.
(2.5 KiB) Downloaded 40 times
You'll have access to Python-Fu/Record/
01 New Recording - where you'll specify a filename (.txt) file to save recordings to.
02 Run Recording - where you'll select a file to run recordings from.

and as proof of concept, i have written 4 recordable actions.
- Change Foreground color
- Fill layer with foreground color
- Gaussian Blur
- Set Active Layer

color-coded menu and macros options to show what you can do with the predefined actions.
recordable_macros.png
recordable_macros.png # (119.83 KiB) Viewed 424 times (Watermarked | Thumbnail)
1. You would run "01 New Recording" and specify a filename to save to.
2. Then run a series of combinations of the 4 available functions. They would save to file specified in step 1.
3. Then you can run "02 Run Recording" and select the filename you have entered in step 1. and it would run all steps performed in step 2. (like replaying a recording)
0 x



aka Tin
Image gimplearn.net                                              

Registered members enjoy ads-free content
No avatar
rich2005
GIMP Guru
View: Showcase | Slideshow
Topic Posts: 2/5
Posts: 49
Joined: 15 Oct 2016, 12:47
Cash on hand: 473.60 GLP
x 10
Great Britain

Post#2 by rich2005 » 08 Dec 2016, 05:13


Interesting, Gimp badly needs a macro function. At the moment, I can use BIMP and a saved script (.bimp) This works on file-on-disk so needs image refreshing to show results. Not wonderful.

however record_scripts.py in linux gives this

Code: Select all

 File "/home/rich/.gimp-2.8/plug-ins/record_scripts.py", line 43, in <module>
    file = open(u'' + (working_directory + ini_file),'w')
IOError: [Errno 2] No such file or directory: u'~.gimp-2.8/recordings/activefilename.ini'
I do have the recordings folder, but obviously no activefilename.ini
0 x




User avatar
tim

Administrator
View: Showcase | Slideshow
Topic Posts: 3/5
Posts: 2000
Joined: 25 Sep 2016, 17:16
Cash on hand: 6,288.73 GLP
Bank: 41,331.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 1005
x 217
Contact:
Canada

Post#3 by tim » 08 Dec 2016, 08:38


You need to create a folder called "recordings" under your GIMP's folder.

EDIT: Please give version 3 a try, it'll create "recordings" folder for you if not yet exists.
0 x



aka Tin
Image gimplearn.net                                              

No avatar
rich2005
GIMP Guru
View: Showcase | Slideshow
Topic Posts: 2/5
Posts: 49
Joined: 15 Oct 2016, 12:47
Cash on hand: 473.60 GLP
x 10
Great Britain

Post#4 by rich2005 » 08 Dec 2016, 10:18


admin wrote:You need to create a folder called "recordings" under your GIMP's folder.

EDIT: Please give version 3 a try, it'll create "recordings" folder for you if not yet exists.
Testing report ;)

version 1, Well I did have a recordings folder in Gimp profile and aforementioned error occured.
version 2, That did indeed create a folder ~recordings in my home partition
(linux shorthand for that would be ~/~recordings) too many ~
hardly had time to check that when along came

version 3 /recordings in Gimp profile.
run a couple of of your procedures and get in action_default.txt

Code: Select all

gimp_context_set_foreground (222,165,165)
gimp_image_set_active_layer image 0
plug_in_gauss image layer 5.0 5.0 1
Thats looks like progress, next some way of adding all Gimps pdb functions into some sort of interface.
That is where BIMP gets very messy, they are all there + some 3rd party plugins, basic but even something like BIMP that works on the active image will be great.

Just seen version 4 is out :)
0 x




User avatar
tim

Administrator
View: Showcase | Slideshow
Topic Posts: 3/5
Posts: 2000
Joined: 25 Sep 2016, 17:16
Cash on hand: 6,288.73 GLP
Bank: 41,331.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 1005
x 217
Contact:
Canada

Post#5 by tim » 08 Dec 2016, 10:25


You can run "01 New Recording" to define your own new recording file.
and it'll start saving to that file.
Which you can select when you choose "02 Run Recording"
0 x



aka Tin
Image gimplearn.net                                              

Post Reply

Last 20 Members Who Visited This Topic

User avatar Steve Reid (1), User avatar gnerd (1)

• Featuring Members' Works (Image Attachments Only) •
1: Ella
2: leopardo-40
3: RJKD
4: oldmangrumpy
5: Issabella
6: oldmangrumpy
7: oldmangrumpy

Who is online

Users browsing this forum: No registered users and 1 guest