0

In GIMP 2.10.18 - after creating a text layer, I edit the layer attributes to give the text layer a meaningful name. This is important as I'm working with a python script that will reference the layer names.

However, when I modify the text - it changes the name of the layer too! This means that the script that automatically changes the contents of the text will inadvertently change the name of the layer as well, breaking the script!

Is there any way to turn this feature off?

  • Hi. Welcome to GDSE. What particular version of GIMP 2.10? I'm using 2.10.18 and I can't replicate that problem. When I edit the text layer name, then edit the text afterwards, the layer name remains the same as I renamed it. – Billy Kerr Jul 9 at 17:05
  • @BillyKerr cheers - I'm also using 2.10.18. I just tested it again on a new image and same problem. I can't work out why it would behave that way on yours and behave differently on mine. Other than my one plugin, it's otherwise a fresh install of gimp with no modifications. I tested removing the plugin and the effect is the same. I'm dumbfounded as to this behaviour. – Mike Baxter Jul 9 at 17:31
0

Not as far as I know. There are however several workarounds:

If you have only one set of layers to process, you can set the "chainlink" indicator (and retrieve it with layer.linked or the PDB equivalent).

If you need to distinguish several sets of layers there are several possibilities:

Layer groups

Put the layers in layer groups (one for each processing) and iterate the children of each group.

Color tags

Set different color tags on the layers (this can be retrieved with pdb.gimp_item_get_color_tag(item)). The good side of the technique is that color tags can be set (and checked) with the UI, and won't have side effects like groups.

enter image description here

"Parasites"

Parasite are named values that you can add to Gimp items. You can attach parasite to layers:

# attach:
parasite=gimp.Parasite('<name>','<value>)
layer.parasite_attach(parasite)

# retrieve:
parasite=layer.parasite_find('<name>')
value=parasite.data

# remove:
layer.parasite_detach('<name>')

This would require a side script (for instance, one that copies the initial layer names to parasites) but the processing becomes completely independent from the name.

| improve this answer | |
  • parasites are the thing that won't affect the UI - I think they should be preferred. – jsbueno Jul 9 at 23:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.