Scripting GEGL operations - 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) +---- Forum: Scripting questions (https://www.gimp-forum.net/Forum-Scripting-questions) +---- Thread: Scripting GEGL operations (/Thread-Scripting-GEGL-operations) Pages:
1
2
|
Scripting GEGL operations - Kevin - 06-01-2020 As someone eventually raised an issue about scripting GEGL: https://gitlab.gnome.org/GNOME/gimp/-/issues/1686 I took the code Massimo wrote and butchered it a bit to make it easier to create multiple PDB entries. I would appreciate it if someone on Linux would try out my code to see if it works (as I only have Windows). Suggestions on code improvements/re-writes welcome There are two files in the zip archive. The Python that does the work and the .scm that uses the new gegl operations, which registers scripts here [attachment=4461] Thanks EDIT 2020.08.24: Removed attachment as it's the wrong way to do it. RE: Scripting GEGL operations - rich2005 - 06-01-2020 kubuntu 18.04 / Gimp 2.10.18 (appimage) (regular Gimp 2.10.14 the same) I get error messages here: https://i.imgur.com/gwwpk3J.jpg This for waterpixels, the other two similar. The gegl operation does work when applied manually. Looks like it is case sensitive Average / average Tried adjusting your script-fu on that basis without success. edit: using gimp 2.10.14 & gimp --verbose Looks like the python plugin not working due to the Windows path "C:/....." Which would explain the error messages. Code: Querying plug-in: '/home/rich/gimp210/plugin-test/fu-python-gegl_ops_test.py' [/color] RE: Scripting GEGL operations - Kevin - 06-01-2020 @rich2005 I've just spotted a thing that might break the python: Try comenting out the lines at the top: Code: #import sys As that's redirecting print and error messages to a file on my Windows machine that you don't have. RE: Scripting GEGL operations - rich2005 - 06-01-2020 yes, I assumed that. disabled that now this Code: Querying plug-in: '/home/rich/gimp210/plugin-test/fu-python-gegl_ops_test.py' looks like it should be libgimp-2.0.so.0 RE: Scripting GEGL operations - Kevin - 06-01-2020 That's the thing I was most concerned about - would it open the correct library. Is it possible that the library will have different names on different Linux distributions? RE: Scripting GEGL operations - rich2005 - 06-01-2020 I had a look in my PClinuxOS desktop, which is a bit different to this kubuntu notebook. Still the same although different folders (usr/lib vs. usr/lib64) libgimp-2.0.so.0 is the name and is a symbolic link to the current version file) Got your scripts working here, kubuntu 18.04 / gimp 2.10.14 The python plugin - line 1 and line 11 Code: #!/usr/bin/env python2 and the script - just the upper case Code: SF-OPTION "Superpixels Color" '("average" "random") I will attach the files I used, just in case. More linux testers needed. As a test I called gegl up in the BIMP dialog, get both and seems to work: https://i.imgur.com/SDYf9Tf.jpg It might bring new life back to BIMP. RE: Scripting GEGL operations - Kevin - 06-03-2020 Thank you rich2005 I was hoping Ofnuts for code advice and tmanni as the "Resident GEGL Expert" might have commented. So I'll save this up for the next time someone asks if a GEGL operation is scriptable. RE: Scripting GEGL operations - Kevin - 06-03-2020 Well I've just discovered that I can simplify the whole thing because you can send GEGL the same string as is entered in the GEGL graph, thus leaving the constructing of the parameter list up to the script-writer. Code to follow... RE: Scripting GEGL operations - Kevin - 06-03-2020 OK here's the code [attachment=4477] The python creates a new PDB entry for gegl-gegl: [attachment=4478] The .scm just gives a demo call of gegl-gegl that illustrates that the string to pass is the same as is used manually with the GEGL graph [attachment=4479] I think the issue with the dynamic library name is going to cause problems for Linux users. [attachment=4480] RE: Scripting GEGL operations - rich2005 - 06-03-2020 That works ok here: kbuntu 18.04 / Gimp 2.10.18 [attachment=4481] I did write the GEGL operations on separate lines in your script, rather than use /n linefeeds The libgimp-2.0.so question. A search libgimp-2.0.so + deb or + rpm gets a reference to the libgimp2.0-dev package which is not installed by default. Need to compile a plugin? Get the dev package. example. https://packages.debian.org/search?suite=sid&arch=i386&mode=filename&searchon=contents&keywords=libgimp-2.0.so Fedora / CentOS / Mageia, etc rpm packages the same. I think safe to assume the average linux user will have libgimp-2.0.so.0 |