Batch rename prefix of a layer

A forum dedicated to George scripting questions
Post Reply
apsteak
Posts: 1
Joined: 11 Dec 2021, 18:01

Batch rename prefix of a layer

Post by apsteak »

Hi everyone!

I wanted to know if it is possible via George script to change the prefix of all the layer. For instance, if I want to convert all my tiedown layers (prefix TD_) to clean (prefix CL_), what George command should I use?

Thanks a lot!
User avatar
Thierry
Site Admin
Posts: 2780
Joined: 07 Jan 2013, 08:28

Re: Batch rename prefix of a layer

Post by Thierry »

Hey apsteak,

This is very much doable in George, with the tv_LayerRename function: https://www.tvpaint.com/doc/tvp11/index ... ayerrename
That can be done in 2 loops:
- first loop: Search for all layers that start with "TD_", store them in a table
- second loop: for each layer of that table, create a new name starting with "CL_", and use the rest of the old layer name (basically replacing the first three characters of the layer name), then use tv_LayerRename and apply the new name.

That will require a tiny bit of character-by-character management, but this isn't that complicated :)
Post Reply