Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
changing active layers
#10
(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 arguments 
I may have wrong idea about the (gimp-image-get-layers) so please correct me
Try reading what I wrote about setting layer1 and layer2 using aref !

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
Reply


Messages In This Thread
changing active layers - by salamander017 - 01-29-2023, 06:54 AM
RE: changing active layers - by programmer_ceds - 01-29-2023, 10:57 AM
RE: changing active layers - by salamander017 - 01-29-2023, 12:47 PM
RE: changing active layers - by programmer_ceds - 01-29-2023, 05:25 PM
RE: changing active layers - by salamander017 - 01-30-2023, 01:35 PM
RE: changing active layers - by Ofnuts - 01-31-2023, 11:25 AM
RE: changing active layers - by salamander017 - 02-01-2023, 09:35 AM
RE: changing active layers - by programmer_ceds - 02-01-2023, 09:54 AM
RE: changing active layers - by salamander017 - 02-01-2023, 10:40 AM
RE: changing active layers - by Ofnuts - 01-29-2023, 09:10 PM

Forum Jump: