[Gimp-user] Arrays in Python
- From: Beinsezii <forums gimpusers com>
- To: gimp-user-list gnome org
- Cc: notifications gimpusers com
- Subject: [Gimp-user] Arrays in Python
- Date: Tue, 10 Apr 2018 00:57:43 +0200
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 thing
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 via
the PDB. Not really a problem right now since the registry's dead and therefore
it won't end up in the hands of others for a while (right?). I'm just
perfectionist.
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 plugin,
they'll just have to import the class.
If anyone else knows a way or has other inquiries, I'll stay subbed to this
thread.
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
layer.
You say that, but I was entirely unable to get proper pixel info in one of my
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 stuff,
incomplete docs from like 4 years ago, or reverse engineering other over-the-top
scripts like LayerFX.
--
Beinsezii (via www.gimpusers.com/forums)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]