03-04-2025, 09:16 AM
(03-03-2025, 11:37 AM)Ofnuts Wrote: You sprinkle the code with identifiable calls to (print ...) (if running from the script-fu console) or (gimp-message ...) (if running from the menus) and you can quickly determine between which print/gimp-message calls the error occurs, which should lead you to the culprit...
Thank you for your reply. I was trying to find where the error occurs in the code, but with no success. I have reverted some code to the one that was working in Gimp2. Here it is:
Code:
(let* ((off-x (car (gimp-drawable-get-offsets drawables)))
(off-y (cadr (gimp-drawable-get-offsets drawables)))
With these changes in the script, posted earlier, I can start Gimp normally and run the script. But now I've got another error: "Error: in script, expected type: numeric for argument 1 to gimp-drawable-get-offsets". This error appears when the script executes gimp-
drawable-get-offsets for the first time. Now I can't understand why this error occurs. In Gimp console, if I run the following code:
Code:
(define (off-x x) (car (gimp-drawable-get-offsets x)))
(off-x 1)
I can get the correct result, when providing the function with correct drawable. However, I can't understand why I'm getting an error in the script.