02-01-2023, 10:40 AM
(This post was last modified: 02-01-2023, 11:23 AM by salamander017.)
(02-01-2023, 09:54 AM)programmer_ceds Wrote:(02-01-2023, 09:35 AM)salamander017 Wrote: I have updated the script, but now I get an Error: not enough argumentsTry reading what I wrote about setting layer1 and layer2 using aref !
I may have wrong idea about the (gimp-image-get-layers) so please correct me
Sorry I forgot to mention, but I also tried this and also returned the same error: not enough arguments.
Kindly see below script. Thank you. Sorry I am still learning.
(define (script-fu-gimpcompare3 num_layers image layers layer1 layer2)
(let*(
(num_layers (cad (gimp-image-get-layers image)))
(layers (cadr (gimp-image-get-layers image)))
(layer1 (aref layers 0))
(layer2 (aref layers 1))
)
(plug-in-exchange RUN-NONINTERACTIVE image layer1 0 0 0 0 0 255 0 0 0)
(plug-in-exchange RUN-NONINTERACTIVE image layer2 0 0 0 255 0 0 0 0 0)
(gimp-layer-set-mode layer1 LAYER-MODE-MULTIPLY)
(gimp-layer-set-mode layer2 LAYER-MODE-MULTIPLY)
(gimp-displays-flush)
)
)
(script-fu-register
"script-fu-gimpcompare3"
"<Image>/Script-Fu/gimpcompare3"
"blue red multiply"
"Test"
"Test"
"2022"
"RGB*"
SF-IMAGE "Image" 0
)
EDIT:
OKAY I got it. I didnt need to put the variables for let inside the function. Thank you