It is just Python -
Just use on the calee script an inner function - one to be publicly
exposed on the PDB taking user arguments, and
another one internal meant to be called from other Python functions .
On this, simply use a Python list.
You can manipulate `sys.path` in order to be able to import other
installed GIMP scripts PY files.
Just don't expect the Procedural Database way of calling parameters,
essentially created more than
20 years ago with Scheme/lisp in mind to be able to handle the
flexibility one have in modern Python
If you need the user to feed in several numbers on the UI, and wants
to use GIMP-FU, (and not
design your own custom GTK UI), my suggestion is to use a string, and
tell the user to separate the nubmers by spaces
or commas - on the Python side, you just split and convert the argument.
Other than that, yes, GIMp-Fu should be able to handle these PDB
arrays as arguments - despite
the workarounds I just described.
Could you can fill a bug in bugzilla about that?
On 10 April 2018 at 04:03, Ofnuts <ofn...@gmx.com> wrote:
> On 04/10/18 00:57, Beinsezii wrote:
>>> AFAIK you can't, but anyway how do you expect the user to enter the
>>> bazillion numbers? If you want that many numbers just ask for a file
>>> name and read the file.
>> The user already can. I wrote a custom system for making GTK configuration
>> windows that I use with all my plugins instead of the default python-fu
>> that just stacks all the widgets into a grand tower of Babel.
>> Where the enums come into play is allowing other scripts to call this one
>> the PDB. Not really a problem right now since the registry's dead and
>> it won't end up in the hands of others for a while (right?). I'm just
>> Guess for now I'll refactor it to make the PDB method take i32's & floats
>> instead of arrays, and if some other weirdo wants the full horror of my
>> they'll just have to import the class.
>> If anyone else knows a way or has other inquiries, I'll stay subbed to
>>> Or maybe your array can be pixels values in a layer (these are easy to
>>> get in Python) in which case the user would just specify a second
>> You say that, but I was entirely unable to get proper pixel info in one of
>> past scripts. I could get standard 8-bit info, but no 32-bit floating
>> point info
>> that everything apparently uses now (2.10 RC-1).
>> Unless I'm completely missing it, the python-fu docs are patchy at best.
>> Most of
>> my knowledge comes from trying to interpret the auto-generated pydoc
>> incomplete docs from like 4 years ago, or reverse engineering other
>> scripts like LayerFX.
> I have rarely seen a Python script use another, most people would just copy
> the code they need to avoid the dependency. And you can factor you code to
> have a class that does the work and a registration facade, so that other
> Pythin script can import you code and call the useful code directly.
> gimp-user-list mailing list
> List address: email@example.com
> List membership: https://mail.gnome.org/mailman/listinfo/gimp-user-list
> List archives: https://mail.gnome.org/archives/gimp-user-list
gimp-user-list mailing list
List address: firstname.lastname@example.org
List membership: https://mail.gnome.org/mailman/listinfo/gimp-user-list
List archives: https://mail.gnome.org/archives/gimp-user-list