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

Lloyd Konneker via gimp-developer-list <[email protected]>
Newsgroups gmane.comp.video.gimp.devel
Message-ID <CANtdxPwisCy8RCxLVpKGiZLQN8eLqt7EywnmDBEJvXG9xO977A@mail.gmail.com>
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:    [email protected]
List membership: https://mail.gnome.org/mailman/listinfo/gimp-developer-list
List archives:   https://mail.gnome.org/archives/gimp-developer-list
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.