Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Error: Not enough arguments?
#3
Hello Pocholo, Smile

The problem is : your script has two different layers names : baseLayer and theLayer
Only one is needed : theLayer

Other details :
- None argument has to be passed to your script, so "construtor" is only the script name
- Undo group (start/end) is useful when a script modify an image, for image generator use undo (disable/enable)
- Indent with tabs instead of spaces
- Comment to explain what the code does

Have fun. Smile
@+++

Code:
; "New Image" image generator (new-image.scm)
; This script creates an image 500 x 500 filled with white background
; Pocholo
; 2020/04/19
;

(define (script-fu-new-image)
    (let* (
        (theImage  (car (gimp-image-new 500 500 RGB)))
        (theLayer (car (gimp-layer-new theImage 500 500 RGB-IMAGE "Wood" 100 LAYER-MODE-NORMAL)))
       )

        (gimp-image-undo-disable theImage)    ; Disable undo during the image creation

        (gimp-image-insert-layer theImage theLayer 0 0)
        (gimp-drawable-fill theLayer FILL-WHITE)
        (gimp-display-new theImage)

        (gimp-image-undo-enable theImage)    ; Enable undo for future modifications
    )
)

(script-fu-register
   "script-fu-new-image"                        
   "<Image>/File/Create/New image..."
    "Creates a New image"    
    "Pocholo"                            
    "Pocholo"
    "March 2020"                          
    ""
)
Reply


Messages In This Thread
Error: Not enough arguments? - by Pocholo - 04-18-2020, 03:52 PM
RE: Error: Not enough arguments? - by Ofnuts - 04-18-2020, 04:12 PM
RE: Error: Not enough arguments? - by JimmyMarco - 04-19-2020, 07:44 AM
RE: Error: Not enough arguments? - by Ofnuts - 04-19-2020, 09:18 AM
RE: Error: Not enough arguments? - by Pocholo - 04-21-2020, 03:17 AM
RE: Error: Not enough arguments? - by Ofnuts - 04-21-2020, 06:28 AM
RE: Error: Not enough arguments? - by Kevin - 04-21-2020, 12:34 PM
RE: Error: Not enough arguments? - by Pocholo - 04-21-2020, 07:01 PM

Forum Jump: