[Gimp-developer] python plugin dos not receives changes to FLOATARRAY parameters done by libgimp functions.

2006-03-14 Thread Kleistereimer
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
___
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer


Re: [Gimp-developer] python plugin dos not receives changes to FLOATARRAY parameters done by libgimp functions.

2006-03-14 Thread Manish Singh
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
___
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer