It is currently Thu Sep 24, 2026 5:00 pm


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Migrating a script from 2.8 to 2.9
PostPosted: Wed Nov 11, 2015 3:42 pm  (#1) 
Offline
GimpChat Member

Joined: Jun 19, 2013
Posts: 6
GIMP Version: 2.9.1
Operating System: Linux
OS Version: Linux Mint 17.2
GIMP Experience: Basic Level

List any ERROR messages you received:
Error: Invalid number of arguments for gimp-image-select-item (expected 3 but received 1)



Hi again all,

Im attempting to update a small script from 2.8 to 2.9. Ive taken care of all the errors except the one listed above.

My issue stems from not knowing enough about script-fu to make the necessary change.
According to spec the gimp-image-select-item requires the following 3 parameters:
Image, Operation (int32), and Item.

In the script the function is written as

(gimp-image-select-item varBlurredSelection)


Which parameter is the variable?

Thanks for any assistance on this.


Share on Facebook Share on Twitter Share on Orkut Share on Digg Share on MySpace Share on Delicious Share on Technorati
Top
 Post subject: Re: Migrating a script from 2.8 to 2.9
PostPosted: Wed Nov 11, 2015 5:04 pm  (#2) 
Offline
Script Coder
User avatar

Joined: Feb 18, 2011
Posts: 4826
Location: Bendigo Vic. Australia
In 2.8 and 2.9 this call to the PDB is the same (gimp-image-select-item image operation item)

_________________
Image
No matter how much you push the envelope, it'll still be stationery.


Top
 Post subject: Re: Migrating a script from 2.8 to 2.9
PostPosted: Wed Nov 11, 2015 5:17 pm  (#3) 
Offline
GimpChat Member

Joined: Jun 19, 2013
Posts: 6
Correct what I ment was which parameter was the "varBlurredSelection"?


Top
 Post subject: Re: Migrating a script from 2.8 to 2.9
PostPosted: Wed Nov 11, 2015 5:20 pm  (#4) 
Offline
Script Coder
User avatar

Joined: Apr 23, 2010
Posts: 1553
Location: not from Guildford after all
The variable is the third parameter, 'item'. Whether the item is a layer, a layermask, a channel, or a path will determine how the selection is modified.

The second parameter, 'mode', determines whether the "item" gets added to, gets subtracted from, gets intersected with, or replaces the selection.

The first parameter is the ID of the image to which the item belongs.

_________________
Any sufficiently primitive technology is indistinguishable from a rock.


Top
 Post subject: Re: Migrating a script from 2.8 to 2.9
PostPosted: Wed Nov 11, 2015 6:17 pm  (#5) 
Offline
GimpChat Member

Joined: Jun 19, 2013
Posts: 6
Thank you Saul.
Is there a definitive source for learning script-fu?


Top
 Post subject: Re: Migrating a script from 2.8 to 2.9
PostPosted: Fri Nov 13, 2015 2:13 pm  (#6) 
Offline
GimpChat Member
User avatar

Joined: Nov 16, 2011
Posts: 5127
Location: Metro Vancouver, BC
Gimp Help: Chapter 13. Scripting
Resources: Writing GIMP Scripts and Plug-Ins

_________________
Image
Gimp 2.8.18, Linux, median user
Gimp Chat Tutorials Index
Spirit Bear (Kermode)


Top
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 5 hours [ DST ]



* Login  



Powered by phpBB3 © phpBB Group