Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
python scripting: image update and calling strategies
#1
I am trying to develop my first python script and i am stumbling into some questions,
i am quite stuck ....
and i am wondering whether i am searching for something which is not possible:


a) As a starting point i was trying to recreate the  Brightness-Contrast menu using the: pdb.gimp_drawable_brightness_contrast() function.

I managed to setup the UI for brightness and contrast, but:
I would like to be able to recreate the functionality of the original menu,
especially including the realtime update in my image,
which the original gimp menu is capable off, but how? is it even possible?

b) I would like to be able to create several python scripts which are able to call each other,
but i could not find a error-free way to call another python script.
For example: the first file  "contrast_filter.py" which calls after execution the second file   "levels_filter.py"


Any suggestions would be very appreciated - Thanks Wink

i will attach the python file here zipped.


Attached Files
.zip   sk_simple_contrast_UI.zip (Size: 633 bytes / Downloads: 271)
Reply
#2
a) plugins do not have access to the UI (this is conscious design decision, AFAIK), so you can't currently make a plugin that updates the layer in real time. Best you can do is update a preview in some window managed by your plugin (PyGTK).

b) If the files are in the same directory, one can import the other. If both files are Gimp plugins, both appear in the PDB, so you can call one from the other using pdb.python_fu_my_plugin_atom() if you registered the plugin as my-plugin-atom. You may want to define returned values in your plugins if you do so.
Reply


Forum Jump: