[Gimp-user] Custom Script UI

2016-10-14 Thread FierySwordswoman
Kevin, in you're code you have no image or drawable picked using the PF_XXX
parameters, but they still show up in your code when the starting function is
run. How? In this code:

#
def start(*args):
pdb.gimp_message(args)


register(
"FSW-SCRIPT",
"desc.",
"desc2.",
"FierySwordswoman",
"FierySwordswoman",
"1989",
"FSW Script",
"*",
[],
[],
start,
menu="/"
)

main()
#

it prints the message '()', meaning I'm not receiving the image and drawable
arguments for the function...why?
The closest thing I could find in the python-fu documentation was
"gimp.images_list()", which isn't a good solution.

-- 
FierySwordswoman (via www.gimpusers.com/forums)
___
gimp-user-list mailing list
List address:gimp-user-list@gnome.org
List membership: https://mail.gnome.org/mailman/listinfo/gimp-user-list
List archives:   https://mail.gnome.org/archives/gimp-user-list


[Gimp-user] Custom Script UI

2016-10-14 Thread FierySwordswoman
EDIT:

Adding the PF_IMAGE and PF_LAYER parameters fixes that without impeding the GUI
creation.

Alright, I'm set. I even managed to import GIMP's menu themes to use on my
custom UI.

-- 
FierySwordswoman (via www.gimpusers.com/forums)
___
gimp-user-list mailing list
List address:gimp-user-list@gnome.org
List membership: https://mail.gnome.org/mailman/listinfo/gimp-user-list
List archives:   https://mail.gnome.org/archives/gimp-user-list


[Gimp-user] Custom Script UI

2016-10-14 Thread FierySwordswoman
>Something like this:
>
>register(
> 'new-image',
> 'Creates a new image','Creates a new image',
> 'Myself','Myself',
> '2012',
> 'Create new image',
> '',[],[],
> newImage,
> menu='/File/Create/'
>)
>This script will run without showing up a dialog, and will even run if
>no images are open in Gimp.
Yeah.
>Pip could work...
No it won't. It's not included in Python 2.7.5, and I can't install it into
GIMP's python because it's missing too much of the standard library.
>Don' t speak to fast, and check the 
>/lib/gimp/2.0/interpreters/pygimp.interp file in the Gimp install
>tree.
>You can very likely switch to your own 2.7.x. Of course, you'll end up
>writing scripts that only you can use :)
How can words on a screen be spoken too fast? Did you read them too fast?
-Anyway, no, I can't switch over to my own 2.7.X as the file can't be modified.
The proper way to do that would be to replace GIMP's python.exe and pythonw.exe
with links to the desired ones.
Even if it's possible, I'm pretty sure it'd lose the all-important gimpfu
module.

-- 
FierySwordswoman (via www.gimpusers.com/forums)
___
gimp-user-list mailing list
List address:gimp-user-list@gnome.org
List membership: https://mail.gnome.org/mailman/listinfo/gimp-user-list
List archives:   https://mail.gnome.org/archives/gimp-user-list


[Gimp-user] Custom Script UI

2016-10-14 Thread FierySwordswoman
>
>As you say TkInter isn't in the GIMP supplied Python (which is a pity
>as it uses native file browsers instead of the GTK abomination), but
>you can use PyGTK, which you should be able to understand quite
>readily as you have TkInter experience.
>
>Here's a relatively simple PyGTK GIMP plug-in I wrote some time ago:
>https://bitbucket.org/paynekj/paynekj-gimp-scripts/src/2e8e87faf5eaaf6036e0d8b68ff9f6f37a3f0421/plug-ins/pygtk_add_multiple_guides.py?at=default
>
>Kevin

Ah, thanks. It does indeed remind me of TkInter. I should be able to
reverse-engineer your example code to do some useful stuff.

-Ideally, I use the os module for most of my file-browser-esque operations. Once
I learn how to make more complex Kivy widgets, my current and future programs
that use file explorers will likely use a hand-made solution instead of Kivy's
default widget. When I made my first program (Used TkInter), making my own file
explorer turned out pretty nicely.

-- 
FierySwordswoman (via www.gimpusers.com/forums)
___
gimp-user-list mailing list
List address:gimp-user-list@gnome.org
List membership: https://mail.gnome.org/mailman/listinfo/gimp-user-list
List archives:   https://mail.gnome.org/archives/gimp-user-list


Re: [Gimp-user] Custom Script UI

2016-10-13 Thread Ofnuts

On 13/10/16 20:13, FierySwordswoman wrote:

You have to use register(), but you can have an empty parameter list.
Then your plugin is called directly without the Gimp-built dialog.

What, you mean with no "PF-XXX" parameters? Yeah, I got that much as I've made
scripts with both no UI and the built-in UI before. I'm rather certain it still
wants you to use their UI, though.


Something like this:

register(
'new-image',
'Creates a new image','Creates a new image',
'Myself','Myself',
'2012',
'Create new image',
'',[],[],
newImage,
menu='/File/Create/'
)

This script will run without showing up a dialog, and will even run if 
no images are open in Gimp.



Even if that's all it took, there's still the issue of gimp using a watered down
Python 2.7.5, which I'm not sure how to add normal modules to.


Pip could work...


I assume Kivy's
pretty much out of the question, but TkInter's normally built in to python,
except with gimp a number of base modules, including TkInter, aren't present
anymore.


As Kevin says, PyGTK is a good option.

I already have python 3.4 and 2.7 installations on my pc, but it's unlikely they
can be made relevant here.


Don' t speak to fast, and check the 
/lib/gimp/2.0/interpreters/pygimp.interp file in the Gimp install tree. 
You can very likely switch to your own 2.7.x. Of course, you'll end up 
writing scripts that only you can use :)



___
gimp-user-list mailing list
List address:gimp-user-list@gnome.org
List membership: https://mail.gnome.org/mailman/listinfo/gimp-user-list
List archives:   https://mail.gnome.org/archives/gimp-user-list


Re: [Gimp-user] Custom Script UI

2016-10-13 Thread Kevin Payne
>What, you mean with no "PF-XXX" parameters? Yeah, I got that much as I've made
>scripts with both no UI and the built-in UI before. I'm rather certain it still
>wants you to use their UI, though.

>Even if that's all it took, there's still the issue of gimp using a watered 
>down
>Python 2.7.5, which I'm not sure how to add normal modules to. I assume Kivy's
>pretty much out of the question, but TkInter's normally built in to python,
>except with gimp a number of base modules, including TkInter, aren't present
.anymore.

As you say TkInter isn't in the GIMP supplied Python (which is a pity as it 
uses native file browsers instead of the GTK abomination), but you can use 
PyGTK, which you should be able to understand quite readily as you have TkInter 
experience.

Here's a relatively simple PyGTK GIMP plug-in I wrote some time ago: 
https://bitbucket.org/paynekj/paynekj-gimp-scripts/src/2e8e87faf5eaaf6036e0d8b68ff9f6f37a3f0421/plug-ins/pygtk_add_multiple_guides.py?at=default

Kevin
___
gimp-user-list mailing list
List address:gimp-user-list@gnome.org
List membership: https://mail.gnome.org/mailman/listinfo/gimp-user-list
List archives:   https://mail.gnome.org/archives/gimp-user-list


Re: [Gimp-user] Custom Script UI

2016-10-13 Thread Ofnuts

On 13/10/16 00:14, FierySwordswoman wrote:

I've been learning Python as a hobby for a while and can now write my own user
interfaces in TkInter or the 3rd party Kivy.

I'm trying to launch my own UI that can run Procedural Database plugins and
whatnot, but I can't figure out how to create a GIMP python plugin without using
the "Register(...)" command and it's built-in widgets.
Any help on how to get started with this is appreciated.

 You have to use register(), but you can have an empty parameter list. 
Then your plugin is called directly without the Gimp-built dialog.


___
gimp-user-list mailing list
List address:gimp-user-list@gnome.org
List membership: https://mail.gnome.org/mailman/listinfo/gimp-user-list
List archives:   https://mail.gnome.org/archives/gimp-user-list


[Gimp-user] Custom Script UI

2016-10-12 Thread FierySwordswoman
I've been learning Python as a hobby for a while and can now write my own user
interfaces in TkInter or the 3rd party Kivy.

I'm trying to launch my own UI that can run Procedural Database plugins and
whatnot, but I can't figure out how to create a GIMP python plugin without using
the "Register(...)" command and it's built-in widgets.
Any help on how to get started with this is appreciated.

-- 
FierySwordswoman (via www.gimpusers.com/forums)
___
gimp-user-list mailing list
List address:gimp-user-list@gnome.org
List membership: https://mail.gnome.org/mailman/listinfo/gimp-user-list
List archives:   https://mail.gnome.org/archives/gimp-user-list