Re: [Gimp-user] script-fu-round-corners

2010-06-15 Thread Rob Antonishen
> Hi List,
>
> I thought I might tie off this thread by indicating that I now have a working 
> script.  It appears the definition for "script-fu-round-corners" in script-fu 
> console is in error in that the "run-mode" variable indicated is not 
> reflected in the definition of the script.  I removed the RUN-NONINTERACTIVE 
> from my script and I was off and running.  Here is the final script:
>

I beleive Saul Goode already indicated this is not an error.  The
calls in the PDB and are correct when calling from a plugin (C or
Python).

My understanding is that scheme scripts get their functions wrapped in
a PDB wrapper when registered, and can not be called interactively
from within scheme.  This means you can't call the registered PDB
function, but instead have to call the scheme script declaration that
was registered.

If you look in the file selection-round.scm you wil see the declaration:

(define (script-fu-selection-rounded-rectangle image drawable radius concave)
...

which is what must be called to access this from within scheme.

When this is registered in the PDB with the following call:
(script-fu-register "script-fu-selection-rounded-rectangle"
  _"Rounded R_ectangle..."
  _"Round the corners of the current selection"
  "Alan Horkan, Sven Neumann" ; authors
  "Sven Neumann"  ; copyright
  "2004/06/07"
  "*"
  SF-IMAGE   "Image"  0
  SF-DRAWABLE"Drawable"   0
  SF-ADJUSTMENT _"Radius (%)" '(50 0 100 1 10 0 0)
  SF-TOGGLE _"Concave"FALSE
)


It ends up existing with the additional run-mode parameter in front.

-Rob A>
___
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user


Re: [Gimp-user] script-fu-round-corners

2010-06-15 Thread John Dey
Hi List,

I thought I might tie off this thread by indicating that I now have a working 
script.  It appears the definition for "script-fu-round-corners" in script-fu 
console is in error in that the "run-mode" variable indicated is not reflected 
in the definition of the script.  I removed the RUN-NONINTERACTIVE from my 
script and I was off and running.  Here is the final script:

(define (round-corners filein fileout)
(let* ((image (car (gimp-file-load RUN-NONINTERACTIVE filein filein)))
   (drawable (car (gimp-image-get-active-layer image
 (set! drawable (car (gimp-image-flatten image)))
 (script-fu-round-corners image drawable 
  15.0 TRUE 8.0 8.0 15.0 TRUE FALSE)
 (set! drawable (car (gimp-image-flatten image)))
 (gimp-file-save RUN-NONINTERACTIVE image drawable fileout fileout)
 (gimp-image-delete image)))

Thanks for your help.

John
On Jun 15, 2010, at 11:00 AM, John Dey wrote:

> Hi List,
> 
> I circulated a script yesterday for rounding corners using the above listed 
> script.  I got two suggestions for changes but neither resulting in a working 
> script.  Is there a list member that would be willing to send me a small 
> working script using "script-fu-round-corners" so I can learn how to use it.  
> Thank you very much.
> 
> John
> ___
> Gimp-user mailing list
> Gimp-user@lists.XCF.Berkeley.EDU
> https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user

___
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user