Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rename layers (visible or linked)
#1
Is there any way to rename the layers in gimp? Preferably if there was some way to rename only visible and/or linked layers.

I know there is the plugin under Filters-Animation-Rename Layers....

But this filter is for animation, and only renames the name of the Prefix, determines the Delay and allows whether or not to include "Replace" in the layer name.

I'd like to be able to rename the layers indexed by adding a prefix of my choice (not just 'Frame').

Something like the Export All Layers plugin (ofn-export-layers), but without having to export the layers (Renaming them directly while editing).

Thx!
                               .....
Samj PortableGimp 2.10.28 - Win-10 /64.
Reply
#2
(03-23-2022, 06:24 PM)Krikor Wrote: ....Preferably if there was some way to rename only visible and/or linked layers.
I'd like to be able to rename the layers indexed by adding a prefix of my choice (not just 'Frame').

I do not know of anything like that. Only this old plugin - anitools.py - which will rename all the layers , visible or not visible.
I use it with a blank name and it just numbers the layers, 0 to nnn 
Run it again and it can add a suffix. It is old, so not clever when it comes to layer groups.

Your question makes a good request for one of the coding guys. Maybe one will make such a script.

anitools.zip attached, unzip and put in the plug-ins folder. Find it in the Tools menu


Attached Files
.zip   anitools.zip (Size: 1.07 KB / Downloads: 110)
Reply
#3
(03-23-2022, 07:41 PM)rich2005 Wrote: I do not know of anything like that. Only this old plugin - anitools.py - which will rename all the layers , visible or not visible.
I use it with a blank name and it just numbers the layers, 0 to nnn 
Run it again and it can add a suffix. It is old, so not clever when it comes to layer groups.

Your question makes a good request for one of the coding guys. Maybe one will make such a script.

anitools.zip attached, unzip and put in the plug-ins folder. Find it in the Tools menu

In the group, only the group name was renamed, the inner layers of this group did not have their names changed.

But having multiple groups and needing to rename multiple layers both inside and outside of groups, it would be critical for the plugin to allow us to select which layers we want to rename.

Something like: Head 01, Head 02, ..., Head 25; Eyes 01, Eyes 02, ..., Eyes 14; Hair 01, ..., Hair 12; etc.

But the plugin in other cases will be very useful.

Thank you rich2005!
                               .....
Samj PortableGimp 2.10.28 - Win-10 /64.
Reply
#4
Hello Krikor
I must be not understand something here , when I need to change the name of a layer or group or layer within a group I go to the Layers dialog box choose the item ( layer or group or layer within a group ) right click and select Edit Layer Attributes there "layer name" can be changed inc six or seven other layer properties,
ATM I using an older version of GIMP 2.10.12 not on rolling releases anymore, gone for a static distro. nice and slow,
thou that method did work with the newer Gimp I was using rolling distro,
Have I read your question wrong ?
Regards
Redrawn
Reply
#5
I saw this last night searching but did not get a chance to try-out. 
https://magoarcade.org/gimp-plugin-searc...yer-names/

It does use visible layers and layer groups. A little specific, might be useful for layer groups.

search-replace.py zipped and attached

edit: Ah.. it has a credit to Ofnuts Wink


Attached Files
.zip   search-replace.zip (Size: 1.47 KB / Downloads: 79)
Reply
#6
(03-24-2022, 09:02 AM)Redraw Wrote: Hello Krikor
I must be not understand something here , when I need to change the name of a layer or group or layer within a group I go to the Layers dialog box choose the item ( layer or group or layer within a group )  right click and select Edit Layer Attributes there "layer name" can be changed inc six or seven other layer properties,
ATM  I using an older version of  GIMP 2.10.12   not on rolling releases anymore, gone for a static distro. nice and slow,
thou that method did work with the newer Gimp I was using rolling distro,
Have I read your question wrong ?
Regards
Redrawn

Hello Redraw,
Your understanding is correct when it comes to renaming layers. But the point is to try to avoid renaming one by one when you have hundreds of layers that need to be renamed.

I often create a new layer by copying a previous layer, thereby generating layer names like Layer #1, Layer #2, ..., Layer #15, etc. Or, Layer name Copy #1, ..., Layer name copy #8.

At some point it is necessary to organize the names of the layers, but renaming them one by one is very boring and time consuming. Hence the need for a plugin that works in this routine.

Grateful for the attention!

(03-24-2022, 09:23 AM)rich2005 Wrote: I saw this last night searching but did not get a chance to try-out. 
https://magoarcade.org/gimp-plugin-searc...yer-names/

It does use visible layers and layer groups. A little specific, might be useful for layer groups.

search-replace.py zipped and attached



This script (search-replace.py) is very close to fulfilling the wishes I expressed in post #1 of this topic.

I made visible only the layers I wanted to rename.
I asked him to rename only the visible layers.
He did that.

I chose the prefix 'Left' to be used, which should generate layers named Left 0, Left 1, Left 2, etc.

But the result was something strange (see image)
[Image: NwDzaHv.png]

I also noticed that the ideal would be if the plugin could show us the existing layer groups and then allow us to choose which or which of them we would like to rename the layers (visible or indexed) - This would avoid having to redo all the selection of which layers would be or not visible with every rename.

(03-24-2022, 09:23 AM)rich2005 Wrote: edit: Ah.. it has a credit to Ofnuts Wink
Hummm really? Could you be revealing a secret profile of ofnuts without realizing it?  Wink

Thx again rich2205!
                               .....
Samj PortableGimp 2.10.28 - Win-10 /64.
Reply
#7
I use the bates' layers attributes scm (I modified it just a bit)
It renames with auto increment, Layer ➤ Multi-Layer Tools ➤ Edit Multiple Layers Attributes... It renames layers and the groups' names but NOT inside a group

If it can help

.7z   bates-layers-attributes.scm.7z (Size: 2.34 KB / Downloads: 117)

   
Reply
#8
(03-24-2022, 07:21 PM)PixLab Wrote: I use the bates' layers attributes scm (I modified it just a bit)
It renames with auto increment, Layer ➤ Multi-Layer Tools ➤ Edit Multiple Layers Attributes... It renames layers and the groups' names but NOT inside a group

If it can help

Ohh .scm, I love being able to install scripts without having to restart Gimp later.  Smile

I really enjoyed this script!
While it doesn't fulfill all my dreams (see post #1), it's a versatile tool.

It considers the groups as a single layer, so if there are 2 layers, a group with 10 inner layers and another 5 layers (in that order from bottom to top) it will work as if there were 8 layers (2+1+5).

It allows layers to be linked after being renamed.
This makes it easier to group the layers again after renaming.

How I proceeded in my initial test:
1- I ungrouped the layers of a certain group;
2- Knowing in which interval the ungrouped layers were, I provided these indices to the script (Start at which layer? / End at which layer?);
3- I checked the option to link the layers;
4- After renaming, I used another filter to group the linked layers. (restoring the initial status quo)

A small discomfort in using this script is in terms of counting the layers so that we can give the script the correct instruction on from what point to what point to rename the desired layers.

But at the moment, among the options I had, it proved to be the best option.

PixLab, thanks for the help!
                               .....
Samj PortableGimp 2.10.28 - Win-10 /64.
Reply
#9
Quote:Ohh .scm, I love being able to install scripts without having to restart Gimp later

Have you tried ofnuts resources manager ?

Quote:How I proceeded in my initial test:
 
I think I have just replicated your procedure Wink 

FWIW 3 minutes video



Reply
#10
(03-25-2022, 11:55 AM)rich2005 Wrote:
Quote:Ohh .scm, I love being able to install scripts without having to restart Gimp later

Have you tried ofnuts resources manager ?

Yea! Once I learned how to use it, I don't give up on it. A must for every user of this plugin.
But I don't use it for plugins and scripts, and the reason is that I like to see these filters in your menus, it helps me to memorize the existence of these filters and not ostracize them.

(03-25-2022, 11:55 AM)rich2005 Wrote:
Quote:How I proceeded in my initial test:
 
I think I have just replicated your procedure Wink 

FWIW 3 minutes video

[video][/video]

Yes, my procedure was practically the one shown in the video, but I used another script for that; the one provided by PixLab in post #7.

I don't have this rename-layers.scm script. Could you please indicate where I can download it or make it available?

I noticed that with rename-layers.scm there is no need to count the positions of the layers to tell the script which layers to rename, just make them visible (as is done with bates-layers-attributes.scm).
It also seems to me to have some versatility in the way we can rename layers. I would like to test it.

Watching the video, I even thought it was strange that you indicated search-replace.py in post #5 but didn't make any indication about this script (rename-layers.scm).

Rich2005, as always thank you very much!

EDITED:

Ok, I did a search and found the rename-layers.scm at https://www.gimp-forum.net/Thread-layerg...8#pid18718

Thx rich2205!
                               .....
Samj PortableGimp 2.10.28 - Win-10 /64.
Reply


Forum Jump: