Yesterday, 04:19 AM (This post was last modified: Yesterday, 04:26 AM by teapot.)
(Yesterday, 01:24 AM)trandoductin Wrote: I looked at the gegl command.py
and I have no clue how to make it so that I can call kaleidoscope... from python fu for GIMP 2.10
any help available?
I've used the kaleidoscope fine with gegl command in 2.10.
You make a string something like this (this example hasn't got all the parameters but their types are all straightforward double / int / boolean):
mirrors n-segs=6 input-scale=100.00 o-x=0.04 clip=true
However when I did it some time ago I thought offset and centre were mixed up. It may not be the case anymore but worth keeping a lookout for. The above link says:
Offset X name: c-x
Offset Y name: c-y
Center X name: o-x
Center Y name: o-y
You call gegl command with parameters image, layer, gegl_string.
Thanks teapot.
Do you have an example of how you call gegl command?
I tried using the below found code but it's breaking for me.
def use_gegl_graph(image, drawable, gegl_graph_string):
class GeglBuffer(Structure):
pass
drawable_id = drawable.ID
Yesterday, 09:29 AM (This post was last modified: 3 hours ago by teapot.)
(Yesterday, 07:36 AM)trandoductin Wrote: Thanks teapot.
Do you have an example of how you call gegl command?
Tricky, there are several versions floating around. I believe the original was by paynekj, Kevin Payne. I use the one below but I cannot remember where I got it.
Yesterday, 12:19 PM (This post was last modified: Yesterday, 12:35 PM by trandoductin.)
There must be something wrong with windows.
I can't get it to work
on windows I had to do
import ctypes
from ctypes.util import find_library # This is the correct import
if pl == 'win32':
return ctypes.CDLL(find_library(lib + '-0'))
Yesterday, 12:49 PM (This post was last modified: Yesterday, 12:50 PM by rich2005.)
Well, as a non-coder, using Kevin's plugin gegl_command.py and a little shell script to call it, for_gegl.py That works in Windows 10 (VM) / Gimp 2.10.38
Yesterday, 01:28 PM (This post was last modified: Yesterday, 01:31 PM by trandoductin.)
Thanks to Kevin and teapot I was able to fulfill a request for client now just waiting to hear back from them.
Maybe Windows 10 VM understood the ctypes.util, on mine it was complaining that there is not util attribute in ctypes and I asked chatGPT and chatGPT gave me that from ctypes.util import find_library code which works
Not sure why it would blow up on me i mean it's the same thing (to me).
Ah I noticed you attached a file rich and looked at it and for windows it's also doing the from ctypes.util import find_library so that would work (strange how that is to me).
(Yesterday, 01:28 PM)trandoductin Wrote: Thanks to Kevin and teapot I was able to fulfill a request for client now just waiting to hear back from them.
Maybe Windows 10 VM understood the ctypes.util, on mine it was complaining that there is not util attribute in ctypes and I asked chatGPT and chatGPT gave me that from ctypes.util import find_library code which works
Not sure why it would blow up on me i mean it's the same thing (to me).
Ah I noticed you attached a file rich and looked at it and for windows it's also doing the from ctypes.util import find_library so that would work (strange how that is to me).
There is a problem with the version I put in post #4, I only have Linux so didn't realise. I think changing just the import statement should fix it. If any Windows users could try the one below and say if it works that would be helpful. Thanks.
Code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# print 'gegl_command.py: __name__', __name__
import sys
import ctypes.util
import gimpfu
def load_library(lib):
pl = sys.platform
if pl == 'linux' or pl == 'linux2':
return ctypes.CDLL(lib + '.so.0')
if pl == 'win32':
return ctypes.CDLL(ctypes.util.find_library(lib + '-0'))