Hi folks,
I'm new on writing plugins and maybe you can help.
I can create a new layer of all visible and insert it as new top layer by:
layer = pdb.gimp_layer_new_from_visible(image, image, "VisMerge")
I want to insert it outside any layergroup at the top position of the stack
pdb.gimp_image_insert_layer(image, layer, 0, 0)
For whatever reason it does not work.
Later on, I want to remove the layer before I modify again and create a new layer.
When I run this code the first time, the layer obviously cannot yet exist, so
layer = pdb.gimp_image_get_layer_by_name(image, "VisMerge")
pdb.gimp_image_remove_layer(image, layer)
gives me an error.
Can I check somehow if "layer" is a valid layer or not?
if layer == TRUE:
if layer != NULL:
if layer != -1:
doesn't work.