Duplicate Layer with layer name + 1? - BUG REPORT

Please use this part to report bugs & errors, ask questions & "How to..."
Post Reply
User avatar
Sewie
Posts: 1310
Joined: 18 Jun 2008, 11:57
Location: The Netherlands, Europe
Contact:

Duplicate Layer with layer name + 1? - BUG REPORT

Post by Sewie »

So I have a shortcut assigned for duplicating a layer and structure and renaming the layer and it looks like this in the Configure Keyboard Shortcuts Panel:

LPM_002.PNG
LPM_002.PNG (1.23 KiB) Viewed 33783 times

My Layer Preset Manager is set like this:

LPM_001.PNG
LPM_001.PNG (16.58 KiB) Viewed 33783 times

And it kinda works, it duplicates the structure (with instances empty) and adds a new layer with the same name. But what I would really like, is if it added the new layer with an incremental number. For example my layer is named "Sketch 01", I press my shortcut key and TVP adds a layer named "Sketch 02". I press the shortcut key again, "Sketch 03", etc into oblivion.

(Or for that matter: "Sketch" > shortcut key > "Sketch 01" > shortcut key > "Sketch 02", etc into oblivion)

This should be possible, shouldn't it...? If so, the the big question is... But how?? :shock:
Does anybody have any advice?
Last edited by Sewie on 17 Feb 2018, 10:01, edited 1 time in total.
Michael Sewnarain - Website
Windows 11/64b Pro - TVP11.7.0 & 11.7.1 - Pro/64b - Cintiq32 Pro - Intel i7-12700K - 64Gb RAM
User avatar
Animark
Posts: 505
Joined: 16 Oct 2008, 15:26
Location: Berlin

Re: Duplicate Layer with layer name + 1?

Post by Animark »

I use an action
0 Key:Layer:Duplicate Instances
1 Embedded George Script
2 End

And the george script is:
tv_LayerCurrentID
curID = result
tv_LayerInfo curID
PARSE result layerDisplay layerPosition layerOpacity layerName layerType layerStart layerEnd layerPrelighttable layerPostlighttable layerSelection
newName = layerName"_COL"
tv_LayerRename curID newName

It duplicates a layer, clears the instances and adds "_COL" to the name of the layer. I use it to make new layers for coloring.
MyLayer
MyLayer_COL
MyLayer_COL_COL
...

I think, I've found the script somewhere here in the forum. It don't gives incremental numbers, but adds something to the name. So, maybe it helps a bit to find a way to get incremental numbers.
TVPaint 10.5.7 - Win10/64
TVPaint 11.0.8 - Win10/64
TVPaint 11.0.8 - Win10/64 (Wacom Companion 2)
kariP
Posts: 134
Joined: 20 Jul 2010, 19:14
Location: Turku, Finland

Re: Duplicate Layer with layer name + 1?

Post by kariP »

I tried this and I think there's something wrong.

%cln %i should (in my logic) give out
sketch 0
sketch 1
sketch 2
...

But instead it gives
sketch 0
sketch 0 0
sketch 0 0 0
Screen Shot 2018-02-14 at 13.46.53.png
Screen Shot 2018-02-14 at 13.46.53.png (60.04 KiB) Viewed 33728 times

Sewie, is this also what happens with your setup?
Windows 10 (64 bit), 8gb ram, intel i5 10400f. TVpaint 11.7
User avatar
Sewie
Posts: 1310
Joined: 18 Jun 2008, 11:57
Location: The Netherlands, Europe
Contact:

Re: Duplicate Layer with layer name + 1?

Post by Sewie »

Yes, it is weird.

When I press "Create Layer" in the Layer Preset Manager it adds the zeros, but when I press the shortcut key it just adds a new layer with the same exact name and structure. It didn't do that before I opened it... Also, I can't seem to add a shortcut through the Layer Preset Manager.

What is happening...? :shock: :shock:
Michael Sewnarain - Website
Windows 11/64b Pro - TVP11.7.0 & 11.7.1 - Pro/64b - Cintiq32 Pro - Intel i7-12700K - 64Gb RAM
Svengali
Posts: 1571
Joined: 28 Dec 2006, 10:08

Re: Duplicate Layer with layer name + 1?

Post by Svengali »

kariP wrote: 14 Feb 2018, 12:12 %cln %i should (in my logic) give out
I think you must remove the blank between %cln and %i.

What I get is:
existing Layername becomes
Layername_0
subsequent, new Layername becomes
Layername_1
Layername_2
etc.

Sven
TVP Pro 11.0.10-64bit Win10 - 64GB ram -2TB HHD - 256GB SSD - Wacom Cintiq 16, driver 6.3.41-1
Android Tablet: rel. 11, Samsung Galaxy Note10.1 - 32GB with microSD 32GB
Android Tablet: rel. 11.5, Samsung Galaxy Tab S7plus - 128GB with microSD 64GB
User avatar
Sewie
Posts: 1310
Joined: 18 Jun 2008, 11:57
Location: The Netherlands, Europe
Contact:

Re: Duplicate Layer with layer name + 1?

Post by Sewie »

It doesn't work for me, Sven.

I get:

Layername (original layer)

subsequent, new Layername becomes
Layername0
Layername00
Layername000

etc.

Also, I can't seem to assign a shortcut key through the layer preset manager.
Michael Sewnarain - Website
Windows 11/64b Pro - TVP11.7.0 & 11.7.1 - Pro/64b - Cintiq32 Pro - Intel i7-12700K - 64Gb RAM
Svengali
Posts: 1571
Joined: 28 Dec 2006, 10:08

Re: Duplicate Layer with layer name + 1?

Post by Svengali »

Sewie, you are right, I tested it again trying numerous variations and, indeed, it doesn't work as advertised. Too bad, it promises to be very useful... :(


Wait a minute, try this:

%cln_%i
the underscore parser must be essential... nope, underscore isn't necessary, works with a space: %cln %i

In the end, I think you MUST always go back and re-select the ORIGINAL layer, then the increment seems to work...

Sven
TVP Pro 11.0.10-64bit Win10 - 64GB ram -2TB HHD - 256GB SSD - Wacom Cintiq 16, driver 6.3.41-1
Android Tablet: rel. 11, Samsung Galaxy Note10.1 - 32GB with microSD 32GB
Android Tablet: rel. 11.5, Samsung Galaxy Tab S7plus - 128GB with microSD 64GB
User avatar
Sewie
Posts: 1310
Joined: 18 Jun 2008, 11:57
Location: The Netherlands, Europe
Contact:

Re: Duplicate Layer with layer name + 1?

Post by Sewie »

Sven, this does not work for me. I don't know what you've done but if I follow your post I get the strangest results. Perhaps you can add screenshots or something??
Adding an underscore leaves me with.


Layername (original layer)

subsequent, new Layername becomes
Layername_0
Layername_0_0
Layername_0_0_0

I'm going to add that this is a bug in the thread title, perhaps the developers will notice. Because we are running circles here.

Edit;

Wait, I see now what you mean. You have to go back and re-select the original layer before adding a new layer or duplicating, every time. Only then will TVP add an incremental number. I don't see how that is practical in everyday use, so I still think this is a BUG. Either in the software's code or in the team's interpretation of the users workflow.

The problem with not being able to create a shortcut through the Layer Preset Manager remains. (Also a bug I, believe.)
Michael Sewnarain - Website
Windows 11/64b Pro - TVP11.7.0 & 11.7.1 - Pro/64b - Cintiq32 Pro - Intel i7-12700K - 64Gb RAM
Svengali
Posts: 1571
Joined: 28 Dec 2006, 10:08

Re: Duplicate Layer with layer name + 1? - BUG REPORT

Post by Svengali »

That's it... but I think the complication is in making the duplication routine KNOW that the correct root is used in generating increments.

I never took a close look at the New layer options before. In fact, it took me a while to discover how to edit and delete new-layer-definition rules I'd messed up! Once you understand the rules, it is potentially a very useful function for layer manipulation!

Sven
TVP Pro 11.0.10-64bit Win10 - 64GB ram -2TB HHD - 256GB SSD - Wacom Cintiq 16, driver 6.3.41-1
Android Tablet: rel. 11, Samsung Galaxy Note10.1 - 32GB with microSD 32GB
Android Tablet: rel. 11.5, Samsung Galaxy Tab S7plus - 128GB with microSD 64GB
User avatar
Sewie
Posts: 1310
Joined: 18 Jun 2008, 11:57
Location: The Netherlands, Europe
Contact:

Re: Duplicate Layer with layer name + 1? - BUG REPORT

Post by Sewie »

Thanks Sven, I see what you mean.

So if this is what the code does now:

1- takes the original layer name as the root name for the layer to be created.
2- next, the entire list of existing layers is searched to find the HIGHEST existing incremented name.
3- finally, another incremental layer is created using a number ONE HIGHER that the highest existing layer with the same root.


Then the solution would be to replace step 1, and instead take the selected layer as the name for the layer to be created? I'm not a coder but hopefully we are offering the team part of a solution for this particular problem.
Michael Sewnarain - Website
Windows 11/64b Pro - TVP11.7.0 & 11.7.1 - Pro/64b - Cintiq32 Pro - Intel i7-12700K - 64Gb RAM
User avatar
Animark
Posts: 505
Joined: 16 Oct 2008, 15:26
Location: Berlin

Re: Duplicate Layer with layer name + 1? - BUG REPORT

Post by Animark »

I know, it's another thing, but it was inspired by this discussion.

It's my first george-script ever and it just covers the base idea of numbering layers. It works fine for my personal use, but it has some limitations. You get an error message, if the last letter of the layers name is not a number. And it will only increase the last number of the name, so after number 19 you'll get 110, 111, ....

Parts of the script are taken from this posting: http://forum.tvpaint.com/viewtopic.php?f=34&t=10294

How to use:
1. The script just gives new layer names. The duplicating of a layer is done by (Key:Layer:Duplicate Instances)
2. The layers name has to have a number as the last letter
doubleLayerPlusNumber.JPG
doubleLayerPlusNumber.JPG (39.15 KiB) Viewed 33593 times
DoubleLayerPlusNumber.tvpx
(5.5 KiB) Downloaded 1336 times
TVPaint 10.5.7 - Win10/64
TVPaint 11.0.8 - Win10/64
TVPaint 11.0.8 - Win10/64 (Wacom Companion 2)
User avatar
Animationriver
Posts: 258
Joined: 02 Jul 2017, 09:04
Location: Moscow
Contact:

Re: Duplicate Layer with layer name + 1? - BUG REPORT

Post by Animationriver »

Big Thanks!!! :D
www.youtube.com/c/animationriver
MAC OS Sierra 10.12.6 64 bits , MacBook Pro (Retina, 15-inch, Mid 2014)
2.8 GHz Intel Core i7, 16 GB Memory , TVPaint PRO 11.5.2 64bit
NVIDIA GeForce GT 750M 2048 Мb
Wacom Cintiq 27 QHD Touch - Wacom Intuos Pro 5 - driver version 6.3.37-2
User avatar
Sewie
Posts: 1310
Joined: 18 Jun 2008, 11:57
Location: The Netherlands, Europe
Contact:

Re: Duplicate Layer with layer name + 1? - BUG REPORT

Post by Sewie »

Thanks, Animark.

That will help for now, though I'd much rather see the bugs in the Layer Management Panel fixed without the addition of yet another custom panel. These things have a tendency of multiplying faster than vermin.
Michael Sewnarain - Website
Windows 11/64b Pro - TVP11.7.0 & 11.7.1 - Pro/64b - Cintiq32 Pro - Intel i7-12700K - 64Gb RAM
User avatar
D.T. Nethery
Posts: 4225
Joined: 27 Sep 2006, 19:19

Re: Duplicate Layer with layer name + 1? - BUG REPORT

Post by D.T. Nethery »

Sewie wrote: 17 Feb 2018, 09:59 You have to go back and re-select the original layer before adding a new layer or duplicating, every time. Only then will TVP add an incremental number. I don't see how that is practical in everyday use, so I still think this is a BUG. Either in the software's code or in the team's interpretation of the users workflow.

The problem with not being able to create a shortcut through the Layer Preset Manager remains. (Also a bug I, believe.)
Sewie wrote: 20 Feb 2018, 10:26 Thanks, Animark. That will help for now, though I'd much rather see the bugs in the Layer Management Panel fixed without the addition of yet another custom panel.
Bump.

The bug reported by Sewie (see his first post above) about the naming/numbering structure in Layer Presets has not been addressed. The scripting tips posted by Svengali and the custom panel posted by Animark present workarounds for the problem , but as Sewie points out , the proliferation of custom panels as workarounds to accomplish what should be built-in to the software can be overwhelming.

Would it be possible to fix this issue with the Layer Presets panel?

Animator, TVPaint Beta-Tester, Animation Educator and Consultant.
MacOS 12.7.1 Monterey , Mac Mini (2018) , 3.2 GHz 6-Core Intel Core i7,
16 GB RAM , TVPaint PRO 11.7.1 - 64bit , Wacom Cintiq 21UX 2nd Gen.
,Wacom Intuos Pro 5 , Wacom driver version 6.3.39-1
Post Reply