Hi,
I use GIMP3.04 on Kubuntu 24.02.
There is a image which has multiple layers and each layer has mask. I would like to remove the mask of first layer and copy the second layer mask to first layer with Python script. However I failed it.
I wrote following codes.
layers = image.get_layers()
layers[0].remove_mask(1)
mask = layers[1].get_mask()
layers[0].add_mask(mask)
However, I encountered following error messages.
Calling error for procedure ‘gimp-layer-add-mask’:
Item ‘L mask mask’ (5) has already been added to an image
Even if I remove the mask once, it seems that the mask flag of the layer is kept and I can’t add a copied mask to the layer. Is there any way to resolve this issue?