RSS/Atom feed Twitter
Site is read-only, email is disabled

Script-Fu Command Priority

This discussion is connected to the gimp-developer-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

2 of 2 messages available
Toggle history

Please log in to manage your subscriptions.

Script-Fu Command Priority Samuel 19 Sep 16:22
  Script-Fu Command Priority Kevin Cozens 23 Sep 22:18
Samuel
2008-09-19 16:22:28 UTC (over 16 years ago)

Script-Fu Command Priority

Hi there,

the GIMP Script-Fu engine doesn't make a difference between registered definitions and local ones.
This could be a problem, because if I write a script with a local function, but another script has that function too, GIMP could use the other function. With many scripts in the scripts folder it's hard to find out, which script causes the problem.

It would be nice if GIMP could prefer local definitions to global ones or if just registered definitions would go global.

Thx, Samuel

Kevin Cozens
2008-09-23 22:18:45 UTC (over 16 years ago)

Script-Fu Command Priority

Samuel wrote:

the GIMP Script-Fu engine doesn't make a difference between registered definitions and local ones.

[snip]

It would be nice if GIMP could prefer local definitions to global ones or if just registered definitions would go global.

A define placed inside another define can only be used locally by code in the enclosing define.

What you are probably referring to is how a define that is global to code in one file can conflict with a define in another file if the names are the same. This is due to all script files are read in to a single block of memory used by the interpreter.

To avoid the problem, nest defines when you don't need something to be accessible from in another define in a given file. If a define (ie. function) needs to be global so it can be access in multiple define blocks in a file, avoid using generic names that someone else might have used in another file. One way to avoid name collision is the prepending of your initials to your own defines.