RSS/Atom feed Twitter
Site is read-only, email is disabled

python plugin dos not receives changes to FLOATARRAY parameters done by libgimp functions.

This discussion is connected to the gimp-developer-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

2 of 2 messages available
Toggle history

Please log in to manage your subscriptions.

python plugin dos not receives changes to FLOATARRAY parameters done by libgimp functions. Kleistereimer 15 Mar 01:43
  python plugin dos not receives changes to FLOATARRAY parameters done by libgimp functions. Manish Singh 15 Mar 03:33
Kleistereimer
2006-03-15 01:43:12 UTC (about 18 years ago)

python plugin dos not receives changes to FLOATARRAY parameters done by libgimp functions.

hi!

i wrote a c gimp plugin which is called from an python gimp plugin. the c plugin receives a FLOATARRAY parameter which it modifies. the c plugin sees the values the python plugin has put into the FLOATARRAY, but if it modifies these, this changes are not send back to the python plugin.

how to made it work? do i have to change my python or my c plugin? do i have to modify gimps python-plugin-interface?

i guess some special converter has to be written to automaticaly construct a python array from FLOATARRAYS.

an equivalent question: how to use gimp_path_get_points from a python plugin?

here some samplecode:

def somefunc(image):

floatarray = [] for i in range(100):
floatarray.append(0.0)

closed = 0 count = 0

gimp.pdb.gimp_path_get_points(image, "path1", 1, closed, count, floatarray)

return floatarray

""" floatarray should be modified by 'gimp_path_get_points' but it's not. how to get this values transfered to the python plugin? """

regards
kl

Manish Singh
2006-03-15 03:33:39 UTC (about 18 years ago)

python plugin dos not receives changes to FLOATARRAY parameters done by libgimp functions.

On Wed, Mar 15, 2006 at 01:43:12AM +0100, Kleistereimer wrote:

how to use gimp_path_get_points from a python plugin?

here some samplecode:

def somefunc(image):

floatarray = [] for i in range(100):
floatarray.append(0.0)

closed = 0 count = 0

gimp.pdb.gimp_path_get_points(image, "path1", 1, closed, count, floatarray)

return floatarray

""" floatarray should be modified by 'gimp_path_get_points' but it's not. how to get this values transfered to the python plugin? """

No, that's now how things work. This is how you do it:

def somefunc(image): path_type, path_closed, num_path_point_details, points_pairs = \ pdb.gimp_path_get_points(image, "path1") return points_pairs

Return values are returned as return values, which is the python way to do things. It's not like the C API.

If you browse the PDB within the python console, when you select a procedure at hit "Apply", it will paste a sample of how to call it in to the console entry box.

-Yosh