Python plugin development - Printable Version +- Gimp-Forum.net (https://www.gimp-forum.net) +-- Forum: GIMP (https://www.gimp-forum.net/Forum-GIMP) +--- Forum: Extending the GIMP (https://www.gimp-forum.net/Forum-Extending-the-GIMP) +--- Thread: Python plugin development (/Thread-Python-plugin-development) |
Python plugin development - Milarck - 01-06-2022 Hello here! I've been trying to make a Python plugin for Gimp for two days now. For now, my goal is quite simple, I want to be able to create / duplicate layers, etc. So I made my python file, put it in the right folder, registered it, etc. Here is the code I got for now: Code: #!/usr/bin/env python As a result, I got displayed in the warning console: "Test 1" "Test 2" "Test 3" And that's it. It seems that the line "img = gimp.image(width, height, RGB)" stops the script (without error message), while nothing seems particularly off with it. Actually, this line of code was copy pasted from this documentation (sample, section 2.1). As I'm working on this, I have the feeling to be dealing with a development that seems quite random. Not having the possibility to work in a proper development environment is really tiring, each time I'm coming up with something I have to save the python script, go in gimp, launch the script, see if it works, retry... Do someone have advices on this matter? Thank you very much. RE: Python plugin development - Ottia Tuota - 01-06-2022 I got the plugin working with all warnings 1..6 in the error console. The only changes I made were: gimp.image -> gimp.Image gimp.layer -> gimp.Layer Note the capital letters. In the sample you mentioned, the letters indeed were lower case. I don't know what this is about. Perhaps somebody else can explain. I found the capital letters by writing "help(gimp)" in the Python console. RE: Python plugin development - nelo - 01-07-2022 There is quite a nice introduction to GIMP python scripting here: https://www.youtube.com/playlist?list=PLyRItRv4aHfOuUC8a1SMeTLV08wxdnWt- RE: Python plugin development - gasMask - 01-08-2022 nelo, Could you please double-check your YouTube playlist link? When I follow the link, I don't get a playlist. RE: Python plugin development - rich2005 - 01-08-2022 I am sure nelo will come along and give advice. Looks like it loses the final - Code: https://www.youtube.com/playlist?list=PLyRItRv4aHfOuUC8a1SMeTLV08wxdnWt- These are the Jackson Bates tutorials, excellent series. this is the first one. https://www.youtube.com/watch?v=cPQRxZo9BJE&list=PLyRItRv4aHfOuUC8a1SMeTLV08wxdnWt-&index=1 maybe that works for you. RE: Python plugin development - nelo - 01-08-2022 Thanks Rich for helping out with the link. Those are the ones I wanted to show to the OP. I think they give a good overview on how to start with GIMP Python development. |