Welcome, Guest |
You have to register before you can post on our site.
|
Forum Statistics |
» Members: 5,655
» Latest member: binmohd
» Forum threads: 7,194
» Forum posts: 39,280
Full Statistics
|
Latest Threads |
Script-fu V3 plug-ins
Forum: Extending the GIMP
Last Post: Ofnuts
7 hours ago
» Replies: 4
» Views: 156
|
gui_dbus_name_lost messag...
Forum: Linux and other Unixen
Last Post: Ofnuts
Yesterday, 12:33 AM
» Replies: 1
» Views: 90
|
How to fill a selection w...
Forum: General questions
Last Post: Ofnuts
Yesterday, 12:22 AM
» Replies: 1
» Views: 140
|
Bucket fill not working
Forum: General questions
Last Post: Ofnuts
Yesterday, 12:20 AM
» Replies: 1
» Views: 113
|
Can't drag and drop to re...
Forum: General questions
Last Post: Clovermoth
02-27-2025, 08:10 PM
» Replies: 13
» Views: 18,258
|
How to finish selection p...
Forum: General questions
Last Post: rich2005
02-27-2025, 06:23 PM
» Replies: 1
» Views: 123
|
How to simply move select...
Forum: General questions
Last Post: snowforest
02-27-2025, 06:02 PM
» Replies: 2
» Views: 132
|
HELP! My tablet is laggin...
Forum: General questions
Last Post: andersenman
02-27-2025, 01:43 PM
» Replies: 6
» Views: 7,678
|
Bookmarks are not saved
Forum: Linux and other Unixen
Last Post: JaBo
02-26-2025, 07:23 PM
» Replies: 4
» Views: 227
|
Can not make bookmarks fo...
Forum: Installation and usage
Last Post: JaBo
02-26-2025, 07:20 PM
» Replies: 4
» Views: 219
|
|
|
Let us say with petals |
Posted by: Gimphried - 10-21-2021, 09:15 PM - Forum: Scripting questions
- Replies (2)
|
 |
1. Let us say with petals
Make Flower has been written in Script-Fu by Daniel Bates in 2007.
You can download the free open source Flower_Generator_Script_by_Insanity_Prevails.scm
in the SamRocketMan's github reposity.
Open the .scm script in the free editor Notepad++.
script-fu-register in line 316 has strange NUL characters.
Into the bargain, nowadays, the registration is in two steps. We need to indicate the Gimp menu to call this script in an additional call:
Code:
(script-fu-menu-register "script-fu-make-flower" "<Image>/Filters/Render/Make Flower/")
However don't do it! We do not need to overload the Gimp Graphic User Interface (GUI) with additional menus that are not used daily.
We can call directly make-flower in the Script-Fu console of Gimp 2.10.28 without any registration.
1. In Notepad++, click in the beginning of the line 12 before the opening parenthesis without selecting anything.
2. Press the Notepad++ shortcut Ctrl+Alt+B.
Notepad++ automatically selects the entire function make-flower from line 12 to line 312.
This means that of course the parenthesis are well balanced.
3. Press Ctrl+C in Windows to copy the function in the clipboard.
4. Run Gimp.
5. Gimp menu Filters > Script-Fu > Console
;-> "Welcome to TinyScheme" appears in the top of the Script-Fu console.
6. Paste the content of the clipboard in the input area of the Script-Fu console above the Help button.
Press ENTER
;-> Script-Fu replies by the name of the function:
make-flower
This means that there is not any errors of syntax!
7. Copy in the clipboard by Ctrl+C the following call of the function with all parameters:
Code:
(make-flower 500 2 2 30 1 5 '(230 120 210) '(170 50 150) '(170 170 50))
Press ENTER to run the TinyScheme function.
;->
Oops:
Code:
Error: Bad syntax of binding spec in let* : ((theImage) (theActive) (base-layer) (flower-layer) (petal-layer) (petal2-layer) (petal3-layer) (petal4-layer) (petal5-layer) (petal6-layer) (shade-layer) (map-layer) (varX1) (varY1) (varX2))
8. In Notepad++, select the Let*'s local variables from line 26 to 46:
Code:
(theImage)
(theActive)
(base-layer)
(flower-layer)
(petal-layer)
(petal2-layer)
(petal3-layer)
(petal4-layer)
(petal5-layer)
(petal6-layer)
(shade-layer)
(map-layer)
(varX1)
(varY1)
(varX2)
The initial value is missing for each local variable. Fortunately, they are all integers.
10. To fix the issue, Notepad++ menu Search > Replace...
11. In the dlgbox "Replace", 2nd tab "Replace",
Find what: ")"
Enter the closing parenthesis without the double quotes.
Replace with: " 0)"
Enter a space separator before the initial value, then the initial value 0 and the closing parenthesis.
Do not enter the double quotes.
Check the option [x] in selection
Press the Replace All button
The expected result must be:
Code:
(theImage 0)
(theActive 0)
(base-layer 0)
(flower-layer 0)
(petal-layer 0)
(petal2-layer 0)
(petal3-layer 0)
(petal4-layer 0)
(petal5-layer 0)
(petal6-layer 0)
(shade-layer 0)
(map-layer 0)
(varX1 0)
(varY1 0)
(varX2 0)
12. Repeat steps 1-7
;-> The script draws the pink flower with 8 petals on 500x500 pixels.
make-flowerPetal8.webp (Size: 6.96 KB / Downloads: 246)
The Layer window shows the following layers:
- Shading
- Centre Shading
- Centre
- Flower
- Background
|
|
|
Default Directory |
Posted by: zeuspaul - 10-19-2021, 10:01 PM - Forum: General questions
- Replies (3)
|
 |
Is there a way to set a default folder for opening and saving files? For one reason or another I have to reopen Gimp maybe a freeze in Gimp or my computer has to be booted for some reason.
Every time I open Gimp it wants to go to recent files and then I have to navigated down through a file tree to get to the folder that contains my files. Then I have to remember to navigate once again to save a file to the same file folder or files end up where I don't want them. Once I do it once in a session it remembers for the rest of the session.
Can I set this up to remember the same folder I use for all of my Gimp work? I haven't found anything in edit preferences.
|
|
|
Thank you Rich. |
Posted by: david - 10-18-2021, 09:25 AM - Forum: Watercooler
- No Replies
|
 |
Last night I decided to install GIMP 2.10.28 from the Panda Jim PPA.
Thanks to all the information and files provided by Rich, it was a straightforward and simple process.
I now have a fully working installation with the latest GMIC.
|
|
|
|