Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Learn to create Python3 plugins
#4
Now I passed to the second point: Porting a python2 plugin to python3, but I find a problem on creating a simple transparent layer:
Code:
# ERROR add new trasparent layer
overlay_layer = Gimp.Layer.new(
                       image, 'hide_background',
                       drawable.get_width(), drawable.get_height(),
                       Gimp.ImageType, 100.0,
                       Gimp.LayerMode.NORMAL
)
overlay_layer.fill(Gimp.FillType.TRANSPARENT)
It say that image is not of type Gimp.ImageType:
Code:
File "/home/opensuse/.var/app/org.gimp.GIMP/config/GIMP/2.99/plug-ins/add_baloon/add_baloon.py", line 114, in run
   overlay_layer = Gimp.Layer.new(
TypeError: Expected a Gimp.ImageType, but got type

Why? What I do wrong?
The full code can be find here.
Reply


Messages In This Thread
Learn to create Python3 plugins - by z-uo - 12-27-2021, 09:59 AM
RE: Learn to create Python3 plugins - by z-uo - 12-27-2021, 04:12 PM
RE: Learn to create Python3 plugins - by z-uo - 12-28-2021, 11:14 AM
RE: Learn to create Python3 plugins - by z-uo - 12-28-2021, 07:27 PM
RE: Learn to create Python3 plugins - by z-uo - 12-29-2021, 05:07 PM
RE: Learn to create Python3 plugins - by z-uo - 12-30-2021, 10:16 AM
RE: Learn to create Python3 plugins - by z-uo - 12-30-2021, 04:56 PM
RE: Learn to create Python3 plugins - by z-uo - 12-30-2021, 05:54 PM
RE: Learn to create Python3 plugins - by z-uo - 12-31-2021, 08:40 AM
RE: Learn to create Python3 plugins - by z-uo - 01-02-2022, 10:37 AM

Forum Jump: