Page 1 of 1

New layer button + ABOVE the current layer

Posted: 09 Sep 2021, 02:44
by Animationriver
HELLO!
There is a button. It makes a new clean layer below the current layer.
Question.
Help make a new button. Which makes the new layer ABOVE the current layer.
Please.
This affects the speed of work.
:D
***

// This scripts reads the name of a layer and gives it a new name with a number at the end. If the last letter of the layer name is a number, the scripts increase the number plus one. Even if there are two or more numbers, it increases just the last number. If the last letter of the layer name is not a number, you will get an error message.

//This script is just a basic idea of giving layers new names with incremental numbers. There is a lot to improve! Use it at your own risk!

tv_LayerCurrentID
curID = result
tv_LayerInfo curID
PARSE result layerDisplay layerPosition layerOpacity layerName layerType layerStart layerEnd layerPrelighttable layerPostlighttable layerSelection

NumberOfLetters = LEN(layerName)
CutPosition=NumberOfLetters
LastLetter = CUT(layerName,CutPosition,NumberOfLetters)
NewLastNumber = LastLetter+1
BaseName = CUT(layerName,1,NumberOfLetters-1)
newName = BaseName""NewLastNumber
tv_LayerRename curID newName

Re: New layer button + ABOVE the current layer

Posted: 09 Sep 2021, 13:58
by NathanOtano
You need to use the tv_layerGetPos function (https://www.tvpaint.com/doc/tvp11/index ... ayergetpos) and then move the layer you created one position before with tv_layermove (https://www.tvpaint.com/doc/tvp11/index ... _layermove)
You can also just create a new layer preset in the new layer menu and you can choose to create it above or under, and then you can put this preset as a shorcut

Re: New layer button + ABOVE the current layer

Posted: 09 Sep 2021, 23:31
by Animationriver
NathanOtano wrote: 09 Sep 2021, 13:58 You need to use the tv_layerGetPos function (https://www.tvpaint.com/doc/tvp11/index ... ayergetpos) and then move the layer you created one position before with tv_layermove (https://www.tvpaint.com/doc/tvp11/index ... _layermove)
You can also just create a new layer preset in the new layer menu and you can choose to create it above or under, and then you can put this preset as a shorcut
Hello! :D
I am extremely grateful to you for this text and links. But I have no skill to do this. For many years I have dreamed of seeing at least one video tutorial. How to copy a script and assemble a button. This would be the most important, most needed video tutorial of my career. But I'm afraid of scripts, I'm just an artist.
Thank you for the answer. But this is not a button. I can not. I do not understand. :D

Re: New layer button + ABOVE the current layer

Posted: 12 Sep 2021, 17:41
by NathanOtano
Please read the tvpaint george wiki or manual, it is pretty straightforward. It’s not about skill but patience, I am an artist too

Re: New layer button + ABOVE the current layer

Posted: 12 Sep 2021, 17:42
by NathanOtano