I am a rookie in scripting-fu , I am sure that I am missing a very basic thing.
I have written a very simple script (unfold.scm) sometime ago, which was working in previous versions of Gimp. But i could not manage it to work as expected in 2.8.
The script is supposed to unfold (copy + flip) 4 times an image to create tileable textures.
Eg:
input image:
/
Output image:
/ \
\ /
However, output becomes as: /
The script is attached.
I appreciate any help.
| Attachment | Size |
|---|---|
| 2.73 KB | |
| 612 bytes | |
| 760 bytes | |
| 707 bytes |
What happens in 2.8?
What happens in 2.8?
Please see the 3 images added
Please see the 3 images added.
Thnx.
Put these lines in comment...
Hello,
;; (gimp-image-undo-group-start theImage);; (gimp-image-undo-group-end theImage)The pasted layer is beyond the scope of the image.
example: gimp-flip => "Deprecated: Use 'gimp-item-transform-flip-simple' instead."(define (script-fu-unfold
EDIT:
(set! floating-sel (car (gimp-image-get-active-layer theImage)))__________________
(define (script-fu-unfold inImage inLayer)
(let
(
(theHeight (* (car (gimp-image-height inImage)) 2))
(theWidth (* (car (gimp-image-width inImage)) 2))
(theImage inImage)
(theLayer 0)
)
(gimp-image-undo-group-start inImage)
(gimp-image-resize theImage theWidth theHeight 0 0)
(set! theLayer (car (gimp-image-get-active-layer theImage)))
(gimp-layer-add-alpha theLayer)
(gimp-layer-resize-to-image-size theLayer)
(gimp-context-set-transform-resize TRANSFORM-RESIZE-ADJUST)
(gimp-selection-all theImage)
(gimp-edit-copy theLayer)
(let ((floating-sel (car (gimp-edit-paste theLayer FALSE))))
(gimp-item-transform-flip-simple floating-sel ORIENTATION-VERTICAL TRUE 0)
(gimp-floating-sel-anchor floating-sel)
)
(gimp-selection-all theImage)
(gimp-edit-copy theLayer)
(let ((floating-sel (car (gimp-edit-paste theLayer FALSE))))
(gimp-item-transform-flip-simple floating-sel ORIENTATION-HORIZONTAL TRUE 0)
(gimp-floating-sel-anchor floating-sel)
)
(gimp-image-undo-group-end inImage)
(gimp-displays-flush)
)
)
Thanks
Thank you very much both for the tips and the re-written code.
You saved my days froGgy factory.