04-23-2020, 07:57 PM
Hi fellow GIMP users. I posted the same question @gimpchat.com. I been having an error on the line (gimp-floating-sel-anchor floating-sel) "eval: unbound variable: floating-sel". what should I do. Please explain how can I avoid this error when I write other scripts. Thank you in advanced.
Code:
(define (script-fu-create-heart)
(let* (
(img (car (gimp-image-new 500 500 RGB)))
(layer (car (gimp-layer-new img 500 500 RGB-IMAGE "Background" 100 LAYER-MODE-NORMAL)))
(theheart (car (gimp-layer-new img 500 500 RGB "Heart" 100 LAYER-MODE-NORMAL)))
)
;Create the Background
(gimp-image-undo-disable img) ; Disable undo during the image creation
(gimp-image-insert-layer img layer 0 0)
(gimp-context-set-foreground '(000 000 00))
(gimp-drawable-fill layer FILL-FOREGROUND)
;Create the heart layer
(gimp-image-add-layer img theheart -1)
(gimp-layer-add-alpha theheart)
(gimp-drawable-fill theheart FILL-TRANSPARENT)
;Create the heart image
(gimp-image-select-ellipse img 2 60 105 385 285)
(gimp-image-select-rectangle img 1 30 50 440 200)
(gimp-image-select-ellipse img 0 58 143 385 215)
(gimp-context-set-foreground '(221 0 0))
(gimp-drawable-edit-fill theheart FILL-FOREGROUND)
(gimp-item-transform-rotate theheart 45.00 TRUE 250.50 268.00)
(gimp-floating-sel-anchor floating-sel)
(gimp-image-undo-enable img)
(gimp-display-new img)