It is currently 05 Jun 2020, 23:33

• Featuring Members' Works (Image Attachments) •
1: member
2: member
3: member
4: member
5: member

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

simple first script

Share your Scheme Fu scripts for GIMP here
Post Reply
sweeneyMark
Forum Member

simple first script

Post#1 by sweeneyMark » 12 Dec 2019, 20:37


Hi,

I'm trying to write the most basic kind of script.
It pastes whatever is in the clipboard to a new layer.
Then sets that layer to 80% opacity.


Here's my "shell" of a script.
I think it's passing the image name (img), and current layer (drawable) to the function.
How would one then paste as new layer and set the opacity to 80% ?




(define (PasteAsNewLayer80 img drawable)

;Stuff here

(gimp-displays-flush)
)


(script-fu-register "PasteAsNewLayer80"
"<Image>/Filters/PasteNewLayer80"
"PasteAsNewLayer at 80 opacity"
""
""
""
""
SF-IMAGE "Image" 0
SF-DRAWABLE "Drawable" 0

)
GIMP Learn rocks...
0

sweeneyMark
Forum Member

Post#2 by sweeneyMark » 13 Dec 2019, 14:24


(define (PasteAsNewLayer80 img drawable)

(let*
(
(parent (car (gimp-item-get-parent drawable)))
(layername (car (gimp-item-get-name drawable)))
(position (car (gimp-image-get-item-position img drawable)))
(newlayer 0)
)

(gimp-image-undo-group-start img)
(set! newlayer (car (gimp-edit-paste drawable 1)))
(gimp-floating-sel-to-layer newlayer)
(gimp-image-reorder-item img newlayer parent position)
(gimp-selection-none img)
(gimp-layer-set-opacity newlayer 80)
(gimp-displays-flush)
(gimp-image-undo-group-end img)

)

)
GIMP Learn rocks...
0

tim
GL Blogger

Post#3 by tim » 13 Dec 2019, 15:31


sorry I don't do scheme anymore
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


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

Who is online

Users browsing this forum: No registered users and 1 guest