With the release of RC1 some of the plugins that I have been porting have broken because noise filters are no longer accesible through pdb. So I have tried to create equivalent filters as functions using Gegl. This is quite simple to try using Gegl Graph but my attempt to write the function does not work and I get an error message
Gimp-3.0: Gimp-Core-CRITICAL: gimp_drawable_merge_shadow_buffer: assertion ‘GEGL_IS_BUFFER (drawable->private->shadow)’ failed
The code for the function is
def Solid_Noise(self, drawable, xset, yset, detset, tileset, turbset):
"""Based on Gegl graph
id=in
gegl:noise-solid
x-size=12
y-size=4
detail= 8
svg:src-over
aux =[ ref=in ] which works as expected"""
drawwidth = drawable.get_width()
drawheight = drawable.get_height()
draw_buffer = drawable.get_buffer()
draw_shad_buffer = drawable.get_shadow_buffer()
graph = Gegl.Node()
draw_in = graph.create_child("gegl:buffer-source")
draw_in.set_property("buffer", draw_buffer)
noise = graph.create_child("gegl:noise-solid")
noise.set_property("x-size", xset)
noise.set_property("y-size", yset)
noise.set_property("detail", detset)
noise.set_property("tileable", tileset)
noise.set_property("turbulent", turbset)
noise.set_property("seed", random.randint(1, 16384))
noise.set_property("width", drawwidth)
noise.set_property("height", drawheight)
comp = graph.create_child("svg:src-over")
output = graph.create_child("gegl:write-buffer")
output.set_property("buffer", draw_shad_buffer)
draw_in.connect("output", comp, "input")
noise.connect("output", comp, "aux")
comp.connect("output", output, "input")
output.process()
draw_shad_buffer.flush()
drawable.merge_shadow(True)
drawable.update(0, 0, drawwidth, drawheight)
Gimp.displays_flush()
return
I guess I am missing something but what I cannot see. Any ideas please!