[Gimp-developer] How to create a GimpFloatArray in Python plugin?



Specifically, to pass as third arg to Gimp.PDB.gimp_pencil(layer, 4 line).
Said argument should be GimpFloatArray according to PDBBrowser.

I create a GimpValueArray to pass args to the pdb.  To create a GValue for
the third arg, I tried:

GObject.Value(Gimp.FloatArray.__gtype__, (1.0, 1.0, 1.0, 1.0)

which throws exception .... Expected: Boxed.
Thrown by pygobject/gi/pygi-value.c about line 556.
At line 537, it seems like it should work if G_VALUE_HOLDS(value,
G_TYPE_ARRAY) for GimpFloatArray gtype.
My understanding is that PyGObject would then create a GArray from the
Python list of floats for the value of the GValue.

My best guess is Gimp is missing GI annotations or implementation for
GimpFloatArray.

Using Gimp 2.99, I am porting GimpFu.

There might be a related problem receiving GimpInt32Array *from* Gimp (not
*to* Gimp as above.)

I suppose I could try the Lua or Scheme binding.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]