Skip to search.

Breaking News Visit Yahoo! News for the latest.

×Close this window

script-fu

The Yahoo! Groups Product Blog

Check it out!

Group Information

  • Members: 539
  • Category: Image Processing
  • Founded: Jan 26, 2002
  • Language: English
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Message search is now enhanced, find messages faster. Take it for a spin.

Messages

Advanced
Messages Help
Messages 349 - 381 of 953   Oldest  |  < Older  |  Newer >  |  Newest
Messages: Show Message Summaries Sort by Date ^  
#349 From: "Xavier PITEL" <xapitel@...>
Date: Fri Jan 7, 2005 3:54 pm
Subject: Text layer in script
xavierpitel
Send Email Send Email
 
Hi,

I am trying to write a script-fu where I need to change the text written in
an existing text layer. I haven't found a way to change the text (or at
least to popup the text editor) straightforwardly, so I guess I have to
create a new text layer and delete the old one. But I need text information
for that layer, namely font and size.
I could do without size, trying until the extends needed for this font
matches the extends of the old text layer, but I need at least to know the
font. Gimp-context-get-font gets the currently active font, which means if
the user changes font between the creation of the old text layer and the
creation of the new text layer, I can't figure out the proper size of font.

So my questions are:
1. Is there a simple way to change the text of a text layer by script-fu or,
at least, to popup the text editor?
2. Is there a way to get font and size information for a given text layer?
3. Is there a way to force the active font to be the same as a given text
layer?

Thanks very much for your answers.

Regards,
Xavier PITEL

#350 From: Kevin Cozens <kcozens@...>
Date: Fri Jan 7, 2005 4:11 pm
Subject: Re: Text layer in script
kcozens37
Send Email Send Email
 
Xavier PITEL wrote:

>So my questions are:
>1. Is there a simple way to change the text of a text layer by script-fu or,
>at least, to popup the text editor?
>2. Is there a way to get font and size information for a given text layer?
>3. Is there a way to force the active font to be the same as a given text
>layer?
>
>
You are more or less out of luck on this at the moment. It is a known
problem that the text API in GIMP needs improvement. One possibility
would be to write a plug-in to obtain the information you need.

#351 From: "Xavier PITEL" <xapitel@...>
Date: Fri Jan 7, 2005 4:22 pm
Subject: RE: Text layer in script
xavierpitel
Send Email Send Email
 
OK, I'll choose a clumsy solution until I have time to dive into Gimp
plug-ins or the API is improved.
Thanks anyway.

Xavier

-----Message d'origine-----
De : Kevin Cozens [mailto:kcozens@...]
Envoyé : vendredi 7 janvier 2005 17:11
À : script-fu@yahoogroups.com
Objet : Re: [script-fu] Text layer in script


Xavier PITEL wrote:

>So my questions are:
>1. Is there a simple way to change the text of a text layer by script-fu
or,
>at least, to popup the text editor?
>2. Is there a way to get font and size information for a given text layer?
>3. Is there a way to force the active font to be the same as a given text
>layer?
>
>
You are more or less out of luck on this at the moment. It is a known
problem that the text API in GIMP needs improvement. One possibility
would be to write a plug-in to obtain the information you need.




Yahoo! Groups Links








__________ NOD32 1.965 (20050106) Information __________

This message was checked by NOD32 antivirus system.
http://www.nod32.com

#352 From: "Joao S. O. Bueno Calligaris" <gwidion@...>
Date: Fri Jan 7, 2005 4:39 pm
Subject: Re: Text layer in script
gwidion@...
Send Email Send Email
 
On Friday 07 January 2005 14:22, Xavier PITEL wrote:
> OK, I'll choose a clumsy solution until I have time to dive into
> Gimp plug-ins or the API is improved.
> Thanks anyway.

Actually, writitng a plug-in would not help muh - this information is
not avilable to plug-ins either.

We have to
a) formulate a resoanble, sane and extensible API for the text tool

You could help trying to write just that, suggesting functions, even
function calls for things that are not there yet, but are likely to
be soon, like text rotation. and posting that in the apropriate entry
in bugzilla.gnome.org (search for a bug requesting such features in
the GIMP, or if there is none ther eyet, create one)

As for the script now, the work around I could think off is to create
the text layer from within the script, or a sibling script, asking
for the text and font informations. Them, along with the creation of
the text layer, you could record this information in a parasite, like
the old dynamic text used to do. At each update, yoyu them delete the
text layer, and recreate it with the information stroed in the
parasite(s).


Regards,
	 JS
	 -><-







>
> Xavier
>
> -----Message d'origine-----
> De : Kevin Cozens [mailto:kcozens@...]
> Envoyé : vendredi 7 janvier 2005 17:11
> À : script-fu@yahoogroups.com
> Objet : Re: [script-fu] Text layer in script
>
> Xavier PITEL wrote:
> >So my questions are:
> >1. Is there a simple way to change the text of a text layer by
> > script-fu
>
> or,
>
> >at least, to popup the text editor?
> >2. Is there a way to get font and size information for a given
> > text layer? 3. Is there a way to force the active font to be the
> > same as a given text layer?
>
> You are more or less out of luck on this at the moment. It is a
> known problem that the text API in GIMP needs improvement. One
> possibility would be to write a plug-in to obtain the information
> you need.
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>
>
> __________ NOD32 1.965 (20050106) Information __________
>
> This message was checked by NOD32 antivirus system.
> http://www.nod32.com
>
>
>
>
> Yahoo! Groups Links
>
>
>

#353 From: "Xavier PITEL" <xapitel@...>
Date: Fri Jan 7, 2005 5:56 pm
Subject: RE: Text layer in script
xavierpitel
Send Email Send Email
 
Joao,

I'm trying to figure out what parasites are. Are those parasites deleted
when you close GIMP, or do you find them again when you reopen an image? If
not, I will record this information in the text layer name, and then get
them from here.

Thanks,
Xavier

-----Message d'origine-----
De : Joao S. O. Bueno Calligaris [mailto:gwidion@...]
Envoyé : vendredi 7 janvier 2005 17:39
À : script-fu@yahoogroups.com
Objet : Re: [script-fu] Text layer in script


On Friday 07 January 2005 14:22, Xavier PITEL wrote:
> OK, I'll choose a clumsy solution until I have time to dive into
> Gimp plug-ins or the API is improved.
> Thanks anyway.

Actually, writitng a plug-in would not help muh - this information is
not avilable to plug-ins either.

We have to
a) formulate a resoanble, sane and extensible API for the text tool

You could help trying to write just that, suggesting functions, even
function calls for things that are not there yet, but are likely to
be soon, like text rotation. and posting that in the apropriate entry
in bugzilla.gnome.org (search for a bug requesting such features in
the GIMP, or if there is none ther eyet, create one)

As for the script now, the work around I could think off is to create
the text layer from within the script, or a sibling script, asking
for the text and font informations. Them, along with the creation of
the text layer, you could record this information in a parasite, like
the old dynamic text used to do. At each update, yoyu them delete the
text layer, and recreate it with the information stroed in the
parasite(s).


Regards,
         JS
         -><-







>
> Xavier
>
> -----Message d'origine-----
> De : Kevin Cozens [mailto:kcozens@...]
> Envoyé : vendredi 7 janvier 2005 17:11
> À : script-fu@yahoogroups.com
> Objet : Re: [script-fu] Text layer in script
>
> Xavier PITEL wrote:
> >So my questions are:
> >1. Is there a simple way to change the text of a text layer by
> > script-fu
>
> or,
>
> >at least, to popup the text editor?
> >2. Is there a way to get font and size information for a given
> > text layer? 3. Is there a way to force the active font to be the
> > same as a given text layer?
>
> You are more or less out of luck on this at the moment. It is a
> known problem that the text API in GIMP needs improvement. One
> possibility would be to write a plug-in to obtain the information
> you need.
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>
>
> __________ NOD32 1.965 (20050106) Information __________
>
> This message was checked by NOD32 antivirus system.
> http://www.nod32.com
>
>
>
>
> Yahoo! Groups Links
>
>
>



Yahoo! Groups Links








__________ NOD32 1.965 (20050106) Information __________

This message was checked by NOD32 antivirus system.
http://www.nod32.com

#354 From: "Joao S. O. Bueno Calligaris" <gwidion@...>
Date: Fri Jan 7, 2005 6:50 pm
Subject: Re: Text layer in script
gwidion@...
Send Email Send Email
 
On Friday 07 January 2005 15:56, Xavier PITEL wrote:
> Joao,
>
> I'm trying to figure out what parasites are. Are those parasites
> deleted when you close GIMP, or do you find them again when you
> reopen an image? If not, I will record this information in the text
> layer name, and then get them from here.
>

Hi, thre is a a "presistent" attribute to parasites. If set, the
parasite is recorded in a image's XCF file.
> Thanks,
> Xavier
>
> -----Message d'origine-----
> De : Joao S. O. Bueno Calligaris [mailto:gwidion@...]
> Envoyé : vendredi 7 janvier 2005 17:39
> À : script-fu@yahoogroups.com
> Objet : Re: [script-fu] Text layer in script
>
> On Friday 07 January 2005 14:22, Xavier PITEL wrote:
> > OK, I'll choose a clumsy solution until I have time to dive into
> > Gimp plug-ins or the API is improved.
> > Thanks anyway.
>
> Actually, writitng a plug-in would not help muh - this information
> is not avilable to plug-ins either.
>
> We have to
> a) formulate a resoanble, sane and extensible API for the text tool
>
> You could help trying to write just that, suggesting functions,
> even function calls for things that are not there yet, but are
> likely to be soon, like text rotation. and posting that in the
> apropriate entry in bugzilla.gnome.org (search for a bug requesting
> such features in the GIMP, or if there is none ther eyet, create
> one)
>
> As for the script now, the work around I could think off is to
> create the text layer from within the script, or a sibling script,
> asking for the text and font informations. Them, along with the
> creation of the text layer, you could record this information in a
> parasite, like the old dynamic text used to do. At each update,
> yoyu them delete the text layer, and recreate it with the
> information stroed in the parasite(s).
>
>
> Regards,
>         JS
>         -><-
>
> > Xavier
> >
> > -----Message d'origine-----
> > De : Kevin Cozens [mailto:kcozens@...]
> > Envoyé : vendredi 7 janvier 2005 17:11
> > À : script-fu@yahoogroups.com
> > Objet : Re: [script-fu] Text layer in script
> >
> > Xavier PITEL wrote:
> > >So my questions are:
> > >1. Is there a simple way to change the text of a text layer by
> > > script-fu
> >
> > or,
> >
> > >at least, to popup the text editor?
> > >2. Is there a way to get font and size information for a given
> > > text layer? 3. Is there a way to force the active font to be
> > > the same as a given text layer?
> >
> > You are more or less out of luck on this at the moment. It is a
> > known problem that the text API in GIMP needs improvement. One
> > possibility would be to write a plug-in to obtain the information
> > you need.
> >
> >
> >
> >
> > Yahoo! Groups Links
> >
> >
> >
> >
> >
> >
> >
> >
> > __________ NOD32 1.965 (20050106) Information __________
> >
> > This message was checked by NOD32 antivirus system.
> > http://www.nod32.com
> >
> >
> >
> >
> > Yahoo! Groups Links
>
> Yahoo! Groups Links
>
>
>
>
>
>
>
>
> __________ NOD32 1.965 (20050106) Information __________
>
> This message was checked by NOD32 antivirus system.
> http://www.nod32.com
>
>
>
>
> Yahoo! Groups Links
>
>
>

#355 From: Stuart Slaugh <sslaugh@...>
Date: Fri Feb 11, 2005 10:51 pm
Subject: posting
stuartaslaugh
Send Email Send Email
 
ok...i'm in
--
It wasn't me...I swear...

#356 From: "Michael Schumacher" <schumaml@...>
Date: Fri Feb 11, 2005 4:12 pm
Subject: Re: posting
schumaml
Send Email Send Email
 
> ok...i'm in

In a group that is almost dead... and never was really alive :)

I'm CCing the owner (at least I hope he still reads mails from this list)
because of the following:

In my opinion, it should be considered to close this list and advertize the
gimp-user list at XCF instead. Script-Fu isn't off-topic there, and I assume
that there are much more users than here.


Michael

--
DSL Komplett von GMX +++ Supergünstig und stressfrei einsteigen!
AKTION "Kein Einrichtungspreis" nutzen: http://www.gmx.net/de/go/dsl

#357 From: epierce <eric_wmaker@...>
Date: Wed Mar 16, 2005 3:51 am
Subject: Array in Script-fu?
eric_wmaker
Send Email Send Email
 
Hi all,

I have a script where the user picks a radius from
1-80.  According to the radius value, I want to use a
particular Black and White value (see table below).

Now if I were using any other language on God's green
Earth, I'd throw the table data into an array and
pluck out the appropriate values corresponding to the
radius.  But I have absolute no idea how to approach
this with Script-fu.  I don't see how this'd be
practical with a Scheme list.  Any ideas anyone?

Also, how does everyone debug in Script-fu?  I tried
using gimp-message, but that only accepts a string
(ie., I couldn't throw a variable in there).  And I
don't see the utility of the Script-fu console as it's
completely cut-off from the scripts.  Am I missing
some other debug method?

Thanks for reading!   Eric P.

Table of data
Radius  Black   White
---------------------
1 41 212
2 70 183
3 84 169
4 93 160
5 97 155
6 102 151
7 105 148
8 108 145
9 110 143
10 111 142
11 112 141
12 114 139
13 114 139
14 115 138
15 116 137
16 117 136
17 117 136
18 118 135
19 118 135
20 119 134
21 119 134
22 119 134
23 120 134
24 120 133
25 120 133
26 120 133
27 121 133
28 121 132
29 121 132
30 121 132
31 121 132
32 121 132
33 122 131
34 122 131
35 122 131
36 122 131
37 122 131
38 122 131
39 122 131
40 122 131
41 123 131
42 123 130
43 123 130
44 123 130
45 123 130
46 123 130
47 123 130
48 123 130
49 123 130
50 123 130
51 123 130
52 123 130
53 123 130
54 123 130
55 124 130
56 124 129
57 124 129
58 124 129
59 124 129
60 124 129
61 124 129
62 124 129
63 124 129
64 124 129
65 124 129
66 124 129
67 124 129
68 124 129
69 124 129
70 124 129
71 124 129
72 124 129
73 124 129
74 124 129
75 124 129
76 124 129
77 124 129
78 124 129
79 124 129
80 124 129





__________________________________
Do you Yahoo!?
Yahoo! Small Business - Try our new resources site!
http://smallbusiness.yahoo.com/resources/

#358 From: Kevin Cozens <kcozens@...>
Date: Wed Mar 16, 2005 4:52 pm
Subject: Re: Array in Script-fu?
kcozens37
Send Email Send Email
 
epierce wrote:

>I have a script where the user picks a radius from
>1-80.  According to the radius value, I want to use a
>particular Black and White value (see table below).
>
>
If Script-Fu used a more standards compliant Scheme interpreter instead
of SIOD, it would be a matter of creating a list along the lines of

'( (41 212) (70 183) (84 169) ... (124 129) )

Then you would just use list-ref to get the pair of black and white
values you want.

Since Script-Fu doesn't provide a list-ref, here is the list-ref
implementation used in Tiny-Fu:
(define (list-tail x k)
(if (zero? k)
x
(list-tail (cdr x) (- k 1))))

(define (list-ref x k)
(car (list-tail x k)))

Since Script-Fu doesn't have a zero? either, change that part to (= 0
k). Also, remember that the index values start at 0 and not 1.

You could also throw the values in to an array if you want. Create
arrays for each of the black and white arrays, use aset! to set each of
the array elements from a list, then use aref to retrieve the values.
Probably easier to just use list-ref unless although the array approach
may be faster in the long run if you will be doing a lot of lookups.

>Also, how does everyone debug in Script-fu?
>
Personally, I don't use Script-Fu when creating scripts any more. I use
Tiny-Fu instead as it is much easier to see what the script is doing.
Still, you can do debugging in Script-Fu and it isn't that hard. You
have two options. You can run GIMP from a command line and use print to
output your debug information. If you want to use gimp-message instead,
you can create the text of the message by using string-append in
combination with number->string to convert variable contents to string
format.

You can see the information about number->string (and other supported
features of the SIOD interpreter used in Script-Fu) at
http://people.delphiforums.com/gjc/siod.html.

>And I
>don't see the utility of the Script-fu console as it's
>completely cut-off from the scripts.  Am I missing
>some other debug method?
>
It isn't completely cut-off from the scripts. You can run scripts from
the console by invoking them as you would any other function. You just
can't get a nice GUI interface to set values. To make it a little easier
to run scripts from Script-Fu console mode (or to use any of the PDB
calls list in GIMPs Procedure Browser) click the Browse button. This
brings up the Procedure Browser. Scroll down the list of available
procedures. When you see the one you want to use you click the Apply
button. This generates a Scheme statement in the Current Command field
of the Script-Fu console mode with all the parameters needed by the
script (aka PDB call). You can then hit Close in the Procedure Browser.
Finally, you edit the contents of the Current Command field to use the
values or variables you want to use in the call you are about to make
and hit enter to run the command.

If you need to refer to an image use the number after the name in the
title bar of an image. If an image is called Untitled-2.0, you use 2 if
the call needs an image parameter. To get the number needed to refer to
a particular drawable (think layers) of an image you could use
gimp-image-get-active-layer or use gimp-image-get-layers to get the list
of layer IDs associated with a given image.

Script-Fu console mode is very useful to run tests while creating or
debugging scripts. In Tiny-Fu you can save the contents of the output
window which gives a record of your session. You could then edit the
saved file to extract the Scheme statements you wanted to keep/use in
your script.

--
Cheers!

Kevin.  (http://www.interlog.com/~kcozens/)

Owner of Elecraft K2 #2172        |"What are we going to do today, Borg?"
E-mail:kcozens at interlog dot com|"Same thing we always do, Pinkutus:
Packet:ve3syb@ve3yra.#con.on.ca.na|  Try to assimilate the world!"
#include <disclaimer/favourite>   |              -Pinkutus & the Borg

#359 From: GSR - FR <famrom@...>
Date: Wed Mar 16, 2005 11:10 pm
Subject: Re: Array in Script-fu?
famrom@...
Send Email Send Email
 
Hi,
eric_wmaker@... (2005-03-15 at 1951.21 -0800):
> Now if I were using any other language on God's green
> Earth, I'd throw the table data into an array and
> pluck out the appropriate values corresponding to the
> radius.  But I have absolute no idea how to approach
> this with Script-fu.  I don't see how this'd be
> practical with a Scheme list.  Any ideas anyone?

Use car, cdr and nth (or only nth):

(set! b-and-w '((41 212) (70 183) (84 169)))
(car (nth 1 b-and-w))
(car (cdr (nth 1 b-and-w)))
(nth 0 (nth 1 b-and-w))
(nth 1 (nth 1 b-and-w))

You can also use let, of course, this is just to show it quickly.

> Also, how does everyone debug in Script-fu?  I tried
> using gimp-message, but that only accepts a string
> (ie., I couldn't throw a variable in there).  And I
> don't see the utility of the Script-fu console as it's
> completely cut-off from the scripts.  Am I missing
> some other debug method?

Build strings then:

(set! a-var 5)
(gimp-message (string-append "Show a number " (number->string a-var)))

I ran all this in the console to check it worked. You can also invoke
scripts, they are loaded in same namespace (if that is the proper
term), so no idea what you mean with "completly cut-off". If you mean
editing is a pain, that is true, not very useful for big groups of
commands compared to emacs/vi/whatever (specially the parenthesis
counting).

GSR

#360 From: epierce <eric_wmaker@...>
Date: Fri Mar 18, 2005 4:34 am
Subject: Re: Re: Array in Script-fu?
eric_wmaker
Send Email Send Email
 
Perfect!  You answered my post beautifully.  Thank
you.

The 'nth' snippets worked perfectly.

Also, the 'gimp-message' tip below will be a
life-saver.

FYI, here's the script I was working on.
http://epierce.freeshell.org/gimp/selection-rounded-selection.scm

It's my first so I'm sure it's full of newbie
oversights.

Thanks again!  And thanks Kevin C. for the informative
reply as well.  Keep up the great work w/Tiny-Fu.

Eric P.

> eric_wmaker@... (2005-03-15 at 1951.21 -0800):
> > Now if I were using any other language on God's
> green
> > Earth, I'd throw the table data into an array and
> > pluck out the appropriate values corresponding to
> the
> > radius.  But I have absolute no idea how to
> approach
> > this with Script-fu.  I don't see how this'd be
> > practical with a Scheme list.  Any ideas anyone?
>
> Use car, cdr and nth (or only nth):
>
> (set! b-and-w '((41 212) (70 183) (84 169)))
> (car (nth 1 b-and-w))
> (car (cdr (nth 1 b-and-w)))
> (nth 0 (nth 1 b-and-w))
> (nth 1 (nth 1 b-and-w))
>
> You can also use let, of course, this is just to
> show it quickly.
>
> > Also, how does everyone debug in Script-fu?  I
> tried
> > using gimp-message, but that only accepts a string
> > (ie., I couldn't throw a variable in there).  And
> I
> > don't see the utility of the Script-fu console as
> it's
> > completely cut-off from the scripts.  Am I missing
> > some other debug method?
>
> Build strings then:
>
> (set! a-var 5)
> (gimp-message (string-append "Show a number "
> (number->string a-var)))
>
> I ran all this in the console to check it worked.
> You can also invoke
> scripts, they are loaded in same namespace (if that
> is the proper
> term), so no idea what you mean with "completly
> cut-off". If you mean
> editing is a pain, that is true, not very useful for
> big groups of
> commands compared to emacs/vi/whatever (specially
> the parenthesis
> counting).
>
> GSR
>
>



__________________________________
Do you Yahoo!?
Yahoo! Small Business - Try our new resources site!
http://smallbusiness.yahoo.com/resources/

#361 From: Kevin Cozens <kcozens@...>
Date: Fri Mar 18, 2005 6:40 am
Subject: Re: Re: Array in Script-fu?
kcozens37
Send Email Send Email
 
epierce wrote:

>The 'nth' snippets worked perfectly.
>
>
The use of 'nth' is only really needed to obtain the list containing the
pair of black and white values from the big list. Once you have the list
containing the two values, it would be more typical to use car to get
the black value and cadr to get the white value.

>FYI, here's the script I was working on.
>http://epierce.freeshell.org/gimp/selection-rounded-selection.scm
>
>
The main thing to keep in mind when working on scripts (and mainly to
make it easier in the future to use a script with Tiny-Fu) is to be sure
to define all variables before first use.

>(if (= 0 (car (gimp-selection-is-empty image)))
>      ()
>      (begin


The above could be simplified. You could wrap the conditional with not and
eliminate the () or better still would be to use:

(if (car (gimp-selection-is-empty image))
       (begin


The information about the function needs to be checked as it indicates a
non-zero return when the selection is not empty. This is backwards to the other
tests. It might just be an error in the documentation.
--
Cheers!

Kevin.  (http://www.interlog.com/~kcozens/)

Owner of Elecraft K2 #2172        |"What are we going to do today, Borg?"
E-mail:kcozens at interlog dot com|"Same thing we always do, Pinkutus:
Packet:ve3syb@ve3yra.#con.on.ca.na|  Try to assimilate the world!"
#include <disclaimer/favourite>   |              -Pinkutus & the Borg

#362 From: "tjacobs14450" <twjacobs@...>
Date: Mon Mar 21, 2005 1:31 am
Subject: list of built-in functions?
tjacobs14450
Send Email Send Email
 
Where can I find a list of built-in functions that script-fu supports?
I know I can use the procedure browser to find stuff but I don't know
where to find things like set-pt.

Thanks,
Tim

#363 From: Owen <rcook@...>
Date: Mon Mar 21, 2005 3:46 am
Subject: Re: list of built-in functions?
owen_cook2000
Send Email Send Email
 
On Mon, 21 Mar 2005 01:31:33 -0000
"tjacobs14450" <twjacobs@...> wrote:

>
>
> Where can I find a list of built-in functions that script-fu supports?
> I know I can use the procedure browser to find stuff but I don't know
> where to find things like set-pt.
>
> Thanks,
> Tim



If you go to

Xtns->Script-Fu->Script-Fu Console

There is a Browse button that will allow you to find all the functions




Owen

#364 From: Kevin Cozens <kcozens@...>
Date: Mon Mar 21, 2005 4:07 am
Subject: Re: list of built-in functions?
kcozens37
Send Email Send Email
 
tjacobs14450 wrote:

>Where can I find a list of built-in functions that script-fu supports?
>
Information about the Scheme interpreter called SIOD which is used in
Script-Fu can be found at:
http://people.delphiforums.com/gjc/siod.html

#365 From: Tim Jacobs <twjacobs@...>
Date: Mon Mar 21, 2005 12:42 pm
Subject: Re: list of built-in functions?
tjacobs14450
Send Email Send Email
 
Thanks Kevin,
I did not see set-pt in that documentation yet I've seen it used in
several script-fus. Do you know of any other documentation? I guess I'm
concerned there might be (many?) other functions that I can't find
documentation for. In any case, I will keep the below reference handy.

Tim



On Sun, 2005-03-20 at 23:07 -0500, Kevin Cozens wrote:
> tjacobs14450 wrote:
>
> >Where can I find a list of built-in functions that script-fu supports?
> >
> Information about the Scheme interpreter called SIOD which is used in
> Script-Fu can be found at:
> http://people.delphiforums.com/gjc/siod.html
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>

#366 From: Kevin Cozens <kcozens@...>
Date: Mon Mar 21, 2005 4:51 pm
Subject: Re: list of built-in functions?
kcozens37
Send Email Send Email
 
Tim Jacobs wrote:

>I did not see set-pt in that documentation yet I've seen it used in
>several script-fus.
>
>
It didn't quite register at the time when you were asking about set-pt
that this is not something defined in SIOD. This is a function defined
in several of the script-files. It is defined and used in
the chrome-it.scm, crystal-logo.scm, neon-logo.scm, and
sota-chrome-logo.scm files.

There is no specific documentation on it. It is a fairly handy way to
populate an array with a set of x,y coordinates that will be passed to
GIMP to a function that needs a PDB_STROKE argument.

--
Cheers!

Kevin.  (http://www.interlog.com/~kcozens/)

Owner of Elecraft K2 #2172        |"What are we going to do today, Borg?"
E-mail:kcozens at interlog dot com|"Same thing we always do, Pinkutus:
Packet:ve3syb@ve3yra.#con.on.ca.na|  Try to assimilate the world!"
#include <disclaimer/favourite>   |              -Pinkutus & the Borg

#367 From: "Michael Schumacher" <schumaml@...>
Date: Mon Mar 21, 2005 5:27 pm
Subject: Re: list of built-in functions?
schumaml
Send Email Send Email
 
> There is no specific documentation on it. It is a fairly handy way to
> populate an array with a set of x,y coordinates that will be passed to
> GIMP to a function that needs a PDB_STROKE argument.

Shouldn't it be shared then? There is a script for such functions already.

HTH,
Michael

--
DSL Komplett von GMX +++ Supergünstig und stressfrei einsteigen!
AKTION "Kein Einrichtungspreis" nutzen: http://www.gmx.net/de/go/dsl

#368 From: Kevin Cozens <kcozens@...>
Date: Mon Mar 21, 2005 10:57 pm
Subject: Re: list of built-in functions?
kcozens37
Send Email Send Email
 
Michael Schumacher wrote:

>>There is no specific documentation on it. It is a fairly handy way to
>>populate an array with a set of x,y coordinates that will be passed to
>>GIMP to a function that needs a PDB_STROKE argument.
>>
>>
>
>Shouldn't it be shared then? There is a script for such functions already.
>
>
It is a useful enough routine for it to be shared. It would avoid the
problem of the arrow scripts which wound up with some routines of the
same name but slightly different implementations clashing. In Tiny-Fu I
made most of these definitions private rather than leaving them shared.

--
Cheers!

Kevin.  (http://www.interlog.com/~kcozens/)

Owner of Elecraft K2 #2172        |"What are we going to do today, Borg?"
E-mail:kcozens at interlog dot com|"Same thing we always do, Pinkutus:
Packet:ve3syb@ve3yra.#con.on.ca.na|  Try to assimilate the world!"
#include <disclaimer/favourite>   |              -Pinkutus & the Borg

#369 From: Tim Jacobs <twjacobs@...>
Date: Tue Mar 22, 2005 2:16 am
Subject: Re: list of built-in functions?
tjacobs14450
Send Email Send Email
 
Thanks for the information. Let me try to echo back what I think I've
learned (and ask a few clarification questions on the way).
First, the scripts I've seen do not define set-pt. If set-pt is only
defined in other scripts, it would lead me to believe that things that
are defined in other scripts are publicly available. Is it true that
anything that is defined in any script is available for use in other
scripts? If that is the case, is there any way to know (short of looking
at all the scripts) what is defined? Michael suggested it should be
"shared". If what I concluded above is true then I don't know what it
means to be shared as all the defines would be shared. If what I
concluded is not true then I think set-pt may be "shared" already since,
as I said, it is not defined in the scripts I looked at. If there is
something special that needs to be done to share code, what is it?
Michael's note leads me believe there is a script for this purpose
already.

Thanks for all your patience with my questions.

Tim

On Mon, 2005-03-21 at 17:57 -0500, Kevin Cozens wrote:
> Michael Schumacher wrote:
>
> >>There is no specific documentation on it. It is a fairly handy way to
> >>populate an array with a set of x,y coordinates that will be passed to
> >>GIMP to a function that needs a PDB_STROKE argument.
> >>
> >>
> >
> >Shouldn't it be shared then? There is a script for such functions already.
> >
> >
> It is a useful enough routine for it to be shared. It would avoid the
> problem of the arrow scripts which wound up with some routines of the
> same name but slightly different implementations clashing. In Tiny-Fu I
> made most of these definitions private rather than leaving them shared.
>

#370 From: Kevin Cozens <kcozens@...>
Date: Wed Mar 23, 2005 5:23 pm
Subject: Re: list of built-in functions?
kcozens37
Send Email Send Email
 
I think set-pt is publicly defined in more than one script. Since the
definitions are identical it doesn't cause a problem. Probably another
point in favour of making it a utility routine.

On startup, Script-Fu (and also Tiny-Fu) reads ALL scripts in to memory.
As a result, anything publicly defined in one file is available for use
by any functions defined in a different file. This can be a useful
attribute when done right but can also lead to problems (ie. two
functions with the same name but which take different argument lists
and/or do different things). I do not know of any documentation that
describes the scripts which accompany the Script-Fu plug-in. If a public
function is not registered (ie. made known to the PDB interface of
GIMP), the only way to know of its existance is to look at the script files.

#371 From: "tjacobs14450" <twjacobs@...>
Date: Mon Apr 11, 2005 11:22 am
Subject: Procedural database execution failed
tjacobs14450
Send Email Send Email
 
I get the following message in one of the scripts I'm working on.

Procedural database execution failed
         (gimp_edit_clear 3)
--------
The code fragment is below:

         (set! textureLayer (car (gimp-layer-new inImage
                                 (car (gimp-image-width inImage))
                                 (car (gimp-image-height inImage))
                                 (car (gimp-drawable-type-with-alpha
inLayer))
                                   "Paper Texture" 100 OVERLAY-MODE)))
         (set! oldSelection (car (gimp-selection-save inImage)))
         (gimp-selection-all inImage)
         (gimp-edit-clear textureLayer)

For inImage = 1. inLayer = 2, and textureLayer = 3, if I add the
texture layer to the image in the Script-Fu Console
(gimp-image-add-layer 1 3 -1), and then clear (gimp-edit-clear 3), it
works OK. I execute this code after the script is run and outputs the
above messge. But if I add the layer in the script
(gimp-image-add-layer inImage textureLayer -1), I get an error again:

ERROR: Procedural database execution failed:
(gimp_image_add_layer 1 3 -1)

Any help in understanding this is much appreciated.

Tim

#375 From: "Hubert Desgain" <hubert_desgain@...>
Date: Fri Aug 26, 2005 8:22 am
Subject: script-fu first try
hdesgain
Send Email Send Email
 
Hello All,
 
I'm new in using script-fu so be indulgent. I do alternative photography using BW negative .So I try to write a script in order to obtain a BW negative from an RGB image loaded.
A little description of my script is that I use a layer ( copy of the image, desaturated, inverted and merged) to reduce the contrast of the rgb original image. That's OK and works fine.
 
My problems are after that :
        1) is it possible to apply a curve using is name ? ( or must we enter the differents points in the gimp-curves-spline)
 
        2) In my script herebelow , I cannot find the way to do    "layer  color  invert" at the end. Manually it works fine.
     
Thanks in advance,
 
Hubert Desgain
 
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
;This buffer is for notes you don't want to save, and for Lisp evaluation.
; If you want to create a file, visit that file with C-x C-f,
; -*-scheme-*-
;
; an RGB image is first loaded. The goal is to reduce the contrast first and
; then apply a correction curve to obtain a digital negative dedicated for a specific
; alternative photographic process.
 
(define (script-fu-bromide img drawable)
    ; create a new layer
    (set! new-layer (car (gimp-layer-copy drawable 0)))
    ; set name new layer
    (gimp-layer-set-name new-layer "Masque")
    ; add the new layer
    (gimp-image-add-layer img new-layer 0)
    ; convert rgb to bw
    (gimp-desaturate new-layer)
    ; invert
    (gimp-invert new-layer)
    ; layer mode
    (gimp-layer-set-mode new-layer 5)
    ; merge
    (gimp-image-merge-down img new-layer 1)
    ; display
    (gimp-displays-flush)
    ; color to bw
    (gimp-image-convert-grayscale img)
    ; correction  curve
    ; <=================
    ; invert to obtain negative
    ; <=================
       )
 
    (script-fu-register "script-fu-bromide"
      "<Image>/Script-Fu/Utils/Bromide Kentmere Doc Art grade 2"
      "Bromide on Kentmere Doc Art."
      "Hubert Desgain"
      "Hubert Desgain."
      "Aug 2005"
      "RGB*, GRAY*"
      SF-IMAGE    "Image"    0
      SF-DRAWABLE "Drawable" 0)

#376 From: Kevin Cozens <kcozens@...>
Date: Fri Aug 26, 2005 4:01 pm
Subject: Re: script-fu first try
kcozens37
Send Email Send Email
 
Hubert Desgain wrote:
>         2) In my script herebelow , I cannot find the way to do
> "layer  color  invert" at the end. Manually it works fine.

In GIMP 2.2, to do the equivalent of <Image>/Layer/Colors/Invert you use
(gimp-invert layer-id)

The easiest way to get the layer id is from the return value of the call to
merge down. You can also get it by a call to get the active layer.

--
Cheers!

Kevin.

http://www.interlog.com/~kcozens/ |"What are we going to do today, Borg?"
Owner of Elecraft K2 #2172        |"Same thing we always do, Pinkutus:
                                    |  Try to assimilate the world!"
#include <disclaimer/favourite>   |              -Pinkutus & the Borg

#377 From: "Hubert Desgain" <hubert_desgain@...>
Date: Wed Aug 31, 2005 11:33 am
Subject: Re: Re: script-fu first try
hdesgain
Send Email Send Email
 
    Thanks Kevin,
    now it's working fine.
 
    Hubert
----- Original Message -----
Sent: Friday, August 26, 2005 6:01 PM
Subject: [Norton AntiSpam] Re: [script-fu] script-fu first try

Hubert Desgain wrote:
>         2) In my script herebelow , I cannot find the way to do   
> "layer  color  invert" at the end. Manually it works fine.

In GIMP 2.2, to do the equivalent of <Image>/Layer/Colors/Invert you use
(gimp-invert layer-id)

The easiest way to get the layer id is from the return value of the call to
merge down. You can also get it by a call to get the active layer.

--
Cheers!

Kevin.

http://www.interlog.com/~kcozens/ |"What are we going to do today, Borg?"
Owner of Elecraft K2 #2172        |"Same thing we always do, Pinkutus:
                                   |  Try to assimilate the world!"
#include <disclaimer/favourite>   |              -Pinkutus & the Borg

#378 From: "lasm.rm" <lasm@...>
Date: Wed Oct 5, 2005 3:02 am
Subject: New Script
lasm.rm
Send Email Send Email
 
Hi All,

   It's been a long time since i last wrote a script,
so much has changed. Now i find the old scripts don't work
any more..

   Will be writing a new script soon on my new laptop.. Got
to find my way around again... sigh..

re,
lasm

#379 From: script-fu@yahoogroups.com
Date: Wed Oct 5, 2005 4:46 am
Subject: New file uploaded to script-fu
script-fu@yahoogroups.com
Send Email Send Email
 
Hello,

This email message is a notification to let you know that
a file has been uploaded to the Files area of the script-fu
group.

   File        : /Scripts/line-art.scm
   Uploaded by : lasm.rm <lasm@...>
   Description : Lineart-v3.2 update for Gim v2.2

You can access this file at the URL:
http://groups.yahoo.com/group/script-fu/files/Scripts/line-art.scm

To learn more about file sharing for your group, please visit:
http://help.yahoo.com/help/us/groups/files

Regards,

lasm.rm <lasm@...>

#380 From: "owen_cook2000" <rcook@...>
Date: Wed Oct 5, 2005 7:03 am
Subject: Re: New file uploaded to script-fu
owen_cook2000
Send Email Send Email
 
--- In script-fu@yahoogroups.com, script-fu@yahoogroups.com wrote:
>
> Hello,
>
> This email message is a notification to let you know that
> a file has been uploaded to the Files area of the script-fu
> group.
>
>   File        : /Scripts/line-art.scm
>   Uploaded by : lasm.rm <lasm@r...>
>   Description : Lineart-v3.2 update for Gim v2.2
Hi,

Long time!

On 2.3.4, few deprecated procedures which I am sure you have found.

Otherwise works as you intended.

Thanks


Owen

#381 From: "lasm.rm" <lasm@...>
Date: Wed Oct 5, 2005 2:55 pm
Subject: Re: New file uploaded to script-fu
lasm.rm
Send Email Send Email
 
Hi Owen,

   Yeah, been away for long ;-)

   I am on 2.2 "stable" and found some changes in the PDB,
   one of the bugs really got on my nerves... Turn out that
   the PDB browser says gimp_display_new but it won't work,
   the one which works is gimp-display-new .. Ugh... stuff like
   that !

   Recently i saw something on Photoshop which inspires me to try
   it out.. Now experimenting with LAB color processing.. Hope
   to get the script out soon.. still working on it.

re,
lasm


--- In script-fu@yahoogroups.com, "owen_cook2000" <rcook@p...> wrote:
> --- In script-fu@yahoogroups.com, script-fu@yahoogroups.com wrote:
> >
> > Hello,
> >
> > This email message is a notification to let you know that
> > a file has been uploaded to the Files area of the script-fu
> > group.
> >
> >   File        : /Scripts/line-art.scm
> >   Uploaded by : lasm.rm <lasm@r...>
> >   Description : Lineart-v3.2 update for Gim v2.2
> Hi,
>
> Long time!
>
> On 2.3.4, few deprecated procedures which I am sure you have found.
>
> Otherwise works as you intended.
>
> Thanks
>
>
> Owen

Messages 349 - 381 of 953   Oldest  |  < Older  |  Newer >  |  Newest
Add to My Yahoo!      XML What's This?

Copyright © 2010 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines NEW - Help