Re: How to create a GimpFloatArray in Python plugin?

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

 



A small example, also shows the problem, with a slightly different error
message:

   args = Gimp.ValueArray.new(4)
    args.insert(0, GObject.Value(Gimp.RunMode, Gimp.RunMode.NONINTERACTIVE))
    args.insert(1, GObject.Value(Gimp.Drawable.__gtype__, drawable))
    args.insert(2, GObject.Value(GObject.TYPE_INT, 4))
    # There is no GObject.TYPE_ARRAY
    #args.insert(3, GObject.Value(GObject.TYPE_ARRAY, (100.0, 100.0, 100.0,
100.0)))
    args.insert(3, GObject.Value(Gimp.FloatArray.__gtype__, (100.0, 100.0,
100.0, 100.0)))
    img = Gimp.get_pdb().run_procedure('gimp-pencil', args)

and get:
    File
"/work/.home/.config/GIMP/2.99/plug-ins/test_float_array/test_float_array.py",
line 28, in foo
    args.insert(3, GObject.Value(Gimp.FloatArray.__gtype__, (100.0, 100.0,
100.0, 100.0)))
  File "/usr/lib/python3/dist-packages/gi/overrides/GObject.py", line 210,
in __init__
    self.set_value(py_value)
  File "/usr/lib/python3/dist-packages/gi/overrides/GObject.py", line 266,
in set_value
    _gi._gvalue_set(self, py_value)
TypeError: Expected Boxed
_______________________________________________
gimp-developer-list mailing list
List address:    gimp-developer-list@xxxxxxxxx
List membership: https://mail.gnome.org/mailman/listinfo/gimp-developer-list
List archives:   https://mail.gnome.org/archives/gimp-developer-list



[Index of Archives]     [Video For Linux]     [Photo]     [Yosemite News]     [gtk]     [GIMP for Windows]     [KDE]     [GEGL]     [Gimp's Home]     [Gimp on GUI]     [Gimp on Windows]     [Steve's Art]

  Powered by Linux